require_writable_sysroot
prepare_tmpdir
-n=$(nth_boot)
-case "${n}" in
-1)
+case "${AUTOPKGTEST_REBOOT_MARK:-}" in
+"")
dropin=/etc/systemd/system/ostree-finalize-staged.service.d/delay.conf
mkdir -p $(dirname ${dropin})
cat >"${dropin}" << 'EOF'
EOF
systemctl daemon-reload
rpm-ostree kargs --append=somedummykarg=1
-kola_reboot
+/tmp/autopkgtest-reboot 2
;;
-2)
+"2")
journalctl -b -1 -u ostree-finalize-staged > logs.txt
assert_file_has_content_literal logs.txt 'ostree-finalize-staged found /boot/loader/entries'
# older systemd doesn't output the success message
fi
assert_file_has_content_literal /proc/cmdline somedummykarg=1
;;
+*) fatal "Unexpected AUTOPKGTEST_REBOOT_MARK=${AUTOPKGTEST_REBOOT_MARK}" ;;
esac
echo ok
require_writable_sysroot
prepare_tmpdir
-n=$(nth_boot)
-case "${n}" in
- 1)
+case "${AUTOPKGTEST_REBOOT_MARK:-}" in
+ "")
# Initial cleanup to handle the cosa fast-build case
## TODO remove workaround for https://github.com/coreos/rpm-ostree/pull/2021
mkdir -p /var/lib/rpm-ostree/history
fatal "Pinned staged deployment"
fi
assert_file_has_content err.txt 'Cannot pin staged deployment'
- kola_reboot
+ /tmp/autopkgtest-reboot "2"
;;
- 2)
+ "2")
# Check that deploy-staged service worked
rpm-ostree status
# Assert that the previous boot had a journal entry for it
ostree refs --delete staged-deploy nonstaged-deploy
echo "ok cleanup refs"
;;
- *) fatal "Unexpected boot count" ;;
+ *) fatal "Unexpected AUTOPKGTEST_REBOOT_MARK=${AUTOPKGTEST_REBOOT_MARK}" ;;
esac
. ${KOLA_EXT_DATA}/libinsttest.sh
-n=$(nth_boot)
-case "${n}" in
- 1)
+case "${AUTOPKGTEST_REBOOT_MARK:-}" in
+ "")
require_writable_sysroot
# Hack this off for now
chattr -i /sysroot
cp -a /var /sysroot/myvar
touch /sysroot/myvar/somenewfile
echo '/sysroot/myvar /var none bind 0 0' >> /etc/fstab
- kola_reboot
+ /tmp/autopkgtest-reboot "2"
;;
- 2)
+ "2")
systemctl status var.mount
test -f /var/somenewfile
;;
- *) fatal "Unexpected boot count $n"
+ *) fatal "Unexpected AUTOPKGTEST_REBOOT_MARK=${AUTOPKGTEST_REBOOT_MARK}" ;;
esac
journalctl --list-boots | wc -l
}
-kola_reboot() {
- kill -TERM $$
- sleep 2m
- echo "failed to reboot?" 1>&2
- exit 1
-}
-
# Determine our origin refspec - we'll use this as a test base
rpmostree=$(which rpm-ostree 2>/dev/null)
if test -z "${rpmostree}"; then