From 39bea55b2de0eabc2a876ed40dd664d1f80cbcd2 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 16 Sep 2024 20:28:34 +0200 Subject: Merging upstream version 256.6. Signed-off-by: Daniel Baumann --- test/TEST-13-NSPAWN/test.sh | 2 + test/integration-test-wrapper.py | 2 +- test/test-functions | 25 +++++++++++- test/test-systemctl-enable.sh | 2 +- test/units/TEST-13-NSPAWN.nspawn.sh | 60 +++++++++++++++++++++++++---- test/units/TEST-58-REPART.sh | 45 +++++++++++++++++++++- test/units/TEST-74-AUX-UTILS.detect-virt.sh | 7 ++++ 7 files changed, 131 insertions(+), 12 deletions(-) create mode 100755 test/units/TEST-74-AUX-UTILS.detect-virt.sh (limited to 'test') diff --git a/test/TEST-13-NSPAWN/test.sh b/test/TEST-13-NSPAWN/test.sh index 5c85b0c..3ab52d0 100755 --- a/test/TEST-13-NSPAWN/test.sh +++ b/test/TEST-13-NSPAWN/test.sh @@ -17,6 +17,8 @@ test_append_files() { # For virtual wlan interface. instmods mac80211_hwsim + # for IPMasquerade= + instmods "=net/netfilter" generate_module_dependencies # Create a dummy container "template" with a minimal toolset, which we can diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py index 0931043..e0a4b6e 100755 --- a/test/integration-test-wrapper.py +++ b/test/integration-test-wrapper.py @@ -149,7 +149,7 @@ def main(): '--runtime-scratch=no', *args.mkosi_args, '--qemu-firmware', args.firmware, - '--qemu-kvm', "auto" if not bool(int(os.getenv("TEST_NO_KVM", "0"))) else "no", + *(['--qemu-kvm', 'no'] if int(os.getenv("TEST_NO_KVM", "0")) else []), '--kernel-command-line-extra', ' '.join([ 'systemd.hostname=H', diff --git a/test/test-functions b/test/test-functions index 04fe20f..69a0e58 100644 --- a/test/test-functions +++ b/test/test-functions @@ -1453,10 +1453,31 @@ install_missing_libraries() { [[ -e "$libgcc_s" ]] && inst_library "$libgcc_s" done < <(ldconfig -p | awk '/\/libgcc_s.so.1$/ { print $4 }') - local lib path + local lib path libs # A number of dependencies is now optional via dlopen, so the install # script will not pick them up, since it looks at linkage. - for lib in libcryptsetup libidn libidn2 pwquality libqrencode tss2-esys tss2-rc tss2-mu tss2-tcti-device libfido2 libbpf libelf libdw xkbcommon p11-kit-1 libarchive libgcrypt libkmod; do + libs=( + libarchive + libbpf + libcryptsetup + libdw + libelf + libfido2 + libgcrypt + libidn + libidn2 + libip4tc + libkmod + libqrencode + p11-kit-1 + pwquality + tss2-esys + tss2-mu + tss2-rc + tss2-tcti-device + xkbcommon + ) + for lib in "${libs[@]}"; do ddebug "Searching for $lib via pkg-config" if pkg-config --exists "$lib"; then path="$(pkg-config --variable=libdir "$lib")" diff --git a/test/test-systemctl-enable.sh b/test/test-systemctl-enable.sh index 5615c90..3fc59f6 100644 --- a/test/test-systemctl-enable.sh +++ b/test/test-systemctl-enable.sh @@ -3,7 +3,7 @@ set -ex # Silence warning from running_in_chroot_or_offline() -export SYSTEMD_IGNORE_CHROOT=1 +export SYSTEMD_IN_CHROOT=0 systemctl=${1:-systemctl} systemd_id128=${2:-systemd-id128} diff --git a/test/units/TEST-13-NSPAWN.nspawn.sh b/test/units/TEST-13-NSPAWN.nspawn.sh index ee0fef8..ad11468 100755 --- a/test/units/TEST-13-NSPAWN.nspawn.sh +++ b/test/units/TEST-13-NSPAWN.nspawn.sh @@ -943,6 +943,17 @@ matrix_run_one() { return 0 } +testcase_api_vfs() { + local api_vfs_writable + + for api_vfs_writable in yes no network; do + matrix_run_one no no $api_vfs_writable + matrix_run_one yes no $api_vfs_writable + matrix_run_one no yes $api_vfs_writable + matrix_run_one yes yes $api_vfs_writable + done +} + testcase_check_os_release() { # https://github.com/systemd/systemd/issues/29185 local base common_opts root @@ -973,11 +984,46 @@ testcase_check_os_release() { rm -fr "$root" "$base" } -run_testcases +testcase_ip_masquerade() { + local root + + if ! command -v networkctl >/dev/null; then + echo "This test requires systemd-networkd, skipping..." + return 0 + fi + + systemctl unmask systemd-networkd.service + systemctl edit --runtime --stdin systemd-networkd.service --drop-in=debug.conf <