diff mbox series

[V1] framework/test_result: optmize saving result

Message ID 20210415081100.9289-1-haiyangx.zhao@intel.com (mailing list archive)
State Accepted
Headers show
Series [V1] framework/test_result: optmize saving result | expand

Commit Message

Zhao, HaiyangX April 15, 2021, 8:11 a.m. UTC
when test configuration changed during the test, saving result will be failed.
add judgement for all the configurations to improve DTS robustness.

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

Comments

Zhao, HaiyangX April 15, 2021, 8:24 a.m. UTC | #1
> -----Original Message-----
> From: Zhao, HaiyangX <haiyangx.zhao@intel.com>
> Sent: Thursday, April 15, 2021 16:11
> To: dts@dpdk.org
> Cc: Zhao, HaiyangX <haiyangx.zhao@intel.com>
> Subject: [dts][PATCH V1] framework/test_result: optmize saving result

Tested-by: Haiyang Zhao <haiyangx.zhao@intel.com>
Tu, Lijuan May 7, 2021, 6:40 a.m. UTC | #2
> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Zhao, HaiyangX
> Sent: 2021年4月15日 16:25
> To: dts@dpdk.org
> Subject: Re: [dts] [PATCH V1] framework/test_result: optmize saving result
> 
> 
> 
> > -----Original Message-----
> > From: Zhao, HaiyangX <haiyangx.zhao@intel.com>
> > Sent: Thursday, April 15, 2021 16:11
> > To: dts@dpdk.org
> > Cc: Zhao, HaiyangX <haiyangx.zhao@intel.com>
> > Subject: [dts][PATCH V1] framework/test_result: optmize saving result
> 
> Tested-by: Haiyang Zhao <haiyangx.zhao@intel.com>

Applied
diff mbox series

Patch

diff --git a/framework/test_result.py b/framework/test_result.py
index 77fe8f00..a718034d 100644
--- a/framework/test_result.py
+++ b/framework/test_result.py
@@ -103,10 +103,18 @@  class Result(object):
 
     def __set_dpdk_version(self, dpdk_version):
         if dpdk_version not in self.internals[self.__dut + 1]:
-            self.internals[self.__dut + 1].append(dpdk_version)
+            dpdk_current = self.__get_dpdk_version()
+            if dpdk_current:
+                if dpdk_version not in dpdk_current:
+                    self.internals[self.__dut + 1][4] = dpdk_current + '/' + dpdk_version
+            else:
+                self.internals[self.__dut + 1].append(dpdk_version)
 
     def __get_dpdk_version(self):
-        return self.internals[self.__dut + 1][3]
+        try:
+            return self.internals[self.__dut + 1][4]
+        except:
+            return ''
 
     def current_kdriver(self, dut):
         """
@@ -120,10 +128,18 @@  class Result(object):
 
     def __set_kdriver(self, driver):
         if not self.internals[self.__dut + 1]:
-            self.internals[self.__dut + 1].append(driver)
+            kdriver_current = self.__get_kdriver()
+            if kdriver_current:
+                if driver not in kdriver_current:
+                    self.internals[self.__dut + 1][0] = kdriver_current + '/' + driver
+            else:
+                self.internals[self.__dut + 1].append(driver)
 
     def __get_kdriver(self):
-        return self.internals[self.__dut + 1][0]
+        try:
+            return self.internals[self.__dut + 1][0]
+        except:
+            return ''
 
     def current_firmware_version(self, dut):
         """
@@ -137,10 +153,18 @@  class Result(object):
 
     def __set_firmware(self, firmware):
         if firmware not in self.internals[self.__dut + 1]:
-            self.internals[self.__dut + 1].append(firmware)
+            firmware_current = self.__get_firmware()
+            if firmware_current:
+                if firmware not in firmware_current:
+                    self.internals[self.__dut + 1][1] = firmware_current + '/' + firmware
+            else:
+                self.internals[self.__dut + 1].append(firmware)
 
     def __get_firmware(self):
-        return self.internals[self.__dut + 1][1]
+        try:
+            return self.internals[self.__dut + 1][1]
+        except:
+            return ''
 
     def current_package_version(self, dut):
         """
@@ -154,10 +178,18 @@  class Result(object):
 
     def __set_ddp_package(self, package):
         if package not in self.internals[self.__dut + 1]:
-            self.internals[self.__dut + 1].append(package)
+            pkg_current = self.__get_ddp_package()
+            if pkg_current != '':
+                if pkg_current and package not in pkg_current:
+                    self.internals[self.__dut + 1][2] = pkg_current + '/' + package
+            else:
+                self.internals[self.__dut + 1].append(package)
 
     def __get_ddp_package(self):
-        return self.internals[self.__dut + 1][2]
+        try:
+            return self.internals[self.__dut + 1][2]
+        except:
+            return ''
 
     def current_driver(self, dut):
         """