Skip to content

Commit 594358a

Browse files
committed
Fix test_podman_login_check finalizer to restore podman login after test
1 parent b63db29 commit 594358a

2 files changed

Lines changed: 9 additions & 22 deletions

File tree

pytest_fixtures/component/maintain.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ def sat_maintain(request):
5757
infra_host.register_to_cdn()
5858
else:
5959
infra_host = _get_satellite_host(request)
60-
60+
if getattr(infra_host, 'iop_enabled', False):
61+
satellite = request.getfixturevalue('module_target_sat')
62+
satellite.uninstall_iop()
6163
yield infra_host
6264

6365
if host_type == 'satellite_iop':

tests/foreman/maintain/test_health.py

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ def test_podman_login_check(request, sat_maintain):
4747
"""
4848
iop_settings = settings.rh_cloud.iop_advisor_engine
4949

50-
request.addfinalizer(lambda: sat_maintain.podman_logout(iop_settings.registry))
50+
# Restore podman login after test so the same host is left in good state
51+
request.addfinalizer(
52+
lambda: sat_maintain.podman_login(
53+
iop_settings.username, iop_settings.token, iop_settings.registry
54+
)
55+
)
5156

5257
check_description = 'Check whether podman needs to be logged in to the registry'
5358
fail_message = (
@@ -166,26 +171,6 @@ def test_positive_health_check_by_tags(sat_maintain):
166171
)
167172

168173

169-
@pytest.mark.include_capsule
170-
def test_positive_health_check_pre_upgrade(sat_maintain):
171-
"""Verify pre-upgrade health checks
172-
173-
:id: f52bd43e-79cd-488b-adbb-3c9e5bac32cc
174-
175-
:parametrized: yes
176-
177-
:steps:
178-
1. Run satellite-maintain health check --tags pre-upgrade
179-
180-
:expectedresults: Pre-upgrade health checks should pass.
181-
"""
182-
result = sat_maintain.cli.Health.check(
183-
options={'tags': 'pre-upgrade', 'whitelist': 'non-rh-packages'}
184-
)
185-
assert result.status == 0
186-
assert 'FAIL' not in result.stdout
187-
188-
189174
@pytest.mark.include_capsule
190175
def test_positive_health_check_server_ping(sat_maintain):
191176
"""Verify server ping check

0 commit comments

Comments
 (0)