2022-11-03 13:13:03 +01:00
#!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -e
TEST_DESCRIPTION = "Tests for auxiliary utilities"
2023-04-10 18:45:00 +08:00
NSPAWN_ARGUMENTS = "--private-network"
2022-11-03 13:13:03 +01:00
# shellcheck source=test/test-functions
. " ${ TEST_BASE_DIR : ? } /test-functions "
2024-01-03 19:00:39 +01:00
# (Hopefully) a temporary workaround for https://github.com/systemd/systemd/issues/30573
KERNEL_APPEND = " ${ KERNEL_APPEND :- } SYSTEMD_DEFAULT_MOUNT_RATE_LIMIT_BURST=100 "
2024-01-10 11:28:23 +01:00
# Make sure vsock is available in the VM
CID = $(( RANDOM + 3 ))
QEMU_OPTIONS += " -device vhost-vsock-pci,guest-cid= $CID "
2023-05-16 18:31:45 +02:00
test_append_files( ) {
local workspace = " ${ 1 : ? } "
2023-05-17 09:05:04 +02:00
if ! get_bool " ${ TEST_PREFER_NSPAWN :- } " && ! get_bool " ${ TEST_NO_QEMU :- } " ; then
# Check if we can correctly boot with an invalid machine ID only if we run
# the QEMU test, as nspawn refuses the invalid machine ID with -EUCLEAN
printf "556f48e837bc4424a710fa2e2c9d3e3c\ne3d\n" >" $workspace /etc/machine-id "
fi
2023-12-05 23:18:17 +09:00
if host_has_btrfs && host_has_mdadm; then
install_btrfs
install_mdadm
generate_module_dependencies
fi
2024-01-08 22:26:17 +01:00
2024-01-10 11:28:23 +01:00
inst_binary socat
inst_binary ssh
inst_binary sshd
inst_binary ssh-keygen
inst_binary usermod
instmods vmw_vsock_virtio_transport
instmods vsock_loopback
instmods vmw_vsock_vmci_transport
generate_module_dependencies
2023-05-16 18:31:45 +02:00
}
2022-11-03 13:13:03 +01:00
do_test " $@ "