Skip to content

Commit 866a9a5

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 (cherry picked from commit 60491ce) (cherry picked from commit f75ca4648efd92e6a7a5a244a5de09187a30e43c) (cherry picked from commit 4227d16e5623ed085afe5a4773fa81845ffa0179)
1 parent ef497ca commit 866a9a5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/units/testsuite-84.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
modprobe -v nvmet-tcp
1520
modprobe -v nvme-tcp
1621

@@ -22,7 +27,7 @@ NVME_UUID="$(cat /proc/sys/kernel/random/uuid)"
2227
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
2328
NVME_DEVICE="/dev/disk/by-id/nvme-uuid.${NVME_UUID:?}"
2429

25-
nvme connect-all -vv -t tcp -a 127.0.0.1 -s 16858 --hostnqn="$(nvme gen-hostnqn)"
30+
nvme connect-all "${VERBOSE}" -t tcp -a 127.0.0.1 -s 16858 --hostnqn="$(nvme gen-hostnqn)"
2631
udevadm wait --settle "$NVME_DEVICE"
2732

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

0 commit comments

Comments
 (0)