]> www.infradead.org Git - users/hch/nvme-cli.git/commitdiff
NVMe get features test fix
authorNarasimhan V <sim@linux.vnet.ibm.com>
Thu, 27 Feb 2020 10:31:37 +0000 (16:01 +0530)
committerKeith Busch <kbusch@kernel.org>
Thu, 27 Feb 2020 18:00:38 +0000 (10:00 -0800)
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 <sim@linux.vnet.ibm.com>
tests/nvme_get_features_test.py

index cfca7a8cf6c1e4210d15d48673cca129f787871f..94ed86574bf094cffe7745631708aa964e0a49da 100644 (file)
@@ -45,7 +45,7 @@ class TestNVMeGetMandatoryFeatures(TestNVMe):
         - Attributes:
               - feature_id_list : list of the mandatory features.
               - get_vector_list_cmd : vector list collection for 09h.
-              - vector_list : vector list to hold the interrupt vectors.
+              - vector_list_len : numer of the interrupt vectors.
     """
 
     def __init__(self):
@@ -60,8 +60,7 @@ class TestNVMeGetMandatoryFeatures(TestNVMe):
                                 shell=True,
                                 stdout=subprocess.PIPE,
                                 encoding='utf-8')
-        self.vector_list = []
-        self.vector_list = proc.stdout.read().strip().split(" ")
+        self.vector_list_len = len(proc.stdout.read().strip().split(" "))
 
     def __del__(self):
         """ Post Section for TestNVMeGetMandatoryFeatures
@@ -78,7 +77,7 @@ class TestNVMeGetMandatoryFeatures(TestNVMe):
                 - None
         """
         if str(feature_id) == "0x09":
-            for vector in self.vector_list:
+            for vector in range(self.vector_list_len):
                 get_feat_cmd = "nvme get-feature " + self.ctrl + \
                                " --feature-id=" + str(feature_id) + \
                                " --cdw11=" + str(vector)