Skip to content

Commit

Permalink
ci/test-container: Various fixes
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
cgwalters committed Jun 30, 2023
1 parent 93ac42c commit d00ee4f
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions ci/test-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"
Expand Down

0 comments on commit d00ee4f

Please sign in to comment.