From cdad1f14070d83c477cc120ee76b6ca7ebb4bb07 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 20 Jun 2023 13:54:07 +0200 Subject: [PATCH] test: Add RootEphemeral= integration test --- test/TEST-50-DISSECT/test.sh | 1 + test/units/testsuite-50.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/test/TEST-50-DISSECT/test.sh b/test/TEST-50-DISSECT/test.sh index bcc81749afc..6e5179c8422 100755 --- a/test/TEST-50-DISSECT/test.sh +++ b/test/TEST-50-DISSECT/test.sh @@ -24,6 +24,7 @@ test_append_files() { if command -v openssl >/dev/null 2>&1; then inst_binary openssl fi + inst_binary unsquashfs install_verity_minimal } diff --git a/test/units/testsuite-50.sh b/test/units/testsuite-50.sh index cdb7c0043b5..9222fc70108 100755 --- a/test/units/testsuite-50.sh +++ b/test/units/testsuite-50.sh @@ -528,6 +528,18 @@ systemd-confext status systemd-confext unmerge 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 exit 0