test suite reviews and discussions
 help / color / mirror / Atom feed
From: Haiyang Zhao <haiyangx.zhao@intel.com>
To: dts@dpdk.org
Cc: lijuan.tu@intel.com, Haiyang Zhao <haiyangx.zhao@intel.com>
Subject: [dts] [PATCH V1 3/6] framework/test_result: add driver/firmware/package
Date: Mon, 22 Mar 2021 10:46:13 +0800	[thread overview]
Message-ID: <20210322024616.14499-4-haiyangx.zhao@intel.com> (raw)
In-Reply-To: <20210322024616.14499-1-haiyangx.zhao@intel.com>

add driver/firmware/package in result and the related get method,
and also update the index of other elements.

Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>
---
 framework/test_result.py | 83 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 80 insertions(+), 3 deletions(-)

diff --git a/framework/test_result.py b/framework/test_result.py
index 35607451..6dd94451 100644
--- a/framework/test_result.py
+++ b/framework/test_result.py
@@ -46,6 +46,11 @@ class Result(object):
 
     internals = [
         'dut1', [
+            'kdriver',
+            'firmware',
+            'pkg',
+            'driver',
+            'dpdk_version',
             'target1', 'nic1', [
                 'suite1', [
                     'case1', ['PASSED', ''],
@@ -92,17 +97,85 @@ class Result(object):
         """
         try:
             dut_idx = self.__internals.index(dut)
-            return self.__internals[dut_idx + 1][0]
+            return self.__internals[dut_idx + 1][4]
         except:
             return ''
 
     def __set_dpdk_version(self, dpdk_version):
-        if not self.internals[self.__dut + 1]:
+        if dpdk_version not in self.internals[self.__dut + 1]:
             self.internals[self.__dut + 1].append(dpdk_version)
 
     def __get_dpdk_version(self):
+        return self.internals[self.__dut + 1][3]
+
+    def current_kdriver(self, dut):
+        """
+        Returns the driver version for a given DUT
+        """
+        try:
+            dut_idx = self.__internals.index(dut)
+            return self.__internals[dut_idx + 1][0]
+        except:
+            return ''
+
+    def __set_kdriver(self, driver):
+        if not self.internals[self.__dut + 1]:
+            self.internals[self.__dut + 1].append(driver)
+
+    def __get_kdriver(self):
         return self.internals[self.__dut + 1][0]
 
+    def current_firmware_version(self, dut):
+        """
+        Returns the firmware version for a given DUT
+        """
+        try:
+            dut_idx = self.__internals.index(dut)
+            return self.__internals[dut_idx + 1][1]
+        except:
+            return ''
+
+    def __set_firmware(self, firmware):
+        if firmware not in self.internals[self.__dut + 1]:
+            self.internals[self.__dut + 1].append(firmware)
+
+    def __get_firmware(self):
+        return self.internals[self.__dut + 1][1]
+
+    def current_package_version(self, dut):
+        """
+        Returns the DDP package version for a given DUT
+        """
+        try:
+            dut_idx = self.__internals.index(dut)
+            return self.__internals[dut_idx + 1][2]
+        except:
+            return ''
+
+    def __set_ddp_package(self, package):
+        if package not in self.internals[self.__dut + 1]:
+            self.internals[self.__dut + 1].append(package)
+
+    def __get_ddp_package(self):
+        return self.internals[self.__dut + 1][2]
+
+    def current_driver(self, dut):
+        """
+        Returns the DDP package version for a given DUT
+        """
+        try:
+            dut_idx = self.__internals.index(dut)
+            return self.__internals[dut_idx + 1][3]
+        except:
+            return ''
+
+    def __set_driver(self, package):
+        if package not in self.internals[self.__dut + 1]:
+            self.internals[self.__dut + 1].append(package)
+
+    def __get_driver(self):
+        return self.internals[self.__dut + 1][3]
+
     def __current_targets(self):
         return self.internals[self.__dut + 1]
 
@@ -210,7 +283,7 @@ class Result(object):
             dut_idx = self.__internals.index(dut)
         except:
             return None
-        return self.__internals[dut_idx + 1][1::3]
+        return self.__internals[dut_idx + 1][5::3]
 
     def current_nic(self, dut, target):
         """
@@ -305,6 +378,10 @@ class Result(object):
     """
     dut = property(__get_dut, __set_dut)
     dpdk_version = property(__get_dpdk_version, __set_dpdk_version)
+    kdriver = property(__get_kdriver, __set_kdriver)
+    driver = property(__get_driver, __set_driver)
+    firmware = property(__get_firmware, __set_firmware)
+    package = property(__get_ddp_package, __set_ddp_package)
     target = property(__get_target, __set_target)
     test_suite = property(__get_test_suite, __set_test_suite)
     test_case = property(__get_test_case, __set_test_case)
-- 
2.17.1


  parent reply	other threads:[~2021-03-22  2:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-22  2:46 [dts] [PATCH V1 0/6] framework: add dirver/firmware/pkg in result Haiyang Zhao
2021-03-22  2:46 ` [dts] [PATCH V1 1/6] nics/net_device: add driver/firmware Haiyang Zhao
2021-03-22  2:46 ` [dts] [PATCH V1 2/6] framework/dut: get nic driver/firmware info Haiyang Zhao
2021-03-22  2:46 ` Haiyang Zhao [this message]
2021-03-22  2:46 ` [dts] [PATCH V1 4/6] framework/dts: add more nic configurations in result Haiyang Zhao
2021-03-22  2:46 ` [dts] [PATCH V1 5/6] framework/excel_reporter: add driver/firmware/pkg Haiyang Zhao
2021-03-22  2:46 ` [dts] [PATCH V1 6/6] framework/json_reporter: " Haiyang Zhao
2021-03-22  2:58 ` [dts] [PATCH V1 0/6] framework: add dirver/firmware/pkg in result Zhao, HaiyangX
2021-03-25  5:48   ` Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210322024616.14499-4-haiyangx.zhao@intel.com \
    --to=haiyangx.zhao@intel.com \
    --cc=dts@dpdk.org \
    --cc=lijuan.tu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).