diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-11-08 18:17:55 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-11-09 14:57:23 +0100 |
commit | efffde8e5fe829abcd2b9290e173ab047ab8f809 (patch) | |
tree | f1882dd9e37ce67aa56163ab2fb71704f10dd5cb /test | |
parent | 1a06ce16b20c642fba7aa1e2c4ea0ad71bd3605b (diff) | |
download | systemd-efffde8e5fe829abcd2b9290e173ab047ab8f809.tar.gz |
test: extend TEST-50-DISSECT for systemd-dissect --list and --with
Diffstat (limited to 'test')
-rwxr-xr-x | test/TEST-50-DISSECT/test.sh | 2 | ||||
-rwxr-xr-x | test/units/testsuite-50.sh | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/test/TEST-50-DISSECT/test.sh b/test/TEST-50-DISSECT/test.sh index 0940382d52..276dd7c716 100755 --- a/test/TEST-50-DISSECT/test.sh +++ b/test/TEST-50-DISSECT/test.sh @@ -12,7 +12,6 @@ TEST_INSTALL_VERITY_MINIMAL=1 # shellcheck source=test/test-functions . "${TEST_BASE_DIR:?}/test-functions" - command -v mksquashfs >/dev/null 2>&1 || exit 0 command -v veritysetup >/dev/null 2>&1 || exit 0 command -v sfdisk >/dev/null 2>&1 || exit 0 @@ -27,6 +26,7 @@ test_append_files() { install_dmevent generate_module_dependencies inst_binary wc + inst_binary sha256sum if command -v openssl >/dev/null 2>&1; then inst_binary openssl fi diff --git a/test/units/testsuite-50.sh b/test/units/testsuite-50.sh index 3ab020d687..10634a6ba9 100755 --- a/test/units/testsuite-50.sh +++ b/test/units/testsuite-50.sh @@ -41,6 +41,14 @@ systemd-dissect --json=short "${image}.raw" | grep -q -F '{"rw":"ro","designator systemd-dissect "${image}.raw" | grep -q -F "MARKER=1" systemd-dissect "${image}.raw" | grep -q -F -f <(sed 's/"//g' "$os_release") +systemd-dissect --list "${image}.raw" | grep -q '^etc/os-release$' + +read -r SHA256SUM1 _ < <(systemd-dissect --copy-from "${image}.raw" etc/os-release | sha256sum) +test "$SHA256SUM1" != "" +read -r SHA256SUM2 _ < <(systemd-dissect --read-only --with "${image}.raw" sha256sum etc/os-release) +test "$SHA256SUM2" != "" +test "$SHA256SUM1" = "$SHA256SUM2" + mv "${image}.verity" "${image}.fooverity" mv "${image}.roothash" "${image}.foohash" systemd-dissect --json=short "${image}.raw" --root-hash="${roothash}" --verity-data="${image}.fooverity" | grep -q -F '{"rw":"ro","designator":"root","partition_uuid":null,"partition_label":null,"fstype":"squashfs","architecture":null,"verity":"external"' |