summaryrefslogtreecommitdiff
path: root/test/units
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2020-07-15 17:54:12 +0100
committerLuca Boccassi <luca.boccassi@microsoft.com>2020-07-15 19:40:42 +0100
commit2bc148add017b1ffc5cdaa4a87d848eac4f4251b (patch)
treeb7b2f171f61e904932080538b943aaf4e7fc7974 /test/units
parent0f5d24a8b9a1b523786051dcab97b08959cbf31c (diff)
downloadsystemd-2bc148add017b1ffc5cdaa4a87d848eac4f4251b.tar.gz
test: exercise RootImage, RootHash and RootVerity in TEST-50-DISSECT
Run with both the single-filesystem image and the GPT image
Diffstat (limited to 'test/units')
-rwxr-xr-xtest/units/testsuite-50.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/units/testsuite-50.sh b/test/units/testsuite-50.sh
index 363726cddd..8b24e4e0cd 100755
--- a/test/units/testsuite-50.sh
+++ b/test/units/testsuite-50.sh
@@ -45,6 +45,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
@@ -98,6 +106,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