@@ -29,8 +29,7 @@ test() {
local nvmedev
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
_nvme_disconnect_subsys ${def_subsysnqn}
@@ -1,5 +1,3 @@
Running nvme/004
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
NQN:blktests-subsystem-1 disconnected 1 controller(s)
Test complete
@@ -27,8 +27,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
_nvme_disconnect_subsys "${def_subsysnqn}"
@@ -1,5 +1,3 @@
Running nvme/008
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
NQN:blktests-subsystem-1 disconnected 1 controller(s)
Test complete
@@ -26,8 +26,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
_nvme_disconnect_subsys "${def_subsysnqn}"
@@ -1,5 +1,3 @@
Running nvme/009
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
NQN:blktests-subsystem-1 disconnected 1 controller(s)
Test complete
@@ -27,8 +27,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
_run_fio_verify_io --size="${nvme_img_size}" \
--filename="/dev/${nvmedev}n1"
@@ -1,5 +1,3 @@
Running nvme/010
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
NQN:blktests-subsystem-1 disconnected 1 controller(s)
Test complete
@@ -27,8 +27,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
_run_fio_verify_io --size="${nvme_img_size}" \
--filename="/dev/${nvmedev}n1"
@@ -1,5 +1,3 @@
Running nvme/011
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
NQN:blktests-subsystem-1 disconnected 1 controller(s)
Test complete
@@ -31,8 +31,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
_xfs_run_fio_verify_io "/dev/${nvmedev}n1"
@@ -1,5 +1,3 @@
Running nvme/012
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
NQN:blktests-subsystem-1 disconnected 1 controller(s)
Test complete
@@ -30,8 +30,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
_xfs_run_fio_verify_io "/dev/${nvmedev}n1"
@@ -1,5 +1,3 @@
Running nvme/013
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
NQN:blktests-subsystem-1 disconnected 1 controller(s)
Test complete
@@ -30,8 +30,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
size="$(blockdev --getsize64 "/dev/${nvmedev}n1")"
bs="$(blockdev --getbsz "/dev/${nvmedev}n1")"
@@ -1,6 +1,4 @@
Running nvme/014
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
NVMe Flush: success
NQN:blktests-subsystem-1 disconnected 1 controller(s)
Test complete
@@ -30,8 +30,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
size="$(blockdev --getsize64 "/dev/${nvmedev}n1")"
bs="$(blockdev --getbsz "/dev/${nvmedev}n1")"
@@ -1,6 +1,4 @@
Running nvme/015
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
NVMe Flush: success
NQN:blktests-subsystem-1 disconnected 1 controller(s)
Test complete
@@ -28,8 +28,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
local sectors
local bs
@@ -1,5 +1,3 @@
Running nvme/018
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
NQN:blktests-subsystem-1 disconnected 1 controller(s)
Test complete
@@ -29,8 +29,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
nvme dsm "/dev/${nvmedev}" -n 1 -d -s "${sblk_range}" -b "${nblk_range}"
@@ -1,6 +1,4 @@
Running nvme/019
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
NVMe DSM: success
NQN:blktests-subsystem-1 disconnected 1 controller(s)
Test complete
@@ -28,8 +28,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
nvme dsm "/dev/${nvmedev}" -n 1 -d -s "${sblk_range}" -b "${nblk_range}"
@@ -1,6 +1,4 @@
Running nvme/020
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
NVMe DSM: success
NQN:blktests-subsystem-1 disconnected 1 controller(s)
Test complete
@@ -27,8 +27,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
if ! nvme list 2>> "$FULL" | grep -q "${nvmedev}n1"; then
echo "ERROR: device not listed"
@@ -1,4 +1,2 @@
Running nvme/021
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
Test complete
@@ -27,8 +27,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
if ! nvme reset "/dev/${nvmedev}" >> "$FULL" 2>&1; then
echo "ERROR: reset failed"
@@ -1,4 +1,2 @@
Running nvme/022
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
Test complete
@@ -27,8 +27,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
if ! nvme smart-log "/dev/${nvmedev}" -n 1 >> "$FULL" 2>&1; then
echo "ERROR: smart-log bdev-ns failed"
@@ -1,4 +1,2 @@
Running nvme/023
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
Test complete
@@ -27,8 +27,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
if ! nvme smart-log "/dev/${nvmedev}" -n 1 >> "$FULL" 2>&1; then
echo "ERROR: smart-log file-ns failed"
@@ -1,4 +1,2 @@
Running nvme/024
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
Test complete
@@ -27,8 +27,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
if ! nvme effects-log "/dev/${nvmedev}" >> "$FULL" 2>&1; then
echo "ERROR: effects-log failed"
@@ -1,4 +1,2 @@
Running nvme/025
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
Test complete
@@ -27,8 +27,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
if ! nvme ns-descs "/dev/${nvmedev}" -n 1 >> "$FULL" 2>&1; then
echo "ERROR: ns-desc failed"
@@ -1,4 +1,2 @@
Running nvme/026
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
Test complete
@@ -27,8 +27,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
if ! nvme ns-rescan "/dev/${nvmedev}" >> "$FULL" 2>&1; then
echo "ERROR: ns-rescan failed"
@@ -1,4 +1,2 @@
Running nvme/027
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
Test complete
@@ -27,8 +27,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
if ! nvme list-subsys 2>> "$FULL" | grep -q "${nvme_trtype}"; then
echo "ERROR: list-subsys"
@@ -1,4 +1,2 @@
Running nvme/028
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
Test complete
@@ -60,8 +60,7 @@ test() {
_nvme_connect_subsys "${nvme_trtype}" "${def_subsysnqn}"
nvmedev=$(_find_nvme_dev "${def_subsysnqn}")
- cat "/sys/block/${nvmedev}n1/uuid"
- cat "/sys/block/${nvmedev}n1/wwid"
+ _check_uuid "${nvmedev}"
local dev="/dev/${nvmedev}n1"
test_user_io "$dev" 1 512 > "$FULL" 2>&1 || echo FAIL
@@ -1,4 +1,2 @@
Running nvme/029
-91fdba0d-f87b-4c25-b80f-db7be1418b9e
-uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
Test complete
@@ -959,6 +959,30 @@ _check_genctr() {
echo "${genctr}"
}
+_check_uuid() {
+ local nvmedev=$1
+ local nr_nsid=0
+
+ for ns in "/sys/block/${nvmedev}n"* ; do
+ [ -e "${ns}/wwid" ] || continue
+ nr_nsid=$((nr_nsid + 1))
+ [ -e "${ns}/uuid" ] || continue
+ uuid=$(cat "${ns}/uuid")
+ wwid=$(cat "${ns}/wwid")
+ if [ "${uuid}" != "${wwid#uuid.}" ]; then
+ echo "UUID ${uuid} mismatch (wwid ${wwid})"
+ return 1
+ elif [ "${uuid}" != "${def_subsys_uuid}" ]; then
+ echo "UUID ${uuid} mismatch with ${def_subsys_uuid})"
+ return 1
+ fi
+ done
+ if [ $nr_nsid -eq 0 ] ; then
+ echo "No namespaces found"
+ return 1
+ fi
+}
+
declare -A NS_DEV_FAULT_INJECT_SAVE
declare -A CTRL_DEV_FAULT_INJECT_SAVE