From 4937cf757d000a6c89dfba19bf27fb8a5412127e Mon Sep 17 00:00:00 2001 From: Narasimhan V Date: Thu, 27 Feb 2020 16:01:37 +0530 Subject: [PATCH] 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 --- tests/nvme_get_features_test.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/nvme_get_features_test.py b/tests/nvme_get_features_test.py index cfca7a8..94ed865 100644 --- a/tests/nvme_get_features_test.py +++ b/tests/nvme_get_features_test.py @@ -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) -- 2.49.0