Skip to content

Commit b5a75e6

Browse files
authored
Fix test_positive_host_with_rolling_content_source (#20633)
* Use rhel_contenthost since we parametrize by RHEL version anyway * Add Library LCE to the Rolling CV (stream only) * Do NOT expect python3 to be pre-installed (case of RHEL8) * Block the case by SAT-30580 since it affects the errata counts (it should have been blocked in #19262)
1 parent 4c1576e commit b5a75e6

1 file changed

Lines changed: 9 additions & 19 deletions

File tree

tests/foreman/api/test_contentview.py

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,10 +1110,9 @@ def test_negative_rolling_in_a_composite(self, target_sat):
11101110
def test_positive_host_with_rolling_content_source(
11111111
self,
11121112
target_sat,
1113-
module_rhel_contenthost,
1113+
rhel_contenthost,
11141114
function_sca_manifest_org,
11151115
function_product,
1116-
request,
11171116
):
11181117
"""Can use the rolling content view as a content source for a registered host.
11191118
We can use the custom and RedHat repositories available to the content host.
@@ -1125,9 +1124,8 @@ def test_positive_host_with_rolling_content_source(
11251124
1) Several custom and RedHat repositories added to new rolling cv.
11261125
2) Assign the rolling cv to an activation key.
11271126
3) Override the repos to Enabled for activation key (Hammer).
1128-
4) Add finalizer, cleanup: unregister the host.
1129-
5) Register a RHEL host to the activation key.
1130-
6) SCA enabled, host auto-enabled repos that were overridden for AK.
1127+
4) Register a RHEL host with the activation key.
1128+
5) SCA enabled, host auto-enabled repos that were overridden for AK.
11311129
11321130
:steps:
11331131
1) Remove a repository from the rolling cv. (expectedresults: 3)
@@ -1148,9 +1146,11 @@ def test_positive_host_with_rolling_content_source(
11481146
11491147
:customerscenario: true
11501148
1149+
:BlockedBy: SAT-30580
1150+
11511151
"""
11521152
org = function_sca_manifest_org
1153-
client = module_rhel_contenthost
1153+
client = rhel_contenthost
11541154
custom_repo = target_sat.api.Repository(
11551155
product=function_product, url=settings.repos.yum_9.url
11561156
).create()
@@ -1164,7 +1164,9 @@ def test_positive_host_with_rolling_content_source(
11641164
)
11651165
rh_repo = target_sat.api.Repository(id=rh_repo_id, organization=org).read()
11661166
# Create empty rolling cv, add both repos, update it
1167-
rolling_cv = target_sat.api.ContentView(organization=org, rolling=True).create()
1167+
rolling_cv = target_sat.api.ContentView(
1168+
organization=org, rolling=True, environment=[org.library]
1169+
).create()
11681170
rolling_cv.repository = [custom_repo.read(), rh_repo.read()]
11691171
rolling_cv.update(['repository'])
11701172
rolling_cv = rolling_cv.read()
@@ -1182,14 +1184,6 @@ def test_positive_host_with_rolling_content_source(
11821184
)
11831185
assert override['result'] == 'success'
11841186

1185-
# Cleanup for in-between parametrized sessions,
1186-
# unregister the host if it still exists
1187-
@request.addfinalizer
1188-
def cleanup():
1189-
nonlocal client
1190-
if client:
1191-
client.unregister()
1192-
11931187
result = client.register(
11941188
target=target_sat,
11951189
activation_keys=ak.name,
@@ -1215,10 +1209,6 @@ def cleanup():
12151209
rh_repo_content_label = target_sat.cli.Repository.info({'id': rh_repo.id})['content-label']
12161210
assert rh_repo_content_label in sub_man_repos
12171211
time.sleep(30)
1218-
# rh repo's package (python) is installed and up to date
1219-
assert 'x86_64' in client.execute('rpm -q python3').stdout
1220-
result = client.execute('yum install -y python3')
1221-
assert 'is already installed' in result.stdout
12221212
# custom repo's outdated package can be installed
12231213
assert client.execute(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}').status == 0
12241214
# outdated package makes errata installable, count increased

0 commit comments

Comments
 (0)