Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and update installer ping test #13614

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions tests/foreman/installer/test_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1628,18 +1628,10 @@ def test_positive_check_installer_hammer_ping(target_sat):
"""
# check status reported by hammer ping command
result = target_sat.execute('hammer ping')
test_result = {}
service = None
for line in result.stdout.strip().replace(' ', '').split('\n'):
if line.split(':')[0] not in ('Status', 'ServerResponse', 'message'):
service = line.split(':')[0]
test_result[service] = {}
else:
key, value = line.split(":", 1)
test_result[service][key] = value

not_ok = {svc: result for svc, result in test_result.items() if result['Status'] != 'ok'}
assert not not_ok
assert result.status == 0
for line in result.stdout.split('\n'):
if 'Status' in line:
assert 'ok' in line
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a weaker assertion. For example, when I stop the foreman services, I get this output and the assertion won't fail for it:

Error: Failed to open TCP connection to <FQDN>:443 (Connection refused - connect(2) for "<FQDN>" port 443)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm good catch. I'll reevaluate.



@pytest.mark.e2e
Expand Down
Loading