Skip to content

Commit

Permalink
Using YUM-9 Security Errata, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
damoore044 committed Oct 6, 2023
1 parent e37339b commit e737cc6
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions tests/foreman/api/test_errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,19 @@ def test_positive_install_multiple_in_host(
rhel_contenthost.register_contenthost(function_org.name, activation_key.name, function_lce.name)
rhel_contenthost.run(r'subscription-manager repos --enable \*')
assert rhel_contenthost.subscribed
# Installing outdated custom packages:
for package in constants.FAKE_9_YUM_OUTDATED_PACKAGES:
assert rhel_contenthost.run(f'yum install -y {package}').status == 0
applicable_errata_count = rhel_contenthost.applicable_errata_count
assert applicable_errata_count > 1
assert rhel_contenthost.run(f'rpm -q {package}').status == 0
rhel_contenthost.add_rex_key(satellite=module_target_sat)
original_applicable_count = rhel_contenthost.applicable_errata_count

# Each applicable errata will be installed sequentially,
# Each errata will be installed sequentially,
# after each install, applicable-errata-count should drop by one.
for errata in settings.repos.yum_9.errata[1:4]:
installed_errata_count = 0
for errata in constants.FAKE_9_YUM_SECURITY_ERRATUM:
applicable_errata_count = rhel_contenthost.applicable_errata_count
assert applicable_errata_count > 1
task_id = module_target_sat.api.JobInvocation().run(
data={
'feature': 'katello_errata_install',
Expand All @@ -227,6 +231,12 @@ def test_positive_install_multiple_in_host(
)
applicable_errata_count -= 1
assert rhel_contenthost.applicable_errata_count == applicable_errata_count
installed_errata_count += 1

assert (
rhel_contenthost.applicable_errata_count
== original_applicable_count - installed_errata_count
)


@pytest.mark.tier3
Expand Down

0 comments on commit e737cc6

Please sign in to comment.