2020-05-29 16:51:20 +00:00
|
|
|
#!/usr/bin/env bash
|
2021-10-17 16:13:06 +00:00
|
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
2020-05-29 16:51:20 +00: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 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
|
|
|
|
2024-01-23 15:20:10 +00: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 19:10:08 +00:00
|
|
|
test_require_bin mksquashfs veritysetup sfdisk
|
2020-05-29 16:51:20 +00:00
|
|
|
|
2021-01-06 21:42:28 +00:00
|
|
|
test_append_files() {
|
2023-05-14 11:13:24 +00:00
|
|
|
instmods squashfs =squashfs
|
|
|
|
instmods dm_verity =md
|
|
|
|
install_dmevent
|
|
|
|
generate_module_dependencies
|
|
|
|
inst_binary wc
|
|
|
|
inst_binary sha256sum
|
2024-01-24 11:28:41 +00:00
|
|
|
inst_binary tar
|
2023-05-14 11:13:24 +00: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 11:54:07 +00:00
|
|
|
inst_binary unsquashfs
|
2024-04-25 10:57:09 +00:00
|
|
|
inst_binary pkcheck
|
2023-05-14 11:13:24 +00:00
|
|
|
install_verity_minimal
|
2020-05-29 16:51:20 +00:00
|
|
|
}
|
|
|
|
|
2021-04-26 17:20:18 +00:00
|
|
|
do_test "$@"
|