diff options
author | Vallari Agrawal <50358181+VallariAg@users.noreply.github.com> | 2025-01-09 15:00:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-09 15:00:49 +0100 |
commit | 7892d0dd7d594248a8aa6abd81f8f3e018e338ad (patch) | |
tree | f679c7835e8b6253f2faa020bd0584ab50a5a0e4 /qa | |
parent | Merge pull request #60623 from piyushagarwal1411/ceph-exporter (diff) | |
parent | qa/workunits/nvmeof/basic_tests.sh: fix connect-all assert (diff) | |
download | ceph-7892d0dd7d594248a8aa6abd81f8f3e018e338ad.tar.xz ceph-7892d0dd7d594248a8aa6abd81f8f3e018e338ad.zip |
Merge pull request #61262 from VallariAg/fix-nvmeof-teuthology-basic-test
qa/workunits/nvmeof/basic_tests.sh: fix nvme list assert
Diffstat (limited to 'qa')
-rw-r--r-- | qa/tasks/nvmeof.py | 2 | ||||
-rwxr-xr-x | qa/workunits/nvmeof/basic_tests.sh | 4 | ||||
-rwxr-xr-x | qa/workunits/nvmeof/fio_test.sh | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/qa/tasks/nvmeof.py b/qa/tasks/nvmeof.py index c58a7267b4e..691a6f7dd86 100644 --- a/qa/tasks/nvmeof.py +++ b/qa/tasks/nvmeof.py @@ -315,7 +315,7 @@ class NvmeofThrasher(Thrasher, Greenlet): def _get_devices(self, remote): GET_DEVICE_CMD = "sudo nvme list --output-format=json | " \ - "jq -r '.Devices | sort_by(.NameSpace) | .[] | select(.ModelNumber == \"Ceph bdev Controller\") | .DevicePath'" + "jq -r '.Devices[].Subsystems[] | select(.Controllers | all(.ModelNumber == \"Ceph bdev Controller\")) | .Namespaces | sort_by(.NSID) | .[] | .NameSpace'" devices = remote.sh(GET_DEVICE_CMD).split() return devices diff --git a/qa/workunits/nvmeof/basic_tests.sh b/qa/workunits/nvmeof/basic_tests.sh index 794353348b4..9e7a1f5134e 100755 --- a/qa/workunits/nvmeof/basic_tests.sh +++ b/qa/workunits/nvmeof/basic_tests.sh @@ -39,7 +39,7 @@ connect_all() { sudo nvme connect-all --traddr=$NVMEOF_DEFAULT_GATEWAY_IP_ADDRESS --transport=tcp -l 3600 sleep 5 expected_devices_count=$1 - actual_devices=$(sudo nvme list --output-format=json | grep -o "$SPDK_CONTROLLER" | wc -l) + actual_devices=$(sudo nvme list --output-format=json | jq -r ".Devices[].Subsystems[] | select(.Controllers | all(.ModelNumber == \"$SPDK_CONTROLLER\")) | .Namespaces[].NameSpace" | wc -l) if [ "$actual_devices" -ne "$expected_devices_count" ]; then sudo nvme list --output-format=json return 1 @@ -74,7 +74,7 @@ test_run connect test_run list_subsys 1 test_run disconnect_all test_run list_subsys 0 -devices_count=$(( $NVMEOF_NAMESPACES_COUNT * $NVMEOF_SUBSYSTEMS_COUNT)) +devices_count=$(( $NVMEOF_NAMESPACES_COUNT * $NVMEOF_SUBSYSTEMS_COUNT )) test_run connect_all $devices_count gateways_count=$(( $(echo "$NVMEOF_GATEWAY_IP_ADDRESSES" | tr -cd ',' | wc -c) + 1 )) multipath_count=$(( $gateways_count * $NVMEOF_SUBSYSTEMS_COUNT)) diff --git a/qa/workunits/nvmeof/fio_test.sh b/qa/workunits/nvmeof/fio_test.sh index 03fb58693bd..f7f783afc67 100755 --- a/qa/workunits/nvmeof/fio_test.sh +++ b/qa/workunits/nvmeof/fio_test.sh @@ -34,7 +34,7 @@ done fio_file=$(mktemp -t nvmeof-fio-XXXX) all_drives_list=$(sudo nvme list --output-format=json | - jq -r '.Devices | sort_by(.NameSpace) | .[] | select(.ModelNumber == "Ceph bdev Controller") | .DevicePath') + jq -r '.Devices[].Subsystems[] | select(.Controllers | all(.ModelNumber == "Ceph bdev Controller")) | .Namespaces | sort_by(.NSID) | .[] | .NameSpace') # When the script is passed --start_ns and --end_ns (example: `nvmeof_fio_test.sh --start_ns 1 --end_ns 3`), # then fio runs on namespaces only in the defined range (which is 1 to 3 here). |