]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/TEST-50-DISSECT/test.sh
Merge pull request #31648 from neighbourhoodie/review-content
[thirdparty/systemd.git] / test / TEST-50-DISSECT / test.sh
1 #!/usr/bin/env bash
2 # SPDX-License-Identifier: LGPL-2.1-or-later
3 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
4 # ex: ts=8 sw=4 sts=4 et filetype=sh
5 set -e
6
7 TEST_DESCRIPTION="test systemd-dissect"
8 IMAGE_NAME="dissect"
9 TEST_NO_NSPAWN=1
10 TEST_INSTALL_VERITY_MINIMAL=1
11
12 # shellcheck source=test/test-functions
13 . "${TEST_BASE_DIR:?}/test-functions"
14
15 # On Ubuntu the BPF LSM is not enabled by default, so we need to do it via the
16 # kernel command line on boot
17 if [ "$LOOKS_LIKE_UBUNTU" = "yes" ]; then
18 KERNEL_OPTIONS=(
19 "lsm=lockdown,capability,landlock,yama,apparmor,bpf"
20 )
21 KERNEL_APPEND+=" ${KERNEL_OPTIONS[*]}"
22 fi
23
24 test_require_bin mksquashfs veritysetup sfdisk
25
26 test_append_files() {
27 instmods squashfs =squashfs
28 instmods dm_verity =md
29 install_dmevent
30 generate_module_dependencies
31 inst_binary wc
32 inst_binary sha256sum
33 inst_binary tar
34 if command -v openssl >/dev/null 2>&1; then
35 inst_binary openssl
36 fi
37 inst_binary mksquashfs
38 inst_binary unsquashfs
39 install_verity_minimal
40 }
41
42 do_test "$@"