Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.15.z] [E2E] Recalculate applicability before UI session, fix navigation failure #14110

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions tests/foreman/ui/test_errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ def test_end_to_end(
registered_contenthost.execute(f'yum remove -y {FAKE_1_CUSTOM_PACKAGE_NAME}')
result = registered_contenthost.execute(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}')
assert result.status == 0, f'Failed to install package {FAKE_1_CUSTOM_PACKAGE}.'
# recalculate and assert applicable errata after installing outdated pkg
assert registered_contenthost.execute('subscription-manager repos').status == 0
applicable_errata = registered_contenthost.applicable_errata_count
assert (
applicable_errata == 1
Expand All @@ -402,9 +404,13 @@ def test_end_to_end(
# Check selection box function for BZ#1688636
session.location.select(loc_name=DEFAULT_LOC)
session.organization.select(org_name=module_org.name)
assert session.errata.search_content_hosts(
CUSTOM_REPO_ERRATA_ID, registered_contenthost.hostname, environment=module_lce.name
), 'Errata ID not found on registered contenthost or the host lifecycle-environment.'
results = session.errata.search_content_hosts(
entity_name=CUSTOM_REPO_ERRATA_ID,
value=registered_contenthost.hostname,
environment=module_lce.name,
)
assert len(results) == 1
assert results[0]['Name'] == registered_contenthost.hostname
errata = session.errata.read(CUSTOM_REPO_ERRATA_ID)
assert errata['repositories']['table'][-1]['Name'] == _repository.name
assert errata['repositories']['table'][-1]['Product'] == _product.name
Expand Down Expand Up @@ -435,6 +441,7 @@ def test_end_to_end(
search_rate=2,
max_tries=60,
)
# poll most recent errata install (newest id#)
results.sort(key=lambda res: res.id)
task_status = module_target_sat.api.ForemanTask(id=results[-1].id).poll()
assert (
Expand Down Expand Up @@ -469,9 +476,12 @@ def test_end_to_end(

# Errata should still be visible on satellite, but not on contenthost
assert session.errata.read(CUSTOM_REPO_ERRATA_ID)
assert not session.errata.search_content_hosts(
CUSTOM_REPO_ERRATA_ID, registered_contenthost.hostname, environment=module_lce.name
results = session.errata.search_content_hosts(
entity_name=CUSTOM_REPO_ERRATA_ID,
value=registered_contenthost.hostname,
environment=module_lce.name,
)
assert len(results) == 0
# Check package version was updated on contenthost
_package_version = registered_contenthost.execute(
f'rpm -q {FAKE_1_CUSTOM_PACKAGE_NAME}'
Expand Down
Loading