From e4c4880416bf75d82ac61f5399ef6f07b71763ab Mon Sep 17 00:00:00 2001 From: Daniel Diblik Date: Wed, 29 May 2024 16:22:46 +0200 Subject: [PATCH] Modify the stream and tier0 plan * add couple of tests, modify the indentation, rename others to core Signed-off-by: Daniel Diblik --- plans/stream.fmf | 199 ++++++++------- plans/tier0.fmf | 238 +++++++++--------- .../main.fmf | 6 +- .../destructive/multiple-nic/multiple_nic.py | 2 +- 4 files changed, 234 insertions(+), 211 deletions(-) diff --git a/plans/stream.fmf b/plans/stream.fmf index 0801c3109c..86fe9532f1 100644 --- a/plans/stream.fmf +++ b/plans/stream.fmf @@ -10,95 +10,116 @@ adjust+: - enabled: true when: distro == stream-8-latest -/non-destructive: - /sanity: - discover+: - filter+: - [ 'tier: 0', 'tag: non-destructive', 'tag: sanity' ] - /others: - discover+: - filter+: - [ 'tier: 0', 'tag: non-destructive', 'tag: -sanity' ] - -/destructive: - discover+: - # List of tests run for every plan/test case. - # tmt-reboot feature is used for rebooting the system using - # the test management framework. - # The main test scenario gets prepended by the "+<" in each case. - test: - - utils/reboot-after-conversion - - checks-after-conversion - - /basic_conversion_methods: - - /activation_key_conversion: - discover+: - test+<: - - conversion-method/activation_key_conversion - - /rhsm_conversion: - discover+: - test+<: - - conversion-method/rhsm_conversion - - /satellite_conversion: - discover+: - test+<: - - conversion-method/satellite_conversion - - /pre_registered_system_conversion: - adjust+: - - environment+: - C2R_TESTS_CHECK_RHSM_UUID_MATCH: 1 - C2R_TESTS_SUBMAN_REMAIN_REGISTERED: 1 - discover+: - test+<: - - conversion-method/pre_registered_system_conversion - - - /custom_repositories_conversion: - environment+: - SUBMGR_DISABLED_SKIP_CHECK_RHSM_CUSTOM_FACTS: 1 - prepare+: - - name: Add custom repositories - how: ansible - playbook: tests/ansible_collections/roles/add-custom-repos/main.yml - discover+: - test+<: - - conversion-method/custom_repos_conversion - # Exclude the rhel_subman check, we don't use RHSM for the conversion - exclude: - - checks-after-conversion/rhel_subman - - - /isolated_system_conversion: - prepare+: - - name: Allow access to Satellite only - how: shell - script: pytest --setup-show -svv tests/integration/*/destructive/isolated-system-conversion/prepare_system.py - discover+: - test+<: - - isolated-system-conversion/isolated_system_conversion - # Exclude the rhel_subman check, we don't use RHSM for the conversion - exclude: - - checks-after-conversion/rhel_subman - - - /single_yum_transaction: - /packages_upgraded_after_conversion: +/sanity: + /non-destructive: discover+: - test+<: - - single-yum-transaction/packages_upgraded_after_conversion + filter+: + [ 'tier: 0', 'tag: non-destructive', 'tag: sanity' ] - /observe_errors: - enabled: false + /destructive: discover+: - test+<: - - single-yum-transaction/single_yum_transaction - - /mismatch_errors: - prepare+: - - name: Install multilib packages with dnf - how: shell - script: pytest --setup-show -svv tests/integration/*/destructive/single-yum-transaction/install_multilib_packages.py + # List of tests run for every plan/test case. + # tmt-reboot feature is used for rebooting the system using + # the test management framework. + # The main test scenario gets prepended by the "+<" in each case. + test: + - utils/reboot-after-conversion + - checks-after-conversion + + /basic_conversion_methods: + /activation_key_conversion: + discover+: + test+<: + - conversion-method/activation_key_conversion + /rhsm_conversion: + discover+: + test+<: + - conversion-method/rhsm_conversion + /satellite_conversion: + discover+: + test+<: + - conversion-method/satellite_conversion + /pre_registered_system_conversion: + adjust+: + - environment+: + C2R_TESTS_CHECK_RHSM_UUID_MATCH: 1 + C2R_TESTS_SUBMAN_REMAIN_REGISTERED: 1 + discover+: + test+<: + - conversion-method/pre_registered_system_conversion + /custom_repositories_conversion: + environment+: + SUBMGR_DISABLED_SKIP_CHECK_RHSM_CUSTOM_FACTS: 1 + prepare+: + - name: Add custom repositories + how: ansible + playbook: tests/ansible_collections/roles/add-custom-repos/main.yml + discover+: + test+<: + - conversion-method/custom_repos_conversion + # Exclude the rhel_subman check, we don't use RHSM for the conversion + exclude: + - checks-after-conversion/rhel_subman + /isolated_system_conversion: + prepare+: + - name: Allow access to Satellite only + how: shell + script: pytest --setup-show -svv tests/integration/*/destructive/isolated-system-conversion/prepare_system.py + discover+: + test+<: + - isolated-system-conversion/isolated_system_conversion + # Exclude the rhel_subman check, we don't use RHSM for the conversion + exclude: + - checks-after-conversion/rhel_subman + +/core: + /non-destructive: + discover+: + filter+: + [ 'tier: 0', 'tag: non-destructive', 'tag: -sanity' ] + /destructive: + discover+: + # List of tests run for every plan/test case. + # tmt-reboot feature is used for rebooting the system using + # the test management framework. + # The main test scenario gets prepended by the "+<" in each case. + test: + - utils/reboot-after-conversion + - checks-after-conversion + /single_yum_transaction: + /packages_upgraded_after_conversion: + discover+: + test+<: + - single-yum-transaction/packages_upgraded_after_conversion + /observe_errors: + discover+: + test+<: + - single-yum-transaction/single_yum_transaction + /mismatch_errors: + prepare+: + - name: Install multilib packages with dnf + how: shell + script: pytest --setup-show -svv tests/integration/*/destructive/single-yum-transaction/install_multilib_packages.py + /resolve_dependency: + summary+: | + Handle dependency packages + description+: | + This case installs a couple of packages that we know cause dependency + issues during the package replacement, so the intention of this is to + assert that convert2rhel can handle those packages and not fail during the + replacement, especially with the yum transaction. + prepare+: + - name: Install dependency packages + how: shell + script: pytest --setup-show -svv tests/integration/*/destructive/single-yum-transaction/install_dependency_packages.py + /yum_distro_sync: + prepare+: + - name: enable CentOS' extras repo + how: ansible + playbook: tests/integration/tier0/destructive/yum-distro-sync/add-extras-repo/main.yml + - name: Install problematic package + how: shell + script: pytest --setup-show -svv tests/integration/*/destructive/yum-distro-sync/install_problematic_package.py + discover+: + test+<: + - yum-distro-sync/yum_distro_sync diff --git a/plans/tier0.fmf b/plans/tier0.fmf index e811a2dc70..0a7cdc7e01 100644 --- a/plans/tier0.fmf +++ b/plans/tier0.fmf @@ -61,139 +61,139 @@ adjust+: discover+: test+<: - conversion-method/pre_registered_system_conversion +/core: + /non-destructive: + discover+: + filter+: + ['tier: 0', 'tag: non-destructive', 'tag: -sanity'] -/non-destructive: - discover+: - filter+: - ['tier: 0', 'tag: non-destructive', 'tag: -sanity'] - -/destructive: - discover+: - # List of tests run for every plan/test case. - # tmt-reboot feature is used for rebooting the system using - # the test management framework. - # The main test scenario gets prepended by the "+<" in each case. - test: - - utils/reboot-after-conversion - - checks-after-conversion - - /basic_conversion_methods: - - /rhsm_eus_conversion: - enabled: false - adjust+: - - enabled: true - when: > - distro == alma-8.8, rocky-8.8 - discover+: - test+<: - - conversion-method/rhsm_eus_account_conversion - - /rhsm_els_conversion: - enabled: false - adjust+: - - enabled: true - when: > - distro == centos-7, oracle-7 - because: The ELS offering is applicable to EL7 only. - discover+: - test+<: - - conversion-method/rhsm_els_conversion - - /custom_repositories_conversion: - environment+: - SUBMGR_DISABLED_SKIP_CHECK_RHSM_CUSTOM_FACTS: 1 - prepare+: - - name: Add custom repositories - how: ansible - playbook: tests/ansible_collections/roles/add-custom-repos/main.yml - discover+: - test+<: - - conversion-method/custom_repos_conversion - # Exclude the rhel_subman check, we don't use RHSM for the conversion - exclude: - - checks-after-conversion/rhel_subman - - - /single_yum_transaction: - /packages_upgraded_after_conversion: - discover+: - test+<: - - single-yum-transaction/packages_upgraded_after_conversion + /destructive: + discover+: + # List of tests run for every plan/test case. + # tmt-reboot feature is used for rebooting the system using + # the test management framework. + # The main test scenario gets prepended by the "+<" in each case. + test: + - utils/reboot-after-conversion + - checks-after-conversion - /observe_errors: - enabled: false - discover+: - test+<: - - single-yum-transaction/single_yum_transaction + /basic_conversion_methods: - /all_errors: + /rhsm_eus_conversion: + enabled: false adjust+: - enabled: true when: > - distro == oracle-7 - prepare+: - - name: Install ntp package and remove one dependency - how: shell - script: pytest --setup-show -svv tests/integration/*/destructive/single-yum-transaction/install_ntp_and_remove_dependency.py - - /excluded_packages: - adjust+: - - enabled: true - when: distro == centos-7 - prepare+: - - name: Remove some packages from the excluded packages config list - how: shell - script: pytest --setup-show -svv tests/integration/*/destructive/single-yum-transaction/remove_excld_pkgs_from_config.py + distro == alma-8.8, rocky-8.8 + discover+: + test+<: + - conversion-method/rhsm_eus_account_conversion - /mismatch_errors: + /rhsm_els_conversion: + enabled: false adjust+: - enabled: true when: > - distro == centos-8, oracle-8, alma-8-latest, rocky-8-latest + distro == centos-7, oracle-7 + because: The ELS offering is applicable to EL7 only. + discover+: + test+<: + - conversion-method/rhsm_els_conversion + + /custom_repositories_conversion: + environment+: + SUBMGR_DISABLED_SKIP_CHECK_RHSM_CUSTOM_FACTS: 1 prepare+: - - name: Install multilib packages with dnf - how: shell - script: pytest --setup-show -svv tests/integration/*/destructive/single-yum-transaction/install_multilib_packages.py + - name: Add custom repositories + how: ansible + playbook: tests/ansible_collections/roles/add-custom-repos/main.yml + discover+: + test+<: + - conversion-method/custom_repos_conversion + # Exclude the rhel_subman check, we don't use RHSM for the conversion + exclude: + - checks-after-conversion/rhel_subman - /resolve_dependency: - adjust+: - - enabled: true - when: distro == centos, oracle - because: We do not have any tracked packages with Rocky and Alma for this test case - summary+: | - Handle dependency packages - description+: | - This case installs a couple of packages that we know cause dependency - issues during the package replacement, so the intention of this is to - assert that convert2rhel can handle those packages and not fail during the - replacement, especially with the yum transaction. + + /single_yum_transaction: + /packages_upgraded_after_conversion: + discover+: + test+<: + - single-yum-transaction/packages_upgraded_after_conversion + + /observe_errors: + enabled: false + discover+: + test+<: + - single-yum-transaction/single_yum_transaction + + /all_errors: + adjust+: + - enabled: true + when: > + distro == oracle-7 + prepare+: + - name: Install ntp package and remove one dependency + how: shell + script: pytest --setup-show -svv tests/integration/*/destructive/single-yum-transaction/install_ntp_and_remove_dependency.py + + /excluded_packages: + adjust+: + - enabled: true + when: distro == centos-7 + prepare+: + - name: Remove some packages from the excluded packages config list + how: shell + script: pytest --setup-show -svv tests/integration/*/destructive/single-yum-transaction/remove_excld_pkgs_from_config.py + + /mismatch_errors: + adjust+: + - enabled: true + when: > + distro == centos-8, oracle-8, alma-8-latest, rocky-8-latest + prepare+: + - name: Install multilib packages with dnf + how: shell + script: pytest --setup-show -svv tests/integration/*/destructive/single-yum-transaction/install_multilib_packages.py + + /resolve_dependency: + adjust+: + - enabled: true + when: distro == centos, oracle + because: We do not have any tracked packages with Rocky and Alma for this test case + summary+: | + Handle dependency packages + description+: | + This case installs a couple of packages that we know cause dependency + issues during the package replacement, so the intention of this is to + assert that convert2rhel can handle those packages and not fail during the + replacement, especially with the yum transaction. + prepare+: + - name: Install dependency packages + how: shell + script: pytest --setup-show -svv tests/integration/*/destructive/single-yum-transaction/install_dependency_packages.py + + /yum_distro_sync: prepare+: - - name: Install dependency packages - how: shell - script: pytest --setup-show -svv tests/integration/*/destructive/single-yum-transaction/install_dependency_packages.py + - name: enable CentOS' extras repo + how: ansible + playbook: tests/integration/tier0/destructive/yum-distro-sync/add-extras-repo/main.yml + - name: Install problematic package + how: shell + script: pytest --setup-show -svv tests/integration/*/destructive/yum-distro-sync/install_problematic_package.py + discover+: + test+<: + - yum-distro-sync/yum_distro_sync + - /yum_distro_sync: + /isolated_system_conversion: prepare+: - - name: enable CentOS' extras repo - how: ansible - playbook: tests/integration/tier0/destructive/yum-distro-sync/add-extras-repo/main.yml - - name: Install problematic package - how: shell - script: pytest --setup-show -svv tests/integration/*/destructive/yum-distro-sync/install_problematic_package.py + - name: Allow access to Satellite only + how: shell + script: pytest --setup-show -svv tests/integration/*/destructive/isolated-system-conversion/prepare_system.py discover+: test+<: - - yum-distro-sync/yum_distro_sync - - - /isolated_system_conversion: - prepare+: - - name: Allow access to Satellite only - how: shell - script: pytest --setup-show -svv tests/integration/*/destructive/isolated-system-conversion/prepare_system.py - discover+: - test+<: - - isolated-system-conversion/isolated_system_conversion - # Exclude the rhel_subman check, we don't use RHSM for the conversion - exclude: - - checks-after-conversion/rhel_subman + - isolated-system-conversion/isolated_system_conversion + # Exclude the rhel_subman check, we don't use RHSM for the conversion + exclude: + - checks-after-conversion/rhel_subman diff --git a/tests/integration/tier0/non-destructive/single-yum-transaction-validation/main.fmf b/tests/integration/tier0/non-destructive/single-yum-transaction-validation/main.fmf index b76fd8b39e..a871610a2e 100644 --- a/tests/integration/tier0/non-destructive/single-yum-transaction-validation/main.fmf +++ b/tests/integration/tier0/non-destructive/single-yum-transaction-validation/main.fmf @@ -19,14 +19,16 @@ tag+: /transaction_validation_error: + enabled: false summary+: | Error during processing the transaction description+: | This test case removes the certs during the transaction processing to throw the following yum error: pkgmanager.Errors.YumDownloadError adjust+: - - enabled: false - when: distro == centos-8, alma-8, rocky-8, oracle-8 + - enabled: true + when: distro == centos-7, oracle-7 + because: This scenario is valid only for systems with yum as the package manager. tag+: - transaction-validation-error test: | diff --git a/tests/integration/tier1/destructive/multiple-nic/multiple_nic.py b/tests/integration/tier1/destructive/multiple-nic/multiple_nic.py index 2b4e20c7e2..54fa438c5e 100644 --- a/tests/integration/tier1/destructive/multiple-nic/multiple_nic.py +++ b/tests/integration/tier1/destructive/multiple-nic/multiple_nic.py @@ -2,4 +2,4 @@ def test_check_provisioned_machine(shell): assert shell("ip link show").returncode == 0 # Make sure we have at least 2 non-loopback NICs non_loopback_nics = shell("ip -br link show | grep -v LOOPBACK | wc -l") - assert int(non_loopback_nics.output) >= 2 + assert int(non_loopback_nics.output.strip()) >= 2