Skip to content

Commit

Permalink
Update to use .register() method, the preferred way without katello-a…
Browse files Browse the repository at this point in the history
…gent
  • Loading branch information
damoore044 committed Oct 9, 2023
1 parent 7aacb77 commit c58ce54
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/foreman/api/test_errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def test_positive_install_in_hc(module_org, activation_key, custom_repo, target_
@pytest.mark.no_containers
@pytest.mark.e2e
def test_positive_install_multiple_in_host(
function_org, rhel_contenthost, target_sat, function_lce
target_sat, rhel_contenthost, function_org, function_lce
):
"""For a host with multiple applicable errata install one and ensure
the rest of errata is still available
Expand Down Expand Up @@ -199,17 +199,21 @@ def test_positive_install_multiple_in_host(
'activationkey-id': ak.id,
}
)
# Install katello-ca, register content-host, enable all repos:
rhel_contenthost.install_katello_ca(target_sat)
rhel_contenthost.register_contenthost(function_org.name, ak.name, function_lce.name)
rhel_contenthost.register(
org=function_org,
activation_keys=ak.name,
lifecycle_environment=function_lce,
target=target_sat,
force=True,
loc=None,
)
assert rhel_contenthost.subscribed
# Installing outdated custom packages:
for package in constants.FAKE_9_YUM_OUTDATED_PACKAGES:
rhel_contenthost.run(f'yum remove -y {str(package.split("-", 1)[0])}')
assert rhel_contenthost.run(f'yum install -y {package}').status == 0
assert rhel_contenthost.run(f'rpm -q {package}').status == 0
rhel_contenthost.add_rex_key(satellite=target_sat)
rhel_contenthost.run(r'subscription-manager repos --enable \*')
# 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:
Expand Down

0 comments on commit c58ce54

Please sign in to comment.