Skip to content

Commit 393384b

Browse files
authored
Merge pull request #3072 from Naresh-ibm/nvme_reset_check_remove
fixing the lockdown issue on nvme tests
2 parents 5872819 + 624b53a commit 393384b

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

io/disk/ssd/nvmetest.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ def setUp(self):
8888

8989
cmd = "%s id-ctrl %s -H" % (self.binary, self.device)
9090
self.id_ctrl = process.system_output(cmd, shell=True).decode("utf-8")
91-
cmd = "%s show-regs %s -H" % (self.binary, self.device)
92-
regs = process.system_output(cmd, shell=True).decode("utf-8")
9391

9492
test_dic = {'compare': 'Compare', 'formatnamespace': 'Format NVM',
9593
'dsm': 'Data Set Management',
@@ -98,12 +96,21 @@ def setUp(self):
9896
'writeuncorrectable': 'Write Uncorrectable',
9997
'subsystemreset': 'NVM Subsystem Reset'}
10098
for key, value in list(test_dic.items()):
99+
if key in str(self.name) and key == 'subsystemreset':
100+
cmd = "cat /sys/kernel/security/lockdown"
101+
lockdown = process.system_output(cmd, shell=True).decode("utf-8")
102+
if '[none]' not in lockdown:
103+
self.log.info("lockdown is enabled,\
104+
cannot run nvme show-regs command")
105+
continue
106+
else:
107+
cmd = "%s show-regs %s -H" % (self.binary, self.device)
108+
regs = process.system_output(cmd, shell=True).decode("utf-8")
109+
if "%s Supported (NSSRS): No" % value in regs:
110+
self.cancel("%s is not supported" % value)
101111
if key in str(self.name):
102112
if "%s Supported" % value not in self.id_ctrl:
103113
self.cancel("%s is not supported" % value)
104-
# NVM Subsystem Reset Supported (NSSRS): No
105-
if "%s Supported (NSSRS): No" % value in regs:
106-
self.cancel("%s is not supported" % value)
107114

108115
@staticmethod
109116
def run_cmd_return_output_list(cmd):

0 commit comments

Comments
 (0)