diff --git a/.packit.yaml b/.packit.yaml index a589bbc659..8be81143fc 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -44,6 +44,39 @@ jobs: # TEST JOBS ## Tests on pull request stage. Tests are run on demand ### Definitions of the tier0 tests (non-destructive and destructive separately) + - &tests-stream-8 + job: tests + # Run tests on-demand + manual_trigger: true + # Do not merge the PR into the target branch, in case the merge is broken + # Given we are rebasing the source branches regularly, we do not need this feature enabled + merge_pr_in_ci: false + targets: + epel-8-x86_64: + distros: [CentOS-Stream-8] + trigger: pull_request + identifier: "stream-8" + tmt_plan: "stream" + # Run on Red Testing Farm Hat Ranch, tag resources to sst_conversions + use_internal_tf: True + # For some targets we use official AWS marketplace images, those do not support root ssh login as default, + # therefore we need to pass post-install-script to enable root login on the host + tf_post_install_script: '#!/bin/bash\nsudo sed -i "s/^.*ssh-rsa/ssh-rsa/" /root/.ssh/authorized_keys' + tf_extra_params: + environments: + - tmt: + context: + distro: "stream-8-latest" + settings: + provisioning: + tags: + BusinessUnit: sst_conversions + settings: + pipeline: + parallel-limit: 20 + labels: + - stream-8 + - &tests-tier0-centos job: tests # Run tests on-demand diff --git a/plans/main.fmf b/plans/main.fmf index 2ee57f631f..7b9f695ee7 100644 --- a/plans/main.fmf +++ b/plans/main.fmf @@ -31,6 +31,9 @@ adjust+: - environment+: SYSTEM_RELEASE_ENV: rocky-8-latest when: distro == rocky-8-latest + - environment+: + SYSTEM_RELEASE_ENV: stream-8-latest + when: distro == stream-8-latest prepare+: - name: install latest copr build diff --git a/plans/stream.fmf b/plans/stream.fmf new file mode 100644 index 0000000000..8503027940 --- /dev/null +++ b/plans/stream.fmf @@ -0,0 +1,68 @@ +summary+: | + CentOS Stream plans +description+: | + This needs to be changed. + Pls anyone remind me, if I forgot. + +enabled: false + +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 + + + /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 diff --git a/tests/ansible_collections/roles/add-custom-repos/main.yml b/tests/ansible_collections/roles/add-custom-repos/main.yml index fda7b649b9..193f578d1d 100644 --- a/tests/ansible_collections/roles/add-custom-repos/main.yml +++ b/tests/ansible_collections/roles/add-custom-repos/main.yml @@ -6,7 +6,7 @@ when: ansible_facts['distribution_major_version'] == "7" #TODO(danmyway) bump when new minor available - import_playbook: rhel8-repos.yml - when: ansible_facts['distribution_version'] == "8.5" or ansible_facts['distribution_version'] == "8.9" + when: ansible_facts['distribution_version'] == "8.5" or ansible_facts['distribution_version'] == "8.9" or ansible_facts['distribution_version'] == "8.10" - import_playbook: rhel8-eus-repos.yml # We need to skip for Oracle Linux machines since we don't test EUS on OL when: ansible_facts['distribution_version'] == "8.8" and ansible_facts['distribution'] != "OracleLinux" diff --git a/tests/integration/common/checks-after-conversion/test_release_version.py b/tests/integration/common/checks-after-conversion/test_release_version.py index f509409ba5..8333f39ff4 100644 --- a/tests/integration/common/checks-after-conversion/test_release_version.py +++ b/tests/integration/common/checks-after-conversion/test_release_version.py @@ -29,6 +29,12 @@ def test_sanity_conversion(shell): {"id": "Midnight Oncilla", "name": "AlmaLinux", "version": "8.9"}, {"id": "Green Obsidian", "name": "Rocky Linux", "version": "8.9"}, ), + "Red Hat Enterprise Linux release 8.10 (Ootpa)": ( + {"id": "null", "name": "Oracle Linux Server", "version": "8.10"}, + {"id": "null", "name": "CentOS Stream", "version": "8.10"}, + {"id": "Cerulean Leopard", "name": "AlmaLinux", "version": "8.10"}, + {"id": "Green Obsidian", "name": "Rocky Linux", "version": "8.10"}, + ), } diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 74f3f05faa..bd9178fbc5 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -339,16 +339,23 @@ class SystemInformationRelease: with open("/etc/system-release", "r") as file: system_release_content = file.read() - match_version = re.search(r".+?(\d+)\.(\d+)\D?", system_release_content) - if not match_version: - print("not match") - version = namedtuple("Version", ["major", "minor"])(int(match_version.group(1)), int(match_version.group(2))) + # Evaluate if we're looking at CentOS Stream + is_stream = re.match("stream", system_release_content.split()[1].lower()) distribution = system_release_content.split()[0].lower() if distribution == "ol": distribution = "oracle" elif distribution == "red": distribution = "redhat" - system_release = "{}-{}.{}".format(distribution, version.major, version.minor) + match_version = re.search(r".+?(\d+)\.?(\d+)?\D?", system_release_content) + if not match_version: + pytest.fail("Something is wrong with the /etc/system-release, cowardly refusing to continue.") + if is_stream: + system_release = "stream-{}-latest".format(match_version.group(1)) + else: + version = namedtuple("Version", ["major", "minor"])( + int(match_version.group(1)), int(match_version.group(2)) + ) + system_release = "{}-{}.{}".format(distribution, version.major, version.minor) @pytest.fixture() diff --git a/tests/integration/tier0/non-destructive/kernel/test_custom_kernel.py b/tests/integration/tier0/non-destructive/kernel/test_custom_kernel.py index 3e205584a5..79ab7fec1c 100644 --- a/tests/integration/tier0/non-destructive/kernel/test_custom_kernel.py +++ b/tests/integration/tier0/non-destructive/kernel/test_custom_kernel.py @@ -41,6 +41,11 @@ "custom_kernel": "https://yum.oracle.com/repo/OracleLinux/OL8/5/baseos/base/x86_64/getPackage/kernel-core-4.18.0-348.el8.x86_64.rpm", "grub_substring": "Oracle Linux Server (4.18.0-348.el8.x86_64) 8.5", }, + "stream-8-latest": { + "original_kernel": f"{ORIGINAL_KERNEL}", + "custom_kernel": "https://yum.oracle.com/repo/OracleLinux/OL8/5/baseos/base/x86_64/getPackage/kernel-core-4.18.0-348.el8.x86_64.rpm", + "grub_substring": "Oracle Linux Server (4.18.0-348.el8.x86_64) 8.5", + }, } if "alma-8" in SYSTEM_RELEASE_ENV: