From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3D2BFA0A0C; Thu, 15 Apr 2021 10:20:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 278391620EA; Thu, 15 Apr 2021 10:20:39 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 8F7941620E4 for ; Thu, 15 Apr 2021 10:20:37 +0200 (CEST) IronPort-SDR: giemke7Jv6+c9vugFcwFVb5PEOK+6yFKW6OucGrDB/d9gOLdxNzlze24fe3Cs1RRaLMRzW/9NH w8Alv0R/P8/A== X-IronPort-AV: E=McAfee;i="6200,9189,9954"; a="258771879" X-IronPort-AV: E=Sophos;i="5.82,223,1613462400"; d="scan'208";a="258771879" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2021 01:20:35 -0700 IronPort-SDR: KhUu9cGeK2M+2Oc7UPjtAOTCvsfSpy0Wi5bfhJanLJqU9akovBBTRcOw7Tvyas4cjWRPYZrj84 a8QOQw7u2inw== X-IronPort-AV: E=Sophos;i="5.82,223,1613462400"; d="scan'208";a="615564894" Received: from unknown (HELO localhost.localdomain) ([10.240.183.57]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2021 01:20:33 -0700 From: Haiyang Zhao To: dts@dpdk.org Cc: Haiyang Zhao Date: Thu, 15 Apr 2021 16:11:00 +0800 Message-Id: <20210415081100.9289-1-haiyangx.zhao@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V1] framework/test_result: optmize saving result X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" 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 --- 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