[V1] framework/test_result: fix saving result failed
Commit Message
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
> -----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>
> -----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
@@ -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]