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 22, 2023
1 parent 8a04e85 commit 1edb42e
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion tests/foreman/ui/test_contenthost.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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(
Expand Down

0 comments on commit 1edb42e

Please sign in to comment.