diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2023-11-03 15:31:52 +0100 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2023-11-04 00:26:57 +0100 |
commit | 12c25609972a64f6525381d5a2db1122a5c993ef (patch) | |
tree | e6ab8dd225f7d5b834b7a25f655b7ddeeb251933 | |
parent | Merge pull request #29848 from poettering/base64url-too (diff) | |
download | systemd-12c25609972a64f6525381d5a2db1122a5c993ef.tar.xz systemd-12c25609972a64f6525381d5a2db1122a5c993ef.zip |
test: wait for the nvme device to appear
Also, use a /dev/disk/by-id/ symlink to the device, which should be
predictable, unlike the /dev/nvmeX stuff.
-rwxr-xr-x | test/units/testsuite-84.sh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/units/testsuite-84.sh b/test/units/testsuite-84.sh index 954dce2d04..f82b527a72 100755 --- a/test/units/testsuite-84.sh +++ b/test/units/testsuite-84.sh @@ -11,15 +11,16 @@ systemctl start sys-kernel-config.mount dd if=/dev/urandom of=/var/tmp/storagetm.test bs=1024 count=10240 systemd-run -u teststoragetm.service -p Type=notify /usr/lib/systemd/systemd-storagetm /var/tmp/storagetm.test --nqn=quux +NVME_SERIAL="$(</sys/kernel/config/nvmet/subsystems/quux.storagetm.test/attr_serial)" +NVME_DEVICE="/dev/disk/by-id/nvme-Linux_${NVME_SERIAL:?}" nvme connect-all -t tcp -a 127.0.0.1 -s 16858 --hostid="$(cat /proc/sys/kernel/random/uuid)" +udevadm wait --settle "$NVME_DEVICE" -dd if=/dev/nvme1n1 bs=1024 | cmp /var/tmp/storagetm.test - - -nvme disconnect --device=nvme1 +dd if="$NVME_DEVICE" bs=1024 | cmp /var/tmp/storagetm.test - +nvme disconnect-all systemctl stop teststoragetm.service - rm /var/tmp/storagetm.test touch /testok |