[V1] framework/test_result: fix saving result failed

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

Commit Message

Zhao, HaiyangX March 31, 2021, 2:21 a.m. UTC
  when execution.cfg has multiple sections and the drivername is different,
the test result of the second drivername will not be recorded, fix it
by adding judgement.

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

Comments

Zhao, HaiyangX March 31, 2021, 2:35 a.m. UTC | #1
> -----Original Message-----
> From: Zhao, HaiyangX <haiyangx.zhao@intel.com>
> Sent: Wednesday, March 31, 2021 10:22
> To: dts@dpdk.org
> Cc: Zhao, HaiyangX <haiyangx.zhao@intel.com>
> Subject: [dts][PATCH V1] framework/test_result: fix saving result failed
> 

Tested-by:  Haiyang Zhao <haiyangx.zhao@intel.com>
  
Tu, Lijuan March 31, 2021, 7 a.m. UTC | #2
> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Zhao, HaiyangX
> Sent: 2021年3月31日 10:35
> To: dts@dpdk.org
> Subject: Re: [dts] [PATCH V1] framework/test_result: fix saving result failed
> 
> 
> 
> > -----Original Message-----
> > From: Zhao, HaiyangX <haiyangx.zhao@intel.com>
> > Sent: Wednesday, March 31, 2021 10:22
> > To: dts@dpdk.org
> > Cc: Zhao, HaiyangX <haiyangx.zhao@intel.com>
> > Subject: [dts][PATCH V1] framework/test_result: fix saving result failed
> >
> 
> Tested-by:  Haiyang Zhao <haiyangx.zhao@intel.com>

Applied
  

Patch

diff --git a/framework/test_result.py b/framework/test_result.py
index 6dd94451..77fe8f00 100644
--- a/framework/test_result.py
+++ b/framework/test_result.py
@@ -169,12 +169,20 @@  class Result(object):
         except:
             return ''
 
-    def __set_driver(self, package):
-        if package not in self.internals[self.__dut + 1]:
-            self.internals[self.__dut + 1].append(package)
+    def __set_driver(self, driver):
+        if driver not in self.internals[self.__dut + 1]:
+            driver_current = self.__get_driver()
+            if driver_current:
+                if driver not in driver_current:
+                    self.internals[self.__dut + 1][3] = driver_current + '/' + driver
+            else:
+                self.internals[self.__dut + 1].append(driver)
 
     def __get_driver(self):
-        return self.internals[self.__dut + 1][3]
+        try:
+            return self.internals[self.__dut + 1][3]
+        except:
+            return ''
 
     def __current_targets(self):
         return self.internals[self.__dut + 1]