]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: Add RootEphemeral= integration test 27942/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 20 Jun 2023 11:54:07 +0000 (13:54 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 21 Jun 2023 10:48:48 +0000 (12:48 +0200)
test/TEST-50-DISSECT/test.sh
test/units/testsuite-50.sh

index bcc81749afca6768644e541018b4870451afee2c..6e5179c8422b4b3a2bb36a5cd4e7c9eff7dfb4e2 100755 (executable)
@@ -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
 }
 
index cdb7c0043b5f35f459389109ac48cbf6bec1ee4e..9222fc701084dfe4fd55a8b1cfe85f1ba488f783 100755 (executable)
@@ -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