From 671d5254fe800abcf300b1ac640df8c2abdcd6ea Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Fri, 10 May 2024 13:24:37 -0400 Subject: [PATCH 1/2] denylist: drop ext.config.rpm-ostree.replace-rt-kernel This should work on SCOS now. --- kola-denylist.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/kola-denylist.yaml b/kola-denylist.yaml index 74dbcb84..6aecfb0b 100644 --- a/kola-denylist.yaml +++ b/kola-denylist.yaml @@ -18,11 +18,6 @@ osversion: - c9s -- pattern: ext.config.rpm-ostree.replace-rt-kernel - tracker: https://github.com/openshift/os/issues/1315 - osversion: - - c9s - # This test is failing only in prow, so it's skipped by prow # but not denylisted here so it can run on the rhcos pipeline #- pattern: iso-offline-install-iscsi.ibft.bios From 15c7bf96b70b014f6dd55f25195cf1a341b6c6e0 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Fri, 10 May 2024 11:30:58 -0400 Subject: [PATCH 2/2] tests/replace-rt-kernel: fix and improve It's a bit odd to have this test pull the `c9s.repo` yum repo from the master branch of openshift/os. We don't want to be in a situation where a change in master breaks older branches. But also, `c9s.repo` could at any point in time refer to either the latest compose output or the official mirrors. But we always want to use the official mirrors for this test since that has multiple package versions and we need to be able to select a kernel version which is not equal to ours. We could curl the official `centos.repo` file (and actually, in the SCOS case, it's already in the image), but that file doesn't include additional repos like `rt` and `nfv` which we need for our test. Instead, just bake the config into the test data. That way we don't need to curl anything at all, and the repo definition is naturally bound to the test and can be modified together atomically. A few additional changes: 1. only do all the repo preparations stuff on the first boot 2. add logic to pick a kernel that's different from the one we're on if we're already CentOS-based (this fixes #1383) 3. add a stub for c10s for when we're ready Closes: #1383 --- .../replace-rt-kernel/data/c9s.repo | 63 +++++++++++++++++++ .../replace-rt-kernel/data/commonlib.sh | 1 + .../test.sh} | 42 ++++++++----- 3 files changed, 89 insertions(+), 17 deletions(-) create mode 100644 tests/kola/rpm-ostree/replace-rt-kernel/data/c9s.repo create mode 120000 tests/kola/rpm-ostree/replace-rt-kernel/data/commonlib.sh rename tests/kola/rpm-ostree/{replace-rt-kernel => replace-rt-kernel/test.sh} (72%) diff --git a/tests/kola/rpm-ostree/replace-rt-kernel/data/c9s.repo b/tests/kola/rpm-ostree/replace-rt-kernel/data/c9s.repo new file mode 100644 index 00000000..8aeadfa2 --- /dev/null +++ b/tests/kola/rpm-ostree/replace-rt-kernel/data/c9s.repo @@ -0,0 +1,63 @@ +[baseos] +name=CentOS Stream 9 - BaseOS +baseurl=http://mirror.stream.centos.org/9-stream/BaseOS/$basearch/os +gpgcheck=1 +repo_gpgcheck=0 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Official + +[appstream] +name=CentOS Stream 9 - AppStream +baseurl=http://mirror.stream.centos.org/9-stream/AppStream/$basearch/os +gpgcheck=1 +repo_gpgcheck=0 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Official + +[extras-common] +name=CentOS Stream 9 - Extras packages +baseurl=https://mirror.stream.centos.org/SIGs/9-stream/extras/$basearch/extras-common +gpgcheck=1 +repo_gpgcheck=0 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Official + +[nfv] +name=CentOS Stream 9 - NFV +baseurl=http://mirror.stream.centos.org/9-stream/NFV/$basearch/os +gpgcheck=1 +repo_gpgcheck=0 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Official + +[rt] +name=CentOS Stream 9 - RT +baseurl=http://mirror.stream.centos.org/9-stream/RT/$basearch/os +gpgcheck=1 +repo_gpgcheck=0 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Official + +[sig-nfv] +name=CentOS Stream 9 - SIG NFV +baseurl=https://mirror.stream.centos.org/SIGs/9-stream/nfv/$basearch/openvswitch-2/ +gpgcheck=1 +repo_gpgcheck=0 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Official + +[sig-virtualization] +name=CentOS Stream 9 - SIG Virtualization +baseurl=https://mirror.stream.centos.org/SIGs/9-stream/virt/$basearch/kata-containers/ +gpgcheck=1 +repo_gpgcheck=0 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Official + +[sig-cloud-okd] +name=CentOS Stream 9 - SIG Cloud OKD 4.15 +baseurl=https://mirror.stream.centos.org/SIGs/9-stream/cloud/$basearch/okd-4.15/ +gpgcheck=1 +repo_gpgcheck=0 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Official diff --git a/tests/kola/rpm-ostree/replace-rt-kernel/data/commonlib.sh b/tests/kola/rpm-ostree/replace-rt-kernel/data/commonlib.sh new file mode 120000 index 00000000..cdecd90f --- /dev/null +++ b/tests/kola/rpm-ostree/replace-rt-kernel/data/commonlib.sh @@ -0,0 +1 @@ +../../../../../fedora-coreos-config/tests/kola/data/commonlib.sh \ No newline at end of file diff --git a/tests/kola/rpm-ostree/replace-rt-kernel b/tests/kola/rpm-ostree/replace-rt-kernel/test.sh similarity index 72% rename from tests/kola/rpm-ostree/replace-rt-kernel rename to tests/kola/rpm-ostree/replace-rt-kernel/test.sh index 520baedc..bf7ec7af 100755 --- a/tests/kola/rpm-ostree/replace-rt-kernel +++ b/tests/kola/rpm-ostree/replace-rt-kernel/test.sh @@ -18,31 +18,39 @@ runv () { } basearch=$(arch) -major=$(. /usr/lib/os-release && echo "${CPE_NAME}" | grep -Eo '[0-9]{1,2}') -baseurl= -case "${major}" in - 9) - baseurl=https://mirror.stream.centos.org/9-stream/ - repo_url=https://raw.githubusercontent.com/openshift/os/master/c9s.repo - ;; - *) fatal "Unhandled major RHEL/SCOS VERSION=${major}" - ;; -esac - -# setup repos -runv rm -rf /etc/yum.repos.d/* -runv curl -sSLf "${repo_url}" -o /etc/yum.repos.d/cs.repo -runv curl -sSLf https://centos.org/keys/RPM-GPG-KEY-CentOS-Official -o /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Official -runv sed -i 's|^gpgkey.*|gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Official|' /etc/yum.repos.d/cs.repo case "${AUTOPKGTEST_REBOOT_MARK:-}" in "") + major=$(. /usr/lib/os-release && echo "${CPE_NAME}" | grep -Eo '[0-9]{1,2}') + case "${major}" in + 9) + repo_name=c9s.repo + ;; + 10) + repo_name=c10s.repo + ;; + *) fatal "Unhandled major RHEL/SCOS VERSION=${major}" + ;; + esac + + # setup repos + runv rm -rf /etc/yum.repos.d/* + runv cp "$KOLA_EXT_DATA/$repo_name" /etc/yum.repos.d/cs.repo + runv curl -sSLf https://centos.org/keys/RPM-GPG-KEY-CentOS-Official -o /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Official + + evr= + if rpm -q centos-stream-release; then + # we're already on CentOS and probably running the latest kernel. so + # here we need to instead pick whatever the latest that's *not* the same + evr=-$(dnf repoquery kernel --qf '%{EVR}' | grep -v "$(rpm -q kernel --qf %{EVR})" | tail -n1) + fi + echo "Testing overriding with CentOS Stream kernel" # Disable all repos except baseos and appstream as not all of them have support for all RHCOS supported architectures runv sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/cs.repo runv sed -i '/\[baseos\]/,/^ *\[/ s/enabled=0/enabled=1/' /etc/yum.repos.d/cs.repo runv sed -i '/\[appstream\]/,/^ *\[/ s/enabled=0/enabled=1/' /etc/yum.repos.d/cs.repo - runv rpm-ostree override replace --experimental --from repo=baseos kernel{,-core,-modules,-modules-extra,-modules-core} + runv rpm-ostree override replace --experimental --from repo=baseos kernel{,-core,-modules,-modules-extra,-modules-core}"${evr}" runv /tmp/autopkgtest-reboot 1 ;; 1)