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
2024-01-23 16:20:10 +01:00
# On Ubuntu the BPF LSM is not enabled by default, so we need to do it via the
# kernel command line on boot
if [ " $LOOKS_LIKE_UBUNTU " = "yes" ] ; then
KERNEL_OPTIONS = (
"lsm=lockdown,capability,landlock,yama,apparmor,bpf"
)
KERNEL_APPEND += " ${ KERNEL_OPTIONS [*] } "
fi
2023-06-02 21:10:08 +02:00
test_require_bin mksquashfs veritysetup sfdisk
2020-05-29 17:51:20 +01:00
2021-01-06 21:42:28 +00:00
test_append_files( ) {
2023-05-14 13:13:24 +02:00
instmods squashfs = squashfs
instmods dm_verity = md
install_dmevent
generate_module_dependencies
inst_binary wc
inst_binary sha256sum
2024-01-24 12:28:41 +01:00
inst_binary tar
2023-05-14 13:13:24 +02:00
if command -v openssl >/dev/null 2>& 1; then
inst_binary openssl
fi
2023-07-13 22:10:01 +00:00
inst_binary mksquashfs
2023-06-20 13:54:07 +02:00
inst_binary unsquashfs
2024-04-25 11:57:09 +01:00
inst_binary pkcheck
2024-06-04 16:00:03 +01:00
inst_binary veritysetup
2023-05-14 13:13:24 +02:00
install_verity_minimal
2020-05-29 17:51:20 +01:00
}
2021-04-26 19:20:18 +02:00
do_test " $@ "