From ecb2e26289cf26609248229c42f12eedf18eebb7 Mon Sep 17 00:00:00 2001 From: Dennis Maisenbacher Date: Thu, 13 Feb 2025 13:56:36 +0000 Subject: [PATCH] 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 --- tests/nvme_verify_test.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/nvme_verify_test.py b/tests/nvme_verify_test.py index 44c8942b..90e149dc 100644 --- a/tests/nvme_verify_test.py +++ b/tests/nvme_verify_test.py @@ -13,7 +13,7 @@ NVMe Verify Testcase:- """ -from nvme_test import TestNVMe +from nvme_test import TestNVMe, to_decimal class TestNVMeVerify(TestNVMe): @@ -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 -- 2.50.1