From: Haiyang Zhao <haiyangx.zhao@intel.com>
To: dts@dpdk.org
Cc: Haiyang Zhao <haiyangx.zhao@intel.com>
Subject: [dts] [PATCH V1] framework/test_result: optmize saving result
Date: Thu, 15 Apr 2021 16:11:00 +0800 [thread overview]
Message-ID: <20210415081100.9289-1-haiyangx.zhao@intel.com> (raw)
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(-)
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):
"""
--
2.17.1
next reply other threads:[~2021-04-15 8:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-15 8:11 Haiyang Zhao [this message]
2021-04-15 8:24 ` Zhao, HaiyangX
2021-05-07 6:40 ` 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=20210415081100.9289-1-haiyangx.zhao@intel.com \
--to=haiyangx.zhao@intel.com \
--cc=dts@dpdk.org \
/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).