Skip to content

Commit

Permalink
Include 8.10 in tests, introduce CentOS Stream
Browse files Browse the repository at this point in the history
* create a new (for now) plan stream.fmf for CentOS Stream 8
* include CentOS Stream in the pipeline
* add 8.10 related adjustments to tests

Signed-off-by: Daniel Diblik <[email protected]>
  • Loading branch information
danmyway committed May 27, 2024
1 parent bb263d7 commit 225c8cd
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 6 deletions.
33 changes: 33 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions plans/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
68 changes: 68 additions & 0 deletions plans/stream.fmf
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests/ansible_collections/roles/add-custom-repos/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
),
}


Expand Down
17 changes: 12 additions & 5 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 225c8cd

Please sign in to comment.