diff --git a/tests/foreman/ui/test_contenthost.py b/tests/foreman/ui/test_contenthost.py index 01e5d7db5cf..e68f6fff6d7 100644 --- a/tests/foreman/ui/test_contenthost.py +++ b/tests/foreman/ui/test_contenthost.py @@ -116,11 +116,22 @@ def run_remote_command_on_content_host(command, vm_module_streams): {'url': settings.repos.yum_6.url}, ], }, + { + 'distro': 'rhel8', + 'RHELAnsibleEngineRepository': {'cdn': True}, + 'SatelliteToolsRepository': {}, + 'YumRepository': [ + {'url': settings.repos.yum_1.url}, + {'url': settings.repos.yum_6.url}, + ], + }, ], 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 +146,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: session.location.select(default_location.name) + session.organization.select(module_org.name) + host_details = session.host.get_details(vm.hostname) + assert ( + rhel_lifecycle_status + in host_details['properties']['properties_table']['RHEL lifecycle'] + ) + # Use new_host UI, only to check new page's status modal + 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(