Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
damoore044 committed May 17, 2024
1 parent 45cff78 commit d9d8b0b
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions tests/foreman/ui/test_errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,9 @@ def test_end_to_end(
# BZ 2265095: Check all columns in table of applicable host:
# from ContentTypes > Errata > Details > Content Hosts tab
assert results[0]['Name'] == hostname
#assert str(client.deploy_rhel_version) in results[0]['OS']
#assert results[0]['Environment'] == module_lce.name
#assert results[0]['Content View'] == module_cv.name
# assert str(client.deploy_rhel_version) in results[0]['OS']
# assert results[0]['Environment'] == module_lce.name
# assert results[0]['Content View'] == module_cv.name
# Check errata details
errata = session.errata.read(CUSTOM_REPO_ERRATA_ID)
assert errata['repositories']['table'], (
Expand Down Expand Up @@ -907,7 +907,9 @@ def test_positive_list_permission(
)
rh_repo = module_target_sat.api.Repository(id=rh_repo_id).read()
rh_repo.sync()
custom_repo = module_target_sat.api.Repository(url=CUSTOM_REPO_URL, product=function_product).create()
custom_repo = module_target_sat.api.Repository(
url=CUSTOM_REPO_URL, product=function_product
).create()
custom_repo.sync()
# create role with access only to 'RHEL8' RedHat product
role = module_target_sat.api.Role().create()
Expand Down Expand Up @@ -972,15 +974,20 @@ def test_positive_apply_for_all_hosts(
:expectedresults: Check that the erratum is applied in all the content
hosts.
"""
num_hosts = 4
distro = 'rhel9'
# one custom repo on satellite, for all hosts to use
custom_repo = target_sat.api.Repository(url=CUSTOM_REPO_URL, product=module_product).create()
custom_repo.sync()
module_cv.repository = [custom_repo]
module_cv.update(['repository'])
with Broker(
nick='rhel9', workflow='deploy-rhel', host_class=ContentHost, _count=4,
nick=distro,
workflow='deploy-rhel',
host_class=ContentHost,
_count=num_hosts,
) as hosts:
if not isinstance(hosts, list) or len(hosts) != 4:
if not isinstance(hosts, list) or len(hosts) != num_hosts:
pytest.fail('Failed to provision the expected number of hosts.')
for client in hosts:
# setup/register all hosts to same ak, content-view, and the one custom repo
Expand All @@ -995,21 +1002,33 @@ def test_positive_apply_for_all_hosts(
assert setup['result'] != 'error', f'{setup["message"]}'
assert (client := setup['client'])
assert client.subscribed
assert client.execute(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}').status == 0
pkgs = ' '.join(FAKE_9_YUM_OUTDATED_PACKAGES)
assert client.execute(f'yum install -y {pkgs}').status == 0
assert client.execute('subscription-manager repos').status == 0

with session:
session.location.select(loc_name=DEFAULT_LOC)
# for first errata, install in each chost and check, one at a time
for client in hosts:
status = session.contenthost.install_errata(
client.hostname, CUSTOM_REPO_ERRATA_ID, install_via='rex'
)
assert status['overview']['job_status'] == 'Success'
assert status['overview']['job_status_progress'] == '100%'
# check updated package in chost details
packages_rows = session.contenthost.search_package(
client.hostname, FAKE_2_CUSTOM_PACKAGE
)
assert packages_rows[0]['Installed Package'] == FAKE_2_CUSTOM_PACKAGE
# for second errata, install into all chosts at once
# from Content > Errata > info > ContentHosts tab
session.errata.install(
entity_name=settings.repos.yum_9.errata[2],
host_names="All",
)
# bulk action task for expected hosts

# check each task status and package version, for each chost


@pytest.mark.tier2
Expand Down Expand Up @@ -1677,7 +1696,9 @@ def test_content_host_errata_search_commands(
:BZ: 1707335
"""
yum_9_repo = target_sat.api.Repository(url=CUSTOM_REPO_URL, product=module_product).create()
yum_6_repo = target_sat.api.Repository(url=settings.repos.yum_6.url, product=module_product).create()
yum_6_repo = target_sat.api.Repository(
url=settings.repos.yum_6.url, product=module_product
).create()
yum_9_repo.sync()
yum_6_repo.sync()
module_cv.repository = [yum_6_repo, yum_9_repo]
Expand Down

0 comments on commit d9d8b0b

Please sign in to comment.