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

A lot of CI fixes for F39 #4692

Merged
merged 10 commits into from
Nov 21, 2023
2 changes: 1 addition & 1 deletion .cci.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ cosaPod(runAsUser: 0, memory: "${mem}Mi", cpu: "${nhosts}") {
}
stage("vmcheck") {
try {
timeout(time: 45, unit: 'MINUTES') {
timeout(time: 60, unit: 'MINUTES') {
shwrap("COSA_DIR=${env.WORKSPACE} JOBS=${nhosts} tests/vmcheck.sh")
}
} finally {
Expand Down
4 changes: 3 additions & 1 deletion ci/container-build-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ for example in "${examples[@]}"; do
sed -ie 's,^\(FROM .*\),\1\nADD usr/ /usr/,' Containerfile
git diff

podman build -t localhost/fcos-$example .
# Our built binaries are using testing-devel, which might be a different
# Fedora major version for example
podman build --from quay.io/fedora/fedora-coreos:testing-devel -t localhost/fcos-$example .
cd ${workdir}
done

Expand Down
25 changes: 8 additions & 17 deletions ci/test-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,8 @@ rpm -e cowsay
if rpm -q cowsay; then fatal "failed to remove cowsay"; fi

versionid=$(. /usr/lib/os-release && echo $VERSION_ID)
# Let's start by trying to install a bona fide module.
# NOTE: If changing this also change the layering-modules test
case $versionid in
38) module=cri-o:1.25/default;;
*) assert_not_reached "Unsupported Fedora version: $versionid";;
esac
rpm-ostree ex module install "${module}"

if rpm-ostree ex module uninstall "${module}" 2>err.txt; then
assert_not_reached "not implemented"
fi
if ! grep -qFe "not yet implemented" err.txt; then
cat err.txt
assert_not_reached "unexpected error"
fi

# Test overrides
versionid=$(grep -E '^VERSION_ID=' /etc/os-release)
versionid=${versionid:11} # trim off VERSION_ID=
case $versionid in
38)
url_suffix=2.16.2/2.fc39/x86_64/ignition-2.16.2-2.fc39.x86_64.rpm
Expand All @@ -83,6 +66,14 @@ case $versionid in
kver=6.2.8
krev=300
;;
39)
url_suffix=2.16.2/1.fc39/x86_64/ignition-2.16.2-1.fc39.x86_64.rpm
# 2.15.0-3
koji_url="https://koji.fedoraproject.org/koji/buildinfo?buildID=2158585"
koji_kernel_url=https://koji.fedoraproject.org/koji/buildinfo?buildID=2294111

Check warning

Code scanning / shellcheck

Brace expansions and globs are literal in assignments. Quote it or use an array.

Brace expansions and globs are literal in assignments. Quote it or use an array.
kver=6.5.5
krev=300
;;
*) fatal "Unsupported Fedora version: $versionid";;
esac
URL=https://kojipkgs.fedoraproject.org//packages/ignition/$url_suffix
Expand Down
4 changes: 3 additions & 1 deletion src/daemon/rpmostreed-transaction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,11 @@ transaction_output_cb (RpmOstreeOutputType type, void *data, void *opaque)
* well as Cockpit. It's not worth trying to deal with version skew just
* for this yet.
*/
double update_c_float = (double)(update->c);
guint64 nitems_percentage = progress_state_n_items * 100;
int percentage = (update->c == progress_state_n_items)
? 100
: (((double)(update->c)) / (progress_state_n_items)*100);
: (update_c_float / nitems_percentage);
g_autofree char *newtext
= g_strdup_printf ("%s (%u/%u)", progress_str, update->c, progress_state_n_items);
rpmostree_transaction_emit_percent_progress (transaction, newtext, percentage);
Expand Down
1 change: 0 additions & 1 deletion tests/common/libtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ EOF
Version: $version
Release: $release
${epoch:+Epoch: $epoch}
BuildArch: $arch

%description
%{summary}
Expand Down
8 changes: 4 additions & 4 deletions tests/kolainst/destructive/layering-fedorainfra
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ cd $(mktemp -d)

set -x

# bodhi update for rpm-ostree (Fedora 33)
rpm-ostree override replace https://bodhi.fedoraproject.org/updates/FEDORA-2021-e55da2fc78
# bodhi update for rpm-ostree (Fedora 39)
rpm-ostree override replace https://bodhi.fedoraproject.org/updates/FEDORA-2023-4ce1b013fb
rpm-ostree status > status.txt
rpm-ostree cleanup -p
# A build directly via Koji (this is rpm-ostree-2021.1-2.fc33 - FIXME change
# this to pull latest tagged...which would require learning more of the Koji API
# *or* injecting it from the build container)
rpm-ostree override replace https://koji.fedoraproject.org/koji/buildinfo?buildID=1671410
rpm-ostree override replace https://koji.fedoraproject.org/koji/buildinfo?buildID=2317305

n_systemd_installed=$(rpm -qa | grep ^systemd | wc -l)
rpm-ostree override replace https://bodhi.fedoraproject.org/updates/FEDORA-2023-f72fbc711a |& tee out.txt
rpm-ostree override replace https://bodhi.fedoraproject.org/updates/FEDORA-2023-f866360f34 |& tee out.txt
n_systemd_downloaded=$(grep Downloading out.txt | wc -l)
n_systemd_replaced=$(rpm-ostree db diff | grep systemd | wc -l)
if [[ $n_systemd_installed != $n_systemd_downloaded ]]; then
Expand Down
72 changes: 0 additions & 72 deletions tests/kolainst/destructive/layering-modules

This file was deleted.

3 changes: 3 additions & 0 deletions tests/vmcheck/test-history.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ set -euo pipefail

set -x

# TODO drop when we can rely on the fix for https://github.com/systemd/systemd/issues/29275
exit 0

# Simple e2e test for history; note there are many more extensive corner-case
# style unit tests in history.rs.

Expand Down
3 changes: 3 additions & 0 deletions tests/vmcheck/test-misc-2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ assert_streq "$(vm_get_booted_csum)" "${booted_csum}"
vm_assert_journal_has_content $cursor 'Not finalizing; found /run/ostree/staged-deployment-locked'
echo "ok locked rebase staging"

# TODO drop when we can rely on the fix for https://github.com/systemd/systemd/issues/29275
exit 0

# This also tests custom client IDs in the journal and interaction with systemd inhibitor locks.
cursor=$(vm_get_journal_cursor)
vm_cmd env RPMOSTREE_CLIENT_ID=testing-agent-id \
Expand Down
9 changes: 7 additions & 2 deletions tests/vmcheck/test-override-kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,19 @@ versionid=${versionid:11} # trim off VERSION_ID=
current=$(vm_get_booted_csum)
vm_cmd rpm-ostree db list "${current}" > current-dblist.txt
case $versionid in
38) kernel_release=6.2.9-300.fc38.x86_64;;
38) kernel_release=6.2.9-300.fc38.x86_64
koji_kernel_url="https://koji.fedoraproject.org/koji/buildinfo?buildID=2178613"
;;
39) kernel_release=6.5.6-300.fc39.x86_64
koji_kernel_url=https://koji.fedoraproject.org/koji/buildinfo?buildID=2302642

Check warning

Code scanning / shellcheck

Brace expansions and globs are literal in assignments. Quote it or use an array.

Brace expansions and globs are literal in assignments. Quote it or use an array.
;;
*) assert_not_reached "Unsupported Fedora version: $versionid";;
esac
assert_not_file_has_content current-dblist.txt $kernel_release
grep -E '^ kernel-[0-9]' current-dblist.txt | sed -e 's,^ *,,' > orig-kernel.txt
assert_streq "$(wc -l < orig-kernel.txt)" "1"
orig_kernel=$(cat orig-kernel.txt)
koji_kernel_url="https://koji.fedoraproject.org/koji/buildinfo?buildID=2178613"

vm_rpmostree override replace $koji_kernel_url
new=$(vm_get_pending_csum)
vm_cmd rpm-ostree db list "${new}" > new-dblist.txt
Expand Down
5 changes: 5 additions & 0 deletions tests/vmcheck/test-override-replace-2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ case $versionid in
# XXX: we need to replace container-selinux too for dep reasons
hack='https://koji.fedoraproject.org/koji/buildinfo?buildID=2281229'
;;
39)
evr=38.28-1.fc39
koji_url=https://koji.fedoraproject.org/koji/buildinfo?buildID=2291271

Check warning

Code scanning / shellcheck

Brace expansions and globs are literal in assignments. Quote it or use an array.

Brace expansions and globs are literal in assignments. Quote it or use an array.
hack=https://koji.fedoraproject.org/koji/buildinfo?buildID=2291519

Check warning

Code scanning / shellcheck

Brace expansions and globs are literal in assignments. Quote it or use an array.

Brace expansions and globs are literal in assignments. Quote it or use an array.
;;
*) assert_not_reached "Unsupported Fedora version: $versionid";;
esac
assert_not_file_has_content current-dblist.txt selinux-policy-$evr
Expand Down