Skip to content

Commit

Permalink
ci: Test opt-usrlocal-overlays end-to-end in Prow CI
Browse files Browse the repository at this point in the history
Since both Prow and CoreOS CI do a compose and run kola tests, we
can change one of them to cover some different options without losing
coverage on the default path.

Follow-up to coreos#4728.
  • Loading branch information
jlebon committed Feb 22, 2024
1 parent 34e62e6 commit d5a681b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions ci/prow/fcos-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ ls -al /usr/bin/rpm-ostree
rpm-ostree --version
cd $(mktemp -d)
cosa init https://github.com/coreos/fedora-coreos-config/
# let's turn on opt-usrlocal-overlays in this test since CoreOS CI already
# covers the off path
echo -e '\nopt-usrlocal-overlays: true\n' >> src/config/manifest.yaml
cp /cosa/component-rpms/*.rpm overrides/rpm
# XXX: temporarily import new ostree until it makes it into FCOS
(cd overrides/rpm && curl -L --remote-name-all https://kojipkgs.fedoraproject.org//packages/ostree/2024.2/1.fc39/x86_64/ostree-{,libs-}2024.2-1.fc39.x86_64.rpm)
cosa fetch
cosa build
cosa kola run 'ext.rpm-ostree.*'
10 changes: 7 additions & 3 deletions tests/kolainst/destructive/state-overlays
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@ case "${AUTOPKGTEST_REBOOT_MARK:-}" in
rpm-ostree override replace https://bodhi.fedoraproject.org/updates/FEDORA-2024-6c7480dd2f
fi

# FCOS doesn't enable opt-usrlocal-overlays so use the hack instead
mkdir -p /etc/systemd/system/rpm-ostreed.service.d/
cat > /etc/systemd/system/rpm-ostreed.service.d/state-overlay.conf <<EOF
# FCOS doesn't enable opt-usrlocal-overlays yet. It's on in Prow CI though.
# Just check the treefile so we do the right thing regardless of CoreOS CI
# or Prow.
if ! jq -e '.["opt-usrlocal-overlays"]' /usr/share/rpm-ostree/treefile.json; then
mkdir -p /etc/systemd/system/rpm-ostreed.service.d/
cat > /etc/systemd/system/rpm-ostreed.service.d/state-overlay.conf <<EOF
[Service]
Environment=RPMOSTREE_EXPERIMENTAL_FORCE_OPT_USRLOCAL_OVERLAY=1
EOF
fi

# This script itself is in /usr/local, so we need to move it back on top
# of the overlay. This simultaneously demos one way upgrading nodes could
Expand Down

0 comments on commit d5a681b

Please sign in to comment.