Skip to content

Commit

Permalink
tests: check if verify command is supported
Browse files Browse the repository at this point in the history
Check if the optional NVM command 'verify' (NVMCPYS) is supported before
running tests for this command.

Signed-off-by: Dennis Maisenbacher <[email protected]>
  • Loading branch information
MaisenbacherD authored and igaw committed Feb 14, 2025
1 parent d746cd9 commit ecb2e26
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/nvme_verify_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""

from nvme_test import TestNVMe
from nvme_test import TestNVMe, to_decimal


class TestNVMeVerify(TestNVMe):
Expand All @@ -25,9 +25,21 @@ class TestNVMeVerify(TestNVMe):
- test_log_dir : directory for logs, temp files.
"""

def verify_cmd_supported(self):
""" Wrapper for extracting optional NVM 'verify' command support
- Args:
- None
- Returns:
- True if 'verify' is supported, otherwise False
"""
return to_decimal(self.get_id_ctrl_field_value("oncs")) & (1 << 7)

def setUp(self):
""" Pre Section for TestNVMeVerify """
super().setUp()
if not self.verify_cmd_supported():
self.skipTest(
"because: Optional NVM Command 'Verify' (NVMVFYS) not supported")
self.start_block = 0
self.block_count = 0
self.namespace = 1
Expand Down

0 comments on commit ecb2e26

Please sign in to comment.