mirror of
https://github.com/systemd/systemd
synced 2024-10-15 12:34:37 +00:00
test: Add RootEphemeral= integration test
This commit is contained in:
parent
d110169b65
commit
cdad1f1407
|
@ -24,6 +24,7 @@ test_append_files() {
|
||||||
if command -v openssl >/dev/null 2>&1; then
|
if command -v openssl >/dev/null 2>&1; then
|
||||||
inst_binary openssl
|
inst_binary openssl
|
||||||
fi
|
fi
|
||||||
|
inst_binary unsquashfs
|
||||||
install_verity_minimal
|
install_verity_minimal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -528,6 +528,18 @@ systemd-confext status
|
||||||
systemd-confext unmerge
|
systemd-confext unmerge
|
||||||
rm -rf /run/confexts/
|
rm -rf /run/confexts/
|
||||||
|
|
||||||
|
unsquashfs -no-xattrs -d /tmp/img "${image}.raw"
|
||||||
|
systemd-run --unit=test-root-ephemeral \
|
||||||
|
-p RootDirectory=/tmp/img \
|
||||||
|
-p RootEphemeral=yes \
|
||||||
|
-p Type=exec \
|
||||||
|
bash -c "touch /abc && sleep infinity"
|
||||||
|
test -n "$(ls -A /var/lib/systemd/ephemeral-trees)"
|
||||||
|
systemctl stop test-root-ephemeral
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
timeout 10 bash -c 'while ! test -z "$(ls -A /var/lib/systemd/ephemeral-trees)"; do sleep .5; done'
|
||||||
|
test ! -f /tmp/img/abc
|
||||||
|
|
||||||
echo OK >/testok
|
echo OK >/testok
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in a new issue