Skip to content

Commit

Permalink
run s-m repos cmmd, cv is unnecesarry
Browse files Browse the repository at this point in the history
  • Loading branch information
damoore044 committed Oct 10, 2023
1 parent 400dbcf commit 890e750
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions tests/foreman/api/test_errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
:Upstream: No
"""
# For ease of use hc refers to host-collection throughout this document
from copy import copy
from time import sleep

from nailgun import entities
Expand Down Expand Up @@ -159,12 +158,10 @@ def test_positive_install_in_hc(module_org, activation_key, custom_repo, target_


@pytest.mark.tier3
@pytest.mark.rhel_ver_match(r'^(?!6$)\d+$')
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.no_containers
@pytest.mark.e2e
def test_positive_install_multiple_in_host(
target_sat, rhel_contenthost, function_org, function_lce
):
def test_positive_install_multiple_in_host(target_sat, rhel_contenthost, module_org, module_lce):
"""For a host with multiple applicable errata install one and ensure
the rest of errata is still available
Expand All @@ -184,22 +181,23 @@ def test_positive_install_multiple_in_host(
:CaseLevel: System
"""
ak = target_sat.api.ActivationKey(organization=function_org).create()
cv = target_sat.api.ContentView(organization=function_org).create()
# Associate custom repos with org, cv, lce, ak:
ak = target_sat.api.ActivationKey(
organization=module_org,
environment=module_lce,
).create()
# Associate custom repos with org, lce, ak:
target_sat.cli_factory.setup_org_for_a_custom_repo(
{
'url': settings.repos.yum_9.url,
'organization-id': function_org.id,
'content-view-id': cv.id,
'lifecycle-environment-id': function_lce.id,
'organization-id': module_org.id,
'lifecycle-environment-id': module_lce.id,
'activationkey-id': ak.id,
}
)
rhel_contenthost.register(
org=function_org,
activation_keys=ak.name,
target=target_sat,
org=module_org,
loc=None,
)
assert rhel_contenthost.subscribed
Expand All @@ -211,22 +209,23 @@ def test_positive_install_multiple_in_host(
# Each errata will be installed sequentially,
# after each install, applicable-errata-count should drop by one.
for errata in constants.FAKE_9_YUM_SECURITY_ERRATUM:
pre_errata_count = copy(rhel_contenthost.applicable_errata_count)
pre_errata_count = rhel_contenthost.applicable_errata_count
assert pre_errata_count >= 1
task_id = target_sat.api.JobInvocation().run(
data={
'feature': 'katello_errata_install',
'inputs': {'errata': str(errata)},
'targeting_type': 'static_query',
'search_query': f'name = {rhel_contenthost.hostname}',
'organization_id': function_org.id,
'organization_id': module_org.id,
},
)['id']
target_sat.wait_for_tasks(
search_query=(f'label = Actions::RemoteExecution::RunHostsJob and id = {task_id}'),
search_rate=20,
max_tries=15,
)
rhel_contenthost.run('subscription-manager repos')
sleep(10)
assert rhel_contenthost.applicable_errata_count == pre_errata_count - 1

Expand Down

0 comments on commit 890e750

Please sign in to comment.