Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO-JIRA: tests/replace-rt-kernel: fix and improve #1506

Merged
merged 2 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions kola-denylist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
63 changes: 63 additions & 0 deletions tests/kola/rpm-ostree/replace-rt-kernel/data/c9s.repo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we mention somewhere in here where we got this from and how to update it in the future?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Will add a comment in a follow-up.

Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions tests/kola/rpm-ostree/replace-rt-kernel/data/commonlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down