Skip to content

Commit 4937cf7

Browse files
narasimhan-vkeithbusch
authored andcommitted
NVMe get features test fix
For One of the mandatory feature "Interrupt Vector Configuration", the parameter cdw11 value should be equal to or less than the number of interrupt vectors. Current implementaion uses the IRQ number instead. This commit fixes it. Signed-off-by: Narasimhan V <[email protected]>
1 parent d882eea commit 4937cf7

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

tests/nvme_get_features_test.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class TestNVMeGetMandatoryFeatures(TestNVMe):
4545
- Attributes:
4646
- feature_id_list : list of the mandatory features.
4747
- get_vector_list_cmd : vector list collection for 09h.
48-
- vector_list : vector list to hold the interrupt vectors.
48+
- vector_list_len : numer of the interrupt vectors.
4949
"""
5050

5151
def __init__(self):
@@ -60,8 +60,7 @@ def __init__(self):
6060
shell=True,
6161
stdout=subprocess.PIPE,
6262
encoding='utf-8')
63-
self.vector_list = []
64-
self.vector_list = proc.stdout.read().strip().split(" ")
63+
self.vector_list_len = len(proc.stdout.read().strip().split(" "))
6564

6665
def __del__(self):
6766
""" Post Section for TestNVMeGetMandatoryFeatures
@@ -78,7 +77,7 @@ def get_mandatory_features(self, feature_id):
7877
- None
7978
"""
8079
if str(feature_id) == "0x09":
81-
for vector in self.vector_list:
80+
for vector in range(self.vector_list_len):
8281
get_feat_cmd = "nvme get-feature " + self.ctrl + \
8382
" --feature-id=" + str(feature_id) + \
8483
" --cdw11=" + str(vector)

0 commit comments

Comments
 (0)