mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-07 21:18:55 +03:00
f93d96620c
This reworks the var-mount destructive test in order to properly use the datadir for the current stateroot instead of a duplicated one. In turn, it ensures that the resulting `var.mount` after reboot is correctly pointing to the same location which hosted `/var` on the previous boot.
20 lines
560 B
Bash
Executable File
20 lines
560 B
Bash
Executable File
#!/bin/bash
|
|
# https://github.com/ostreedev/ostree/issues/1667
|
|
set -xeuo pipefail
|
|
|
|
. ${KOLA_EXT_DATA}/libinsttest.sh
|
|
|
|
case "${AUTOPKGTEST_REBOOT_MARK:-}" in
|
|
"")
|
|
touch "/var/somenewfile"
|
|
stateroot=$(ostree admin status 2> /dev/null | grep '^\*' | cut -d ' ' -f2 || true)
|
|
echo "/sysroot/ostree/deploy/${stateroot}/var /var none bind 0 0" >> /etc/fstab
|
|
/tmp/autopkgtest-reboot "2"
|
|
;;
|
|
"2")
|
|
systemctl status var.mount
|
|
test -f /var/somenewfile
|
|
;;
|
|
*) fatal "Unexpected AUTOPKGTEST_REBOOT_MARK=${AUTOPKGTEST_REBOOT_MARK}" ;;
|
|
esac
|