Skip to content

Commit

Permalink
Check RHEL Lifecycle status in ContentHost UI
Browse files Browse the repository at this point in the history
  • Loading branch information
damoore044 committed Nov 28, 2023
1 parent 7d1cdf6 commit e4e0e0e
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion tests/foreman/ui/test_contenthost.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ def run_remote_command_on_content_host(command, vm_module_streams):
indirect=True,
)
@pytest.mark.no_containers
def test_positive_end_to_end(session, default_location, module_repos_collection_with_manifest, vm):
def test_positive_end_to_end(
session, default_location, module_org, module_repos_collection_with_manifest, vm
):
"""Create all entities required for content host, set up host, register it
as a content host, read content host details, install package and errata.
Expand All @@ -135,11 +137,29 @@ def test_positive_end_to_end(session, default_location, module_repos_collection_
:CaseImportance: Critical
"""
rhel_lifecycle_status = 'Unknown'
_distro = module_repos_collection_with_manifest.distro
if _distro == 'rhel7':
rhel_lifecycle_status = 'Approaching end of maintenance support'
elif _distro == 'rhel8':
rhel_lifecycle_status = 'Full support'

result = vm.run(f'yum -y install {FAKE_1_CUSTOM_PACKAGE}')
assert result.status == 0
startdate = datetime.utcnow().strftime('%m/%d/%Y')
with session:
host_details = session.host_new.get_details(vm.hostname)
assert (
rhel_lifecycle_status
in host_details['properties']['properties_table']['RHEL lifecycle']
)
session.location.select(default_location.name)
session.organization.select(module_org.name)
# Use new_host UI,only to check new page's status and RHEL details
session.settings.update(f'name = {"new_hosts_page"}', 'Yes')
host_status = session.host_new.get_host_statuses(vm.hostname)
assert rhel_lifecycle_status in host_status['RHEL lifecycle']['Status']
session.settings.update(f'name = {"new_hosts_page"}', 'No')
# Ensure content host is searchable
assert session.contenthost.search(vm.hostname)[0]['Name'] == vm.hostname
chost = session.contenthost.read(
Expand Down

0 comments on commit e4e0e0e

Please sign in to comment.