Skip to content

Commit

Permalink
tests/state-overlays: Skip move-usr-local.service if `opt-usrlocal-…
Browse files Browse the repository at this point in the history
…overlays: true`

We only need that service if the system started out on a compose that
had `opt-usrlocal-overlays: false`, and then updated to a compose that
turned it on.

In the Prow e2e test, it's on from the start, so it's not needed.

Neither are all the associated `systemctl` commands.
  • Loading branch information
jlebon committed Feb 27, 2024
1 parent 69d39d9 commit 1bfc2ed
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions tests/kolainst/destructive/state-overlays
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## kola:
## tags: "needs-internet"

set -euo pipefail
set -xeuo pipefail

. ${KOLA_EXT_DATA}/libtest.sh

Expand Down Expand Up @@ -40,14 +40,14 @@ case "${AUTOPKGTEST_REBOOT_MARK:-}" in
[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
# retain content if we turn on opt-usrlocal-overlays in FCOS.
cat > /etc/systemd/system/move-usr-local.service <<EOF
# This script itself is in /usr/local, so we need to move it back on top
# of the overlay if we used the hack. This simultaneously demos one way
# upgrading nodes could retain content if we turn on opt-usrlocal-overlays
# in FCOS.
cat > /etc/systemd/system/move-usr-local.service <<EOF
[Unit]
Description=Move Previous /usr/local content back into /usr/local
Description=Move Previous /usr/local Content Back Into /usr/local
After=local-fs.target
After=systemd-tmpfiles-setup.service
Before=kola-runext.service
Expand All @@ -63,9 +63,10 @@ RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl restart rpm-ostreed
systemctl enable move-usr-local.service
systemctl daemon-reload
systemctl restart rpm-ostreed
systemctl enable move-usr-local.service
fi

rpm-ostree install test-opt

Expand Down

0 comments on commit 1bfc2ed

Please sign in to comment.