From e4e0e0efd1ede93c4095f309dfc9d58ca794e64f Mon Sep 17 00:00:00 2001 From: David Moore Date: Wed, 22 Nov 2023 08:14:51 -0500 Subject: [PATCH] Check RHEL Lifecycle status in ContentHost UI --- tests/foreman/ui/test_contenthost.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tests/foreman/ui/test_contenthost.py b/tests/foreman/ui/test_contenthost.py index 01e5d7db5cf..82e1271b524 100644 --- a/tests/foreman/ui/test_contenthost.py +++ b/tests/foreman/ui/test_contenthost.py @@ -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. @@ -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(