From d9a61c299651621b5f17bfca0f2ddc3d0cbb8c35 Mon Sep 17 00:00:00 2001 From: Dennis Maisenbacher Date: Thu, 17 Oct 2024 12:02:11 +0000 Subject: [PATCH] tests: Add feature check to nvme_compare_test Check if the NVM 'compare' command is supported before running the nvme_compare_test which whould then fail with an 'Invalid Command Opcode' Signed-off-by: Dennis Maisenbacher --- tests/nvme_compare_test.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/nvme_compare_test.py b/tests/nvme_compare_test.py index 8dfce047..a34df68e 100644 --- a/tests/nvme_compare_test.py +++ b/tests/nvme_compare_test.py @@ -45,9 +45,20 @@ class TestNVMeCompareCmd(TestNVMeIO): - test_log_dir : directory for logs, temp files. """ + def compare_cmd_supported(self): + """ Wrapper for extracting optional NVM 'compare' command support + - Args: + - None + - Returns: + - True if 'compare' is supported, otherwise False + """ + return int(self.get_id_ctrl_field_value("oncs"), 16) & (1 << 0) + def setUp(self): """ Pre Section for TestNVMeCompareCmd """ super().setUp() + if not self.compare_cmd_supported(): + self.skipTest("because: Optional NVM Command 'Compare' (NVMCMPS) not supported") self.data_size = 1024 self.start_block = 1023 self.setup_log_dir(self.__class__.__name__) -- 2.50.1