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 ebc0514a65
This commit is contained in:
Luca Boccassi
2025-05-28 23:48:27 +01:00
parent a5b713630f
commit 60491ceb12

View File

@@ -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 -