From b6be8bf2c638ac93c982c95230ed33a408236a4e Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Fri, 4 Jul 2025 01:18:47 +0100 Subject: [PATCH] test: do not fail if scsi_debug module not available On Debian it's only built on amd64 kernels, so skip test cases if it cannot be loaded --- test/units/TEST-17-UDEV.sanity-check.sh | 4 ++-- test/units/TEST-35-LOGIN.sh | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/units/TEST-17-UDEV.sanity-check.sh b/test/units/TEST-17-UDEV.sanity-check.sh index 7b95722f7a8..98a277a47eb 100755 --- a/test/units/TEST-17-UDEV.sanity-check.sh +++ b/test/units/TEST-17-UDEV.sanity-check.sh @@ -190,8 +190,8 @@ udevadm test-builtin "factory_reset status" "$loopdev" # systemd-hwdb update is extremely slow when combined with sanitizers and run # in a VM without acceleration, so let's just skip the one particular test # if we detect this combination -if ! [[ -v ASAN_OPTIONS && "$(systemd-detect-virt -v)" == "qemu" ]]; then - modprobe scsi_debug +# scsi_debug is not available in all architectures/kernels combinations +if ! [[ -v ASAN_OPTIONS && "$(systemd-detect-virt -v)" == "qemu" ]] && modprobe scsi_debug; then scsidev=$(readlink -f /sys/bus/pseudo/drivers/scsi_debug/adapter*/host*/target*/[0-9]*) mkdir -p /etc/udev/hwdb.d cat >/etc/udev/hwdb.d/99-test.hwdb </dev/null; do sleep 1; done' dev=/dev/$(ls /sys/bus/pseudo/drivers/scsi_debug/adapter*/host*/target*/*:*/block 2>/dev/null) if [[ ! -b "$dev" ]]; then -- 2.47.3