]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: add more coverage for extensions and verity
authorLuca Boccassi <luca.boccassi@gmail.com>
Thu, 12 Dec 2024 00:50:45 +0000 (00:50 +0000)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 20 Dec 2024 19:43:57 +0000 (19:43 +0000)
(cherry picked from commit c7fcb08324774c62bd2a786b03a7104a33049db6)
(cherry picked from commit 06467e1dbc0fbf3346a990e6d6a02b1bfc5e8a1c)

test/units/TEST-50-DISSECT.dissect.sh
test/units/util.sh

index 0cc5b08d0c48439cc1d8bbe4cd40bff53053a93e..6d7fa34cfece937b79c18cfa9c20f7dd06596105 100755 (executable)
@@ -389,6 +389,12 @@ systemd-run -P \
             --property RootImage="$MINIMAL_IMAGE.raw" \
             "${BIND_LOG_SOCKETS[@]}" \
             cat /etc/systemd/system/some_file | grep -q -F "MARKER_CONFEXT_123"
+systemd-run -P \
+            --property ExtensionImages="/tmp/app0.raw /tmp/conf0.raw" \
+            veritysetup status "$(cat /tmp/app0.roothash)-verity" | grep -q "$(cat /tmp/app0.roothash)"
+systemd-run -P \
+            --property ExtensionImages="/tmp/app0.raw /tmp/conf0.raw" \
+            veritysetup status "$(cat /tmp/conf0.roothash)-verity" | grep -q "$(cat /tmp/conf0.roothash)"
 # Check that using a symlink to NAME-VERSION.raw works as long as the symlink has the correct name NAME.raw
 mkdir -p /tmp/symlink-test/
 cp /tmp/app-nodistro.raw /tmp/symlink-test/app-nodistro-v1.raw
index ccb194df8dc8d7b89d2f7a2c4d39133c433b3884..1bb65333151a8483ab27ae53a4ce9922484eeb51 100755 (executable)
@@ -275,6 +275,7 @@ EOF
         chmod +x "$initdir/opt/script0.sh"
         echo MARKER=1 >"$initdir/usr/lib/systemd/system/some_file"
         mksquashfs "$initdir" /tmp/app0.raw -noappend
+        veritysetup format /tmp/app0.raw /tmp/app0.verity --root-hash-file /tmp/app0.roothash
 
         initdir="/var/tmp/conf0"
         mkdir -p "$initdir/etc/extension-release.d" "$initdir/etc/systemd/system" "$initdir/opt"
@@ -286,6 +287,7 @@ EOF
         ) >>"$initdir/etc/extension-release.d/extension-release.conf0"
         echo MARKER_1 >"$initdir/etc/systemd/system/some_file"
         mksquashfs "$initdir" /tmp/conf0.raw -noappend
+        veritysetup format /tmp/conf0.raw /tmp/conf0.verity --root-hash-file /tmp/conf0.roothash
 
         initdir="/var/tmp/app1"
         mkdir -p "$initdir/usr/lib/extension-release.d" "$initdir/usr/lib/systemd/system" "$initdir/opt"