Skip to content

Commit ecb2e26

Browse files
MaisenbacherDigaw
authored andcommitted
tests: check if verify command is supported
Check if the optional NVM command 'verify' (NVMCPYS) is supported before running tests for this command. Signed-off-by: Dennis Maisenbacher <dennis.maisenbacher@wdc.com>
1 parent d746cd9 commit ecb2e26

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/nvme_verify_test.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
1414
"""
1515

16-
from nvme_test import TestNVMe
16+
from nvme_test import TestNVMe, to_decimal
1717

1818

1919
class TestNVMeVerify(TestNVMe):
@@ -25,9 +25,21 @@ class TestNVMeVerify(TestNVMe):
2525
- test_log_dir : directory for logs, temp files.
2626
"""
2727

28+
def verify_cmd_supported(self):
29+
""" Wrapper for extracting optional NVM 'verify' command support
30+
- Args:
31+
- None
32+
- Returns:
33+
- True if 'verify' is supported, otherwise False
34+
"""
35+
return to_decimal(self.get_id_ctrl_field_value("oncs")) & (1 << 7)
36+
2837
def setUp(self):
2938
""" Pre Section for TestNVMeVerify """
3039
super().setUp()
40+
if not self.verify_cmd_supported():
41+
self.skipTest(
42+
"because: Optional NVM Command 'Verify' (NVMVFYS) not supported")
3143
self.start_block = 0
3244
self.block_count = 0
3345
self.namespace = 1

0 commit comments

Comments
 (0)