2020-05-29 17:51:20 +01:00
#!/usr/bin/env bash
2021-10-17 18:13:06 +02:00
# SPDX-License-Identifier: LGPL-2.1-or-later
2020-05-29 17:51:20 +01:00
# -*- 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 13:01:59 +02:00
2020-05-29 17:51:20 +01:00
TEST_DESCRIPTION = "test systemd-dissect"
IMAGE_NAME = "dissect"
TEST_NO_NSPAWN = 1
2020-08-28 14:17:31 +01:00
TEST_INSTALL_VERITY_MINIMAL = 1
2020-05-29 17:51:20 +01:00
2021-04-19 13:01:59 +02:00
# shellcheck source=test/test-functions
. " ${ TEST_BASE_DIR : ? } /test-functions "
2020-05-29 17:51:20 +01:00
2021-10-08 12:50:13 +01: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 16:01:15 +01:00
command -v sfdisk >/dev/null 2>& 1 || exit 0
2020-05-29 17:51:20 +01:00
# Need loop devices for systemd-dissect
2021-01-06 21:42:28 +00:00
test_append_files( ) {
2020-05-29 17:51:20 +01: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 10:30:33 +01:00
install_dmevent
2020-05-29 17:51:20 +01:00
generate_module_dependencies
2020-07-10 16:01:15 +01:00
inst_binary losetup
2021-04-09 19:49:32 +02:00
inst_binary wc
2021-10-07 00:26:26 +01:00
if command -v openssl >/dev/null 2>& 1; then
inst_binary openssl
fi
2020-08-28 14:17:31 +01:00
install_verity_minimal
2020-05-29 17:51:20 +01:00
)
}
2021-04-26 19:20:18 +02:00
do_test " $@ "