Skip to content

Commit

Permalink
Updates for new host, and legacy chost pages
Browse files Browse the repository at this point in the history
  • Loading branch information
damoore044 committed May 1, 2024
1 parent 9448d4b commit 20a3ede
Showing 1 changed file with 52 additions and 18 deletions.
70 changes: 52 additions & 18 deletions tests/foreman/ui/test_errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1089,35 +1089,69 @@ def test_positive_content_host_previous_env(


@pytest.mark.tier3
@pytest.mark.rhel_ver_match('8')
@pytest.mark.parametrize(
'registered_contenthost',
[[CUSTOM_REPO_URL]],
indirect=True,
)
def test_positive_check_errata(session, module_org_with_parameter, registered_contenthost):
"""Check if the applicable errata is available from the host page
@pytest.mark.rhel_ver_match('[8, 9]')
def test_positive_host_content_library(
registered_contenthost,
function_lce,
module_lce,
session,
):
"""Check if the applicable errata are available from the content host's Library.
View errata table from within All Hosts, and legacy Contenthosts pages.
:id: a0694930-4bf7-4a97-b275-2be7d5f1b311
:Setup:
1. Multiple environments are present, we will use 'Library'.
2. A registered host's Library environment has some additional errata.
:steps:
1. Go to All hosts
2. Select the host
3. Content Tab -> Errata Tab
4. Check the errata
1. Install the outdated package to registered host, making an errata applicable.
2. Go to new All Hosts -> Select the host -> Content -> Errata Tab.
3. Go to Legacy Content Hosts -> Select the host -> Errata Tab -> 'Library' env.
4. Search for the errata by id. Then, check the entire table without filtering.
:expectedresults: The errata is displayed on the host page Content-Errata tab
:expectedresults: The expected errata id present in Library is displayed.
Only a single errata is present, the tables match between the two pages.
:parametrized: yes
"""
hostname = registered_contenthost.hostname
client = registered_contenthost

assert client.applicable_errata_count == 0
assert client.execute(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}').status == 0
assert client.applicable_errata_count == 1
assert client.applicable_package_count == 1

vm = registered_contenthost
hostname = vm.hostname
assert vm.execute(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}').status == 0
with session:
session.location.select(loc_name=DEFAULT_LOC)
read_errata = session.host_new.get_details(hostname, 'Content.Errata')
assert read_errata['Content']['Errata']['table'][0]['Errata'] == CUSTOM_REPO_ERRATA_ID
# check new host > host > content > errata tab:
host_tab_search = session.host_new.get_errata_table(
entity_name=hostname,
search=f'errata_id="{CUSTOM_REPO_ERRATA_ID}"',
)
# found desired errata_id by search
assert len(host_tab_search) == 1
assert host_tab_search[0]['Errata'] == CUSTOM_REPO_ERRATA_ID
# no filters passed, checking all errata present
host_tab_erratum = session.host_new.get_errata_table(hostname)
# only the expected errata_id is found
assert len(host_tab_erratum) == 1
assert host_tab_erratum[0]['Errata'] == CUSTOM_REPO_ERRATA_ID
# check legacy chost > chost > errata tab -- search:
single_chost_search = session.contenthost.search_errata(
hostname, CUSTOM_REPO_ERRATA_ID, environment='Library Synced Content'
)
# found desired errata_id by search
assert len(single_chost_search) == 1
assert single_chost_search[0]['Id'] == CUSTOM_REPO_ERRATA_ID
# display all entries in chost table, only the expected one is present
all_chost_erratum = session.contenthost.search_errata(
hostname, errata_id=' ', environment='Library Synced Content'
)
assert len(all_chost_erratum) == 1
assert all_chost_erratum[0]['Id'] == CUSTOM_REPO_ERRATA_ID


@pytest.mark.tier3
Expand Down

0 comments on commit 20a3ede

Please sign in to comment.