From 60491ceb12aac9f2b9423490158bd9291d735b36 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 28 May 2025 23:48:27 +0100 Subject: [PATCH] test: fix TEST-84-STORAGETM with nvme-cli < 2.7 The -vv parameter was added in version 2.7, check before using it Follow-up for ebc0514a6507d51e536b269e30a036a7992beeb7 --- test/units/TEST-84-STORAGETM.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/units/TEST-84-STORAGETM.sh b/test/units/TEST-84-STORAGETM.sh index 0db7071804..8d4fdbcf23 100755 --- a/test/units/TEST-84-STORAGETM.sh +++ b/test/units/TEST-84-STORAGETM.sh @@ -11,6 +11,11 @@ if systemd-analyze compare-versions "$(nvme --version | grep libnvme | awk '{pri fi fi +VERBOSE="" +if systemd-analyze compare-versions "$(nvme --version | grep '^nvme' | awk '{print $3}')" ge 2.7; then + VERBOSE="-vv" +fi + /usr/lib/systemd/systemd-storagetm --list-devices modprobe -v nvmet-tcp @@ -24,7 +29,7 @@ NVME_UUID="$(cat /proc/sys/kernel/random/uuid)" systemd-run -u teststoragetm.service -p Type=notify -p "Environment=SYSTEMD_NVME_UUID=${NVME_UUID:?}" /usr/lib/systemd/systemd-storagetm /var/tmp/storagetm.test --nqn=quux NVME_DEVICE="/dev/disk/by-id/nvme-uuid.${NVME_UUID:?}" -nvme connect-all -vv -t tcp -a 127.0.0.1 -s 16858 --hostnqn="$(nvme gen-hostnqn)" +nvme connect-all "${VERBOSE}" -t tcp -a 127.0.0.1 -s 16858 --hostnqn="$(nvme gen-hostnqn)" udevadm wait --settle --timeout=30 "$NVME_DEVICE" dd if="$NVME_DEVICE" bs=1024 | cmp /var/tmp/storagetm.test -