Skip to content

Commit 60491ce

Browse files
committed
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 ebc0514
1 parent a5b7136 commit 60491ce

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/units/TEST-84-STORAGETM.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ if systemd-analyze compare-versions "$(nvme --version | grep libnvme | awk '{pri
1111
fi
1212
fi
1313

14+
VERBOSE=""
15+
if systemd-analyze compare-versions "$(nvme --version | grep '^nvme' | awk '{print $3}')" ge 2.7; then
16+
VERBOSE="-vv"
17+
fi
18+
1419
/usr/lib/systemd/systemd-storagetm --list-devices
1520

1621
modprobe -v nvmet-tcp
@@ -24,7 +29,7 @@ NVME_UUID="$(cat /proc/sys/kernel/random/uuid)"
2429
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
2530
NVME_DEVICE="/dev/disk/by-id/nvme-uuid.${NVME_UUID:?}"
2631

27-
nvme connect-all -vv -t tcp -a 127.0.0.1 -s 16858 --hostnqn="$(nvme gen-hostnqn)"
32+
nvme connect-all "${VERBOSE}" -t tcp -a 127.0.0.1 -s 16858 --hostnqn="$(nvme gen-hostnqn)"
2833
udevadm wait --settle --timeout=30 "$NVME_DEVICE"
2934

3035
dd if="$NVME_DEVICE" bs=1024 | cmp /var/tmp/storagetm.test -

0 commit comments

Comments
 (0)