Look up if the drive supports the `Get LBA Status` optional admin
command before executing a `nvme get-lba-status` or `nvme
lba-status-log` command.
Furthermore use the correct action value on `get-lba-status`.
Signed-off-by: Dennis Maisenbacher <dennis.maisenbacher@wdc.com>
def setUp(self):
""" Pre Section for TestNVMeGetLbaStatusCmd. """
super().setUp()
+ if not self.get_lba_status_supported():
+ self.skipTest("because: Optional Admin Command 'Get LBA Status' (OACS->GLSS) not supported")
self.start_lba = 0
self.block_count = 0
- self.namespace = 1
self.max_dw = 1
- self.action = 11
+ self.action = 0x11
self.range_len = 1
self.setup_log_dir(self.__class__.__name__)
"""
err = 0
get_lba_status_cmd = "nvme get-lba-status " + self.ctrl + \
- " --namespace-id=" + str(self.namespace) + \
+ " --namespace-id=" + str(self.ns1) + \
" --start-lba=" + str(self.start_lba) + \
" --max-dw=" + str(self.max_dw) + \
" --action=" + str(self.action) + \
def setUp(self):
""" Pre Section for TestNVMeLbaStatLogCmd. """
super().setUp()
+ if not self.get_lba_status_supported():
+ self.skipTest("because: Optional Admin Command 'Get LBA Status' (OACS->GLSS) not supported")
self.setup_log_dir(self.__class__.__name__)
def tearDown(self):
print(max_ns)
return int(max_ns)
+ def get_lba_status_supported(self):
+ """ Check if 'Get LBA Status' command is supported by the device
+ - Args:
+ - None
+ - Returns:
+ - True if 'Get LBA Status' command is supported, otherwise False
+ """
+ return int(self.get_id_ctrl_field_value("oacs"), 16) & (1 << 9)
+
def get_lba_format_size(self):
""" Wrapper for extracting lba format size of the given flbas
- Args: