Commit 9d472e9
committed
common/nvme: do not call 'nvme id-ns' to non-nvme devices
The test case block/041 tests PI metadata capability in the block layer.
At this moment, nvme is the only one block device that supports the
capability. To check that the test target nvme devices fulfills the
requirement, the test case calls 'nvme ns-id' command via
_test_dev_disable_extended_lba(). However, since the test case is in
the block group, TEST_DEVS can specify non-nvme devices. Even though the
test case is skipped by _require_test_dev_is_nvme() check, the
'nvme ns-id' is called for the non-nvme device and fails. It spits out
unnecessary error messages.
To avoid the error message, check if the test device is nvme before
calling 'nvme ns-id'. For the check, factor out a helper function
_test_dev_is_nvme(). While at it, replace short command options -q and
-f with long options --quiet and --canonicalize for readability.
Reviewed-by: Chaitanya Kulkarni <[email protected]>
Signed-off-by: Shin'ichiro Kawasaki <[email protected]>1 parent b14a95a commit 9d472e9
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1115 | 1115 | | |
1116 | 1116 | | |
1117 | 1117 | | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
1118 | 1122 | | |
1119 | | - | |
| 1123 | + | |
1120 | 1124 | | |
1121 | 1125 | | |
1122 | 1126 | | |
| |||
1144 | 1148 | | |
1145 | 1149 | | |
1146 | 1150 | | |
1147 | | - | |
1148 | | - | |
| 1151 | + | |
| 1152 | + | |
1149 | 1153 | | |
1150 | 1154 | | |
1151 | 1155 | | |
| |||
0 commit comments