From d00ee4f9f2b8da2730643d026d8204650ddaf8b3 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 22 Jun 2023 12:14:14 -0400 Subject: [PATCH] ci/test-container: Various fixes - Update hardcoded Ignition build, the previous one was likely GC'd. - Drop support for f37, we don't need it anymore - Clarify the variables - Read `/usr/lib/os-release` as it's preferred over `/etc` - Parse os-release in the shell-native way it was intended to be done --- ci/test-container.sh | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/ci/test-container.sh b/ci/test-container.sh index 0a5a0ba3e2..aa3e1fc286 100755 --- a/ci/test-container.sh +++ b/ci/test-container.sh @@ -74,33 +74,20 @@ if ! grep -qFe "not yet implemented" err.txt; then fi # Test overrides -versionid=$(grep -E '^VERSION_ID=' /etc/os-release) -versionid=${versionid:11} # trim off VERSION_ID= +versionid=$(. /usr/lib/os-release && echo $VERSION_ID) case $versionid in - 37) - url_suffix=2.14.0/3.fc37/x86_64/ignition-2.14.0-3.fc37.x86_64.rpm - # 2.14.0-4 - koji_url="https://koji.fedoraproject.org/koji/buildinfo?buildID=2013062" - koji_kernel_url="https://koji.fedoraproject.org/koji/buildinfo?buildID=2084352" - kver=6.0.7 - krev=301 - ;; 38) - url_suffix=2.15.0/2.fc38/x86_64/ignition-2.15.0-2.fc38.x86_64.rpm - # 2.15.0-3 - koji_url="https://koji.fedoraproject.org/koji/buildinfo?buildID=2158585" + koji_ignition_url="https://koji.fedoraproject.org/koji/buildinfo?buildID=2158585" + koji_ignition_direct=https://kojipkgs.fedoraproject.org//packages/ignition/2.15.0/3.fc38/$(arch)/ignition-2.15.0-3.fc38.$(arch).rpm koji_kernel_url="https://koji.fedoraproject.org/koji/buildinfo?buildID=2174317" kver=6.2.8 krev=300 ;; *) fatal "Unsupported Fedora version: $versionid";; esac -URL=https://kojipkgs.fedoraproject.org//packages/ignition/$url_suffix -# test replacement by URL -rpm-ostree override replace $URL rpm-ostree override remove ignition # test local RPM install -curl -Lo ignition.rpm $URL +curl -Lo ignition.rpm "${koji_ignition_direct}" rpm-ostree install ignition.rpm rpm -q ignition @@ -109,7 +96,7 @@ dnf -y uninstall kexec-tools if rpm -q kexec-tools; then fatal "failed to remove kexec-tools"; fi # test replacement by Koji URL -rpm-ostree override replace $koji_url |& tee out.txt +rpm-ostree override replace "${koji_ignition_url}" |& tee out.txt n_downloaded=$(grep Downloading out.txt | wc -l) if [[ $n_downloaded != 1 ]]; then fatal "Expected 1 'Downloading', but got $n_downloaded"