Skip to content

Commit

Permalink
RHEL10 Errata hosts, rhel_ver_match marker
Browse files Browse the repository at this point in the history
  • Loading branch information
damoore044 committed Nov 18, 2024
1 parent c45e681 commit b5a02f1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion conf/supportability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ supportability:
content_hosts:
default_os_name: "RedHat"
rhel:
versions: [7,'7_fips', 8, '8_fips', 9, '9_fips']
versions: [7,'7_fips', 8, '8_fips', 9, '9_fips', 10, '10_fips']
29 changes: 21 additions & 8 deletions pytest_plugins/fixture_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,27 @@ def pytest_generate_tests(metafunc):
# process eventual rhel_version_match markers
matchers = [i.args for i in function_marks if i.name == 'rhel_ver_match']
match_params = []
for matcher in matchers:
match_params.extend(
[
setting_rhel_ver
for setting_rhel_ver in settings.supportability.content_hosts.rhel.versions
if re.fullmatch(str(matcher[0]), str(setting_rhel_ver))
]
)
# check if param matches format 'N-x'
if matchers and len(matchers[0][0]) == 3 and matchers[0][0].startswith('N-'):
# num of desired prior versions
num_versions = int(matchers[0][0].split('-')[1])
# grab major versions, excluding fips, from tail of supportability list
filtered_versions = [
setting_rhel_ver
for setting_rhel_ver in settings.supportability.content_hosts.rhel.versions
if 'fips' not in str(setting_rhel_ver)
][-(num_versions + 1) :] # inclusive (+1) to collect N as well
match_params.extend(filtered_versions)
# match versions with existing markers
else:
for matcher in matchers:
match_params.extend(
[
setting_rhel_ver
for setting_rhel_ver in settings.supportability.content_hosts.rhel.versions
if re.fullmatch(str(matcher[0]), str(setting_rhel_ver))
]
)
network_params = ['ipv6' if settings.server.is_ipv6 else 'ipv4']
rhel_params = []
ids = []
Expand Down
4 changes: 2 additions & 2 deletions tests/foreman/api/test_errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def _publish_and_wait(sat, org, cv, search_rate=1, max_tries=10):

@pytest.mark.upgrade
@pytest.mark.tier3
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match('N-2') # latest 3 major ver supported, exclude fips
@pytest.mark.no_containers
@pytest.mark.e2e
def test_positive_install_in_hc(
Expand Down Expand Up @@ -656,7 +656,7 @@ def test_positive_install_in_hc(


@pytest.mark.tier3
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*(7|fips)).*$') # exclude any fips or major ver 7
@pytest.mark.no_containers
@pytest.mark.e2e
@pytest.mark.pit_client
Expand Down
2 changes: 1 addition & 1 deletion tests/foreman/ui/test_errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def cleanup():

@pytest.mark.e2e
@pytest.mark.tier3
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match('[^7]|10')
@pytest.mark.parametrize('registered_contenthost', [[CUSTOM_REPO_URL]], indirect=True)
@pytest.mark.no_containers
def test_end_to_end(
Expand Down

0 comments on commit b5a02f1

Please sign in to comment.