Skip to content

Commit 5af42e2

Browse files
roothreinecke
authored andcommitted
nvme: Add test for sending admin commands over disabled paths
ANA states only apply to commands to individual namespaces, not to commands for the controller. So add a testcase to check if we can send admin commands over inaccessible paths. Signed-off-by: Hannes Reinecke <[email protected]>
1 parent 283923d commit 5af42e2

2 files changed

Lines changed: 74 additions & 0 deletions

File tree

tests/nvme/064

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: GPL-3.0+
3+
# Copyright (C) 2024 Hannes Reinecke (SUSE) <[email protected]>
4+
#
5+
# Test nvme fabrics controller ANA failover during I/O
6+
7+
. tests/nvme/rc
8+
9+
DESCRIPTION="test admin commands on disabled paths"
10+
11+
requires() {
12+
_nvme_requires
13+
_have_loop
14+
_have_fio
15+
_require_nvme_trtype_is_fabrics
16+
}
17+
18+
set_conditions() {
19+
_set_nvme_trtype "$@"
20+
}
21+
22+
test() {
23+
local -a ports
24+
local port
25+
local ns
26+
27+
echo "Running ${TEST_NAME}"
28+
29+
_setup_nvmet
30+
31+
_nvmet_target_setup
32+
33+
_nvme_connect_subsys
34+
35+
ns=$(_find_nvme_ns "${def_subsys_uuid}")
36+
[ -z "${ns}" ] && return 1
37+
nvme nvm-id-ctrl "/dev/${ns}"
38+
nvme nvm-id-ns "/dev/${ns}"
39+
40+
# switch to ANA inaccessible
41+
_get_nvmet_ports "${def_subsysnqn}" ports
42+
for port in $ports; do
43+
_setup_nvmet_port_ana "${port}" 1 "inaccessible"
44+
done
45+
46+
nvme nvm-id-ctrl "/dev/${ns}"
47+
nvme nvm-id-ns "/dev/${ns}" 2> /dev/null || true
48+
49+
_nvme_disconnect_subsys
50+
_nvmet_target_cleanup
51+
52+
echo "Test complete"
53+
}

tests/nvme/064.out

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Running nvme/064
2+
NVMe Identify Controller NVM:
3+
vsl : 0
4+
wzsl : 0
5+
wusl : 0
6+
dmrl : 0
7+
dmrsl : 0
8+
dmsl : 0
9+
NVMe NVM Identify Namespace 1:
10+
lbstm : 0
11+
pic : 0
12+
elbaf 0 : pif:0 sts:0 (in use)
13+
NVMe Identify Controller NVM:
14+
vsl : 0
15+
wzsl : 0
16+
wusl : 0
17+
dmrl : 0
18+
dmrsl : 0
19+
dmsl : 0
20+
disconnected 1 controller(s)
21+
Test complete

0 commit comments

Comments
 (0)