Skip to content

Commit

Permalink
Fixups, reverting some UI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
damoore044 committed Feb 18, 2025
1 parent 112f8c0 commit 0e6d098
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 100 deletions.
21 changes: 0 additions & 21 deletions pytest_fixtures/core/contenthosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,27 +101,6 @@ def rhel9_contenthost(request):
yield host


@pytest.fixture(scope='module', params=[{'rhel_version': '9'}])
def rhel9_contenthost_module(request):
"""A module-level fixture that provides a rhel9 content host object"""
with Broker(**host_conf(request), host_class=ContentHost) as host:
yield host


@pytest.fixture(params=[{'rhel_version': '10'}])
def rhel10_contenthost(request):
"""A fixture that provides a rhel10 content host object"""
with Broker(**host_conf(request), host_class=ContentHost) as host:
yield host


@pytest.fixture(scope='module', params=[{'rhel_version': '10'}])
def rhel10_contenthost_module(request):
"""A module-level fixture that provides a rhel10 content host object"""
with Broker(**host_conf(request), host_class=ContentHost) as host:
yield host


@pytest.fixture
def content_hosts(request):
"""A function-level fixture that provides two rhel content hosts object"""
Expand Down
10 changes: 0 additions & 10 deletions robottelo/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,12 +891,6 @@
REAL_RHEL8_1_PACKAGE_NAME = 'puppet-agent' # for RHSA-2022:4867
REAL_RHEL8_1_PACKAGE_FILENAME = 'puppet-agent-6.19.1-1.el8sat.x86_64'
REAL_RHEL8_2_PACKAGE_FILENAME = 'puppet-agent-6.26.0-1.el8sat.x86_64'
REAL_RHEL9_PACKAGE_NAME = ''
REAL_RHEL9_1_PACKAGE_FILENAME = ''
REAL_RHEL9_2_PACKAGE_FILENAME = ''
REAL_RHEL10_PACKAGE_NAME = ''
REAL_RHEL10_1_PACKAGE_FILENAME = ''
REAL_RHEL10_2_PACKAGE_FILENAME = '' # TODO: Add when updated packages are available for RHEL10
FAKE_0_CUSTOM_PACKAGE_GROUP_NAME = 'birds'
FAKE_3_YUM_OUTDATED_PACKAGES = [
'acme-package-1.0.1-1.noarch',
Expand Down Expand Up @@ -953,10 +947,6 @@
REAL_RHEL7_1_ERRATA_ID = 'RHBA-2017:0395' # tcsh bug fix update
REAL_RHEL8_1_ERRATA_ID = 'RHSA-2022:4867' # for REAL_RHEL8_1_PACKAGE
REAL_RHEL8_ERRATA_CVES = ['CVE-2021-27023', 'CVE-2021-27025']
REAL_RHEL9_ERRATA_ID = '' # for rhel9 RH package
REAL_RHEL9_ERRATA_CVES = []
REAL_RHEL10_ERRATA_ID = '' # TODO: add when real errata is available for RHEL10
REAL_RHEL10_ERRATA_CVES = []
REAL_RHSCLIENT_ERRATA = 'RHSA-2023:5982' # for RH Satellite Client 8
FAKE_1_YUM_REPOS_COUNT = 32
FAKE_3_YUM_REPOS_COUNT = 78
Expand Down
3 changes: 1 addition & 2 deletions tests/foreman/api/test_ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@ def test_positive_ansible_job_on_multiple_host(
self,
target_sat,
module_org,
rhel10_contenthost,
rhel9_contenthost,
rhel8_contenthost,
rhel7_contenthost,
Expand All @@ -438,7 +437,7 @@ def test_positive_ansible_job_on_multiple_host(
:BZ: 2167396, 2190464, 2184117
"""
hosts = [rhel10_contenthost, rhel9_contenthost, rhel8_contenthost, rhel7_contenthost]
hosts = [rhel9_contenthost, rhel8_contenthost, rhel7_contenthost]
SELECTED_ROLE = 'RedHatInsights.insights-client'
for host in hosts:
result = host.register(
Expand Down
29 changes: 16 additions & 13 deletions tests/foreman/api/test_errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,8 +1068,9 @@ def setup_rhel_content(


@pytest.mark.tier2
@pytest.mark.rhel_ver_match('8')
def test_positive_get_count_for_host(
setup_rhel_content, activation_key, rhel9_contenthost, module_target_sat
setup_rhel_content, activation_key, rhel_contenthost, module_target_sat
):
"""Available errata count when retrieving Host
Expand All @@ -1094,7 +1095,7 @@ def test_positive_get_count_for_host(
:CaseImportance: Medium
"""
chost = rhel9_contenthost
chost = rhel_contenthost
org = setup_rhel_content['organization']
custom_repo = setup_rhel_content['rh_repo']
chost.create_custom_repos(**{f'{custom_repo.name}': custom_repo.url})
Expand Down Expand Up @@ -1127,18 +1128,18 @@ def test_positive_get_count_for_host(
assert result.status == 0, f'Failed to install package {FAKE_1_CUSTOM_PACKAGE}'
_validate_errata_counts(host, errata_type='security', expected_value=1)
# rh_repo outdated Puppet-agent
# TODO: Use REAL_RHEL 9 or 10 Packages
'''result = chost.execute(f'yum install -y {REAL_RHEL8_1_PACKAGE_FILENAME}')
result = chost.execute(f'yum install -y {REAL_RHEL8_1_PACKAGE_FILENAME}')
assert result.status == 0, f'Failed to install package {REAL_RHEL8_1_PACKAGE_FILENAME}'
_validate_errata_counts(host, errata_type='security', expected_value=2)
# All avaliable errata present
assert chost.applicable_errata_count == 4'''
assert chost.applicable_errata_count == 4


@pytest.mark.upgrade
@pytest.mark.tier3
@pytest.mark.rhel_ver_match('8')
def test_positive_get_applicable_for_host(
setup_rhel_content, activation_key, rhel10_contenthost, target_sat
setup_rhel_content, activation_key, rhel_contenthost, target_sat
):
"""Get applicable errata ids for a host
Expand All @@ -1164,7 +1165,7 @@ def test_positive_get_applicable_for_host(
"""
org = setup_rhel_content['organization']
custom_repo = setup_rhel_content['rh_repo']
chost = rhel10_contenthost
chost = rhel_contenthost

chost.create_custom_repos(**{f'{custom_repo.name}': custom_repo.url})
result = chost.register(
Expand Down Expand Up @@ -1195,10 +1196,10 @@ def test_positive_get_applicable_for_host(
assert len(erratum) == 1
assert CUSTOM_REPO_ERRATA_ID in [errata['errata_id'] for errata in erratum]
# Install outdated applicable real package (from RH repo)
'''chost.run(f'yum install -y {REAL_RHEL8_1_PACKAGE_FILENAME}')
chost.run(f'yum install -y {REAL_RHEL8_1_PACKAGE_FILENAME}')
erratum = _fetch_available_errata(host, 2)
assert len(erratum) == 2
assert REAL_RHEL8_1_ERRATA_ID in [errata['errata_id'] for errata in erratum]'''
assert REAL_RHEL8_1_ERRATA_ID in [errata['errata_id'] for errata in erratum]


@pytest.mark.tier3
Expand Down Expand Up @@ -1256,13 +1257,14 @@ def test_positive_get_diff_for_cv_envs(target_sat):


@pytest.mark.tier3
@pytest.mark.rhel_ver_match('8')
def test_positive_incremental_update_required(
module_sca_manifest_org,
module_lce,
activation_key,
module_cv,
rh_repo_module_manifest,
rhel9_contenthost,
rhel_contenthost,
target_sat,
):
"""Given a set of hosts and errata, check for content view version
Expand Down Expand Up @@ -1293,7 +1295,7 @@ def test_positive_incremental_update_required(
:BZ: 2013093
"""
chost = rhel9_contenthost
chost = rhel_contenthost
org = module_sca_manifest_org
rh_repo = target_sat.api.Repository(
id=rh_repo_module_manifest.id,
Expand Down Expand Up @@ -1374,10 +1376,11 @@ def rh_repo_module_manifest(module_sca_manifest_org, module_target_sat):


@pytest.mark.tier3
@pytest.mark.rhel_ver_match('N-1')
def test_positive_incremental_update_apply_to_envs_cvs(
target_sat,
module_sca_manifest_org,
rhel10_contenthost,
rhel_contenthost,
module_product,
):
"""With multiple environments and content views, register a host to one,
Expand Down Expand Up @@ -1408,7 +1411,7 @@ def test_positive_incremental_update_apply_to_envs_cvs(
incremental version of the content-view.
"""
chost = rhel10_contenthost
chost = rhel_contenthost
# any existing custom CVs in org, except Default CV
prior_cv_count = (
len(target_sat.api.ContentView(organization=module_sca_manifest_org).search()) - 1
Expand Down
Loading

0 comments on commit 0e6d098

Please sign in to comment.