Skip to content

Commit

Permalink
Fix useless asserts in installer tests (#14099)
Browse files Browse the repository at this point in the history
fix useless asserts

(cherry picked from commit 44ee8bf)
  • Loading branch information
rmynar authored and web-flow committed Feb 19, 2024
1 parent 9b937d8 commit b2d422a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions tests/foreman/destructive/test_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ def test_installer_sat_pub_directory_accessibility(target_sat):
https_curl_command = f'curl -i {target_sat.url}/pub/ -k'
for command in [http_curl_command, https_curl_command]:
accessibility_check = target_sat.execute(command)
assert 'HTTP/1.1 200 OK' or 'HTTP/2 200 ' in accessibility_check.stdout.split('\r\n')
assert (
'HTTP/1.1 200 OK' in accessibility_check.stdout
or 'HTTP/2 200' in accessibility_check.stdout
)
target_sat.get(
local_path='custom-hiera-satellite.yaml',
remote_path=f'{custom_hiera_location}',
Expand All @@ -74,7 +77,8 @@ def test_installer_sat_pub_directory_accessibility(target_sat):
assert 'Success!' in command_output.stdout
for command in [http_curl_command, https_curl_command]:
accessibility_check = target_sat.execute(command)
assert 'HTTP/1.1 200 OK' or 'HTTP/2 200 ' not in accessibility_check.stdout.split('\r\n')
assert 'HTTP/1.1 200 OK' not in accessibility_check.stdout
assert 'HTTP/2 200' not in accessibility_check.stdout
target_sat.put(
local_path='custom-hiera-satellite.yaml',
remote_path=f'{custom_hiera_location}',
Expand Down
8 changes: 6 additions & 2 deletions tests/foreman/installer/test_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,10 @@ def test_installer_cap_pub_directory_accessibility(capsule_configured):
https_curl_command = f'curl -i {capsule_configured.url}/pub/ -k'
for command in [http_curl_command, https_curl_command]:
accessibility_check = capsule_configured.execute(command)
assert 'HTTP/1.1 200 OK' or 'HTTP/2 200 ' in accessibility_check.stdout.split('\r\n')
assert (
'HTTP/1.1 200 OK' in accessibility_check.stdout
or 'HTTP/2 200' in accessibility_check.stdout
)
capsule_configured.get(
local_path='custom-hiera-capsule.yaml',
remote_path=f'{custom_hiera_location}',
Expand All @@ -1753,7 +1756,8 @@ def test_installer_cap_pub_directory_accessibility(capsule_configured):
assert 'Success!' in command_output.stdout
for command in [http_curl_command, https_curl_command]:
accessibility_check = capsule_configured.execute(command)
assert 'HTTP/1.1 200 OK' or 'HTTP/2 200 ' not in accessibility_check.stdout.split('\r\n')
assert 'HTTP/1.1 200 OK' not in accessibility_check.stdout
assert 'HTTP/2 200' not in accessibility_check.stdout
capsule_configured.put(
local_path='custom-hiera-capsule.yaml',
remote_path=f'{custom_hiera_location}',
Expand Down

0 comments on commit b2d422a

Please sign in to comment.