2020-05-29 16:51:20 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
|
|
|
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
|
|
|
set -e
|
2021-04-19 11:01:59 +00:00
|
|
|
|
2020-05-29 16:51:20 +00:00
|
|
|
TEST_DESCRIPTION="test systemd-dissect"
|
|
|
|
IMAGE_NAME="dissect"
|
|
|
|
TEST_NO_NSPAWN=1
|
2020-08-28 13:17:31 +00:00
|
|
|
TEST_INSTALL_VERITY_MINIMAL=1
|
2020-05-29 16:51:20 +00:00
|
|
|
|
2021-04-19 11:01:59 +00:00
|
|
|
# shellcheck source=test/test-functions
|
|
|
|
. "${TEST_BASE_DIR:?}/test-functions"
|
2020-05-29 16:51:20 +00:00
|
|
|
|
2021-10-08 11:50:13 +00:00
|
|
|
QEMU_TIMEOUT=300
|
|
|
|
|
2021-02-22 12:20:33 +00:00
|
|
|
command -v mksquashfs >/dev/null 2>&1 || exit 0
|
|
|
|
command -v veritysetup >/dev/null 2>&1 || exit 0
|
2020-07-10 15:01:15 +00:00
|
|
|
command -v sfdisk >/dev/null 2>&1 || exit 0
|
2020-05-29 16:51:20 +00:00
|
|
|
|
|
|
|
# Need loop devices for systemd-dissect
|
2021-01-06 21:42:28 +00:00
|
|
|
test_append_files() {
|
2020-05-29 16:51:20 +00:00
|
|
|
(
|
|
|
|
instmods loop =block
|
|
|
|
instmods squashfs =squashfs
|
|
|
|
instmods dm_verity =md
|
2021-02-22 12:20:33 +00:00
|
|
|
instmods overlay =overlayfs
|
2020-07-10 09:30:33 +00:00
|
|
|
install_dmevent
|
2020-05-29 16:51:20 +00:00
|
|
|
generate_module_dependencies
|
2020-07-10 15:01:15 +00:00
|
|
|
inst_binary losetup
|
2021-04-09 17:49:32 +00:00
|
|
|
inst_binary wc
|
2021-10-06 23:26:26 +00:00
|
|
|
if command -v openssl >/dev/null 2>&1; then
|
|
|
|
inst_binary openssl
|
|
|
|
fi
|
2020-08-28 13:17:31 +00:00
|
|
|
install_verity_minimal
|
2020-05-29 16:51:20 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2021-04-26 17:20:18 +00:00
|
|
|
do_test "$@"
|