ostree/tests/kolainst/destructive/var-tmpfiles.sh
Colin Walters 66064d960d tmpfiles: Copy /usr/share/factory/var to /var
This is a pattern we want to encourage.  It's honestly just
way simpler than what rpm-ostree is doing today in auto-synthesizing
individual tmpfiles.d snippets.
2023-11-30 18:11:33 -05:00

30 lines
820 B
Bash
Executable File

#!/bin/bash
set -xeuo pipefail
. ${KOLA_EXT_DATA}/libinsttest.sh
require_writable_sysroot
prepare_tmpdir
case "${AUTOPKGTEST_REBOOT_MARK:-}" in
"")
factory_var=rootfs/usr/share/factory/var
mkdir -p ${factory_var}
cd "${factory_var}"
mkdir -p home/someuser
echo bashrc > home/someuser/.bashrc
chown -R 1000:1000 home/someuser
mkdir -m 01777 -p tmp
cd -
ostree commit -b testlint --no-bindings --selinux-policy-from-base --tree=ref="${host_refspec}" --consume --tree=dir=rootfs
ostree admin deploy testlint 2>err.txt
assert_not_file_has_content err.txt 'contains content in /var'
/tmp/autopkgtest-reboot "2"
;;
2)
assert_file_has_content /home/someuser/.bashrc bashrc
;;
*) fatal "Unexpected AUTOPKGTEST_REBOOT_MARK=${AUTOPKGTEST_REBOOT_MARK}" ;;
esac