]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - test/units/testsuite-50.sh
Merge pull request #16514 from keszybz/zstd-decompress-fix
[thirdparty/systemd.git] / test / units / testsuite-50.sh
index 363726cdddb2a019a43920c4d6a50a9ef2bdabbc..0e7588ad7f11d548e078c52227fb2bee4f5ab8fb 100755 (executable)
@@ -4,6 +4,8 @@
 set -ex
 set -o pipefail
 
+export SYSTEMD_LOG_LEVEL=debug
+
 cleanup()
 {
     if [ -z "${image_dir}" ]; then
@@ -45,6 +47,14 @@ cat ${image_dir}/mount/etc/os-release | grep -q -F -f /usr/lib/os-release
 cat ${image_dir}/mount/usr/lib/os-release | grep -q -F "MARKER=1"
 umount ${image_dir}/mount
 
+systemd-run -t --property RootImage=${image}.raw /usr/bin/cat /usr/lib/os-release | grep -q -F "MARKER=1"
+mv ${image}.verity ${image}.fooverity
+mv ${image}.roothash ${image}.foohash
+systemd-run -t --property RootImage=${image}.raw --property RootHash=${image}.foohash --property RootVerity=${image}.fooverity /usr/bin/cat /usr/lib/os-release | grep -q -F "MARKER=1"
+systemd-run -t --property RootImage=${image}.raw --property RootHash=${roothash} --property RootVerity=${image}.fooverity /usr/bin/cat /usr/lib/os-release | grep -q -F "MARKER=1"
+mv ${image}.fooverity ${image}.verity
+mv ${image}.foohash ${image}.roothash
+
 # Make a GPT disk on the fly, with the squashfs as partition 1 and the verity hash tree as partition 2
 machine="$(uname -m)"
 if [ "${machine}" = "x86_64" ]; then
@@ -62,6 +72,9 @@ elif [ "${machine}" = "arm" ]; then
 elif [ "${machine}" = "ia64" ]; then
     root_guid=993d8d3d-f80e-4225-855a-9daf8ed7ea97
     verity_guid=86ed10d5-b607-45bb-8957-d350f23d0571
+else
+    echo "Unexpected uname -m: ${machine} in testsuite-50.sh, please fix me"
+    exit 1
 fi
 # du rounds up to block size, which is more helpful for partitioning
 root_size="$(du -k ${image}.raw | cut -f1)"
@@ -98,6 +111,8 @@ cat ${image_dir}/mount/etc/os-release | grep -q -F -f /usr/lib/os-release
 cat ${image_dir}/mount/usr/lib/os-release | grep -q -F "MARKER=1"
 umount ${image_dir}/mount
 
+systemd-run -t --property RootImage=${image}.gpt --property RootHash=${roothash} /usr/bin/cat /usr/lib/os-release | grep -q -F "MARKER=1"
+
 echo OK > /testok
 
 exit 0