From bacfdaf8ce6e0521ebe8e9bf4995ec1a26e93360 Mon Sep 17 00:00:00 2001 From: Shubham Ganar Date: Fri, 12 Jan 2024 20:40:37 +0530 Subject: [PATCH] Add module_sync_kickstart_content to fixture_markers.py --- .../component/provisioning_template.py | 2 +- pytest_plugins/fixture_markers.py | 1 + tests/foreman/api/test_provisioningtemplate.py | 16 ++++++++-------- tests/foreman/cli/test_bootdisk.py | 2 +- tests/foreman/destructive/test_infoblox.py | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pytest_fixtures/component/provisioning_template.py b/pytest_fixtures/component/provisioning_template.py index cb4ea6d84d5..97439a8a07a 100644 --- a/pytest_fixtures/component/provisioning_template.py +++ b/pytest_fixtures/component/provisioning_template.py @@ -62,7 +62,7 @@ def module_sync_kickstart_content( """ repo_names = [] tasks = [] - rhel_ver = request.param + rhel_ver = request.param['rhel_version'] if int(rhel_ver) <= 7: repo_names.append(f'rhel{rhel_ver}') else: diff --git a/pytest_plugins/fixture_markers.py b/pytest_plugins/fixture_markers.py index 41e12b85bab..951be635ac6 100644 --- a/pytest_plugins/fixture_markers.py +++ b/pytest_plugins/fixture_markers.py @@ -8,6 +8,7 @@ 'content_hosts', 'module_provisioning_rhel_content', 'capsule_provisioning_rhel_content', + 'module_sync_kickstart_content', 'rex_contenthost', ] diff --git a/tests/foreman/api/test_provisioningtemplate.py b/tests/foreman/api/test_provisioningtemplate.py index 33f794cb98d..b0128fca0a1 100644 --- a/tests/foreman/api/test_provisioningtemplate.py +++ b/tests/foreman/api/test_provisioningtemplate.py @@ -240,7 +240,7 @@ def test_positive_build_pxe_default(self, tftpboot, module_target_sat): in rendered ) - @pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) + @pytest.mark.rhel_ver_match('[^6]') def test_positive_provision_template_check_net_interface( self, module_sync_kickstart_content, @@ -286,7 +286,7 @@ def test_positive_provision_template_check_net_interface( assert 'ifcfg-$sanitized_real' in provision_template @pytest.mark.e2e - @pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) + @pytest.mark.rhel_ver_match('[^6]') def test_positive_template_check_ipxe( self, module_sync_kickstart_content, @@ -334,7 +334,7 @@ def test_positive_template_check_ipxe( ks_param = 'ks=' if module_sync_kickstart_content.rhel_ver <= 8 else 'inst.ks=' assert ipxe_template.count(ks_param) == 1 - @pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) + @pytest.mark.rhel_ver_match('[^6]') def test_positive_template_check_vlan_parameter( self, module_sync_kickstart_content, @@ -401,9 +401,9 @@ def test_positive_template_check_vlan_parameter( ipxe_template = host.read_template(data={'template_kind': 'iPXE'})['template'] assert f'vlan={identifier}.{tag}:{identifier}' in ipxe_template - @pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) @pytest.mark.parametrize('pxe_loader', ['uefi'], indirect=True) @pytest.mark.parametrize('boot_mode', ['Static', 'DHCP']) + @pytest.mark.rhel_ver_match('[^6]') def test_positive_template_subnet_with_boot_mode( self, module_sync_kickstart_content, @@ -495,7 +495,7 @@ def test_positive_template_use_graphical_installer( assert 'graphical' in render assert 'skipx' not in render - @pytest.mark.parametrize('module_sync_kickstart_content', [8], indirect=True) + @pytest.mark.rhel_ver_match('[8]') def test_positive_template_check_aap_snippet( self, module_sync_kickstart_content, @@ -552,7 +552,7 @@ def test_positive_template_check_aap_snippet( assert f'"host_config_key":"{config_key}"' in render assert '{"package_install": "zsh"}' in render - @pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) + @pytest.mark.rhel_ver_match('[^6]') def test_positive_template_check_rex_snippet( self, module_sync_kickstart_content, @@ -631,7 +631,7 @@ def test_positive_template_check_rex_snippet( ) assert ssh_key in rex_snippet - @pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) + @pytest.mark.rhel_ver_match('[^6]') def test_positive_template_check_rex_pull_mode_snippet( self, module_sync_kickstart_content, @@ -692,7 +692,7 @@ def test_positive_template_check_rex_pull_mode_snippet( assert 'yggdrasil status' in rex_snippet assert 'Remote execution pull provider successfully configured!' in rex_snippet - @pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) + @pytest.mark.rhel_ver_match('[^6]') def test_positive_template_check_fips_enabled( self, module_sync_kickstart_content, diff --git a/tests/foreman/cli/test_bootdisk.py b/tests/foreman/cli/test_bootdisk.py index e6515e1af9f..4775c3bbdea 100644 --- a/tests/foreman/cli/test_bootdisk.py +++ b/tests/foreman/cli/test_bootdisk.py @@ -18,7 +18,7 @@ from robottelo.constants import HTTPS_MEDIUM_URL -@pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) +@pytest.mark.rhel_ver_match('[^6]') def test_positive_bootdisk_download_https( module_location, module_sync_kickstart_content, diff --git a/tests/foreman/destructive/test_infoblox.py b/tests/foreman/destructive/test_infoblox.py index 52e26830b14..9a0b785a257 100644 --- a/tests/foreman/destructive/test_infoblox.py +++ b/tests/foreman/destructive/test_infoblox.py @@ -112,7 +112,7 @@ def test_plugin_installation(target_sat, command_args, command_opts, rpm_command @pytest.mark.e2e -@pytest.mark.parametrize('module_sync_kickstart_content', [8], indirect=True) +@pytest.mark.rhel_ver_match('[^6]') def test_infoblox_end_to_end( request, module_sync_kickstart_content,