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 DF6C1A034F; Mon, 22 Mar 2021 03:55:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D7AD6140EBD; Mon, 22 Mar 2021 03:55:33 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 213AE4069C for ; Mon, 22 Mar 2021 03:55:31 +0100 (CET) IronPort-SDR: rDe/9lCrg0rGhk5nwKEySziMmdAsWs5pb+FKhBSeNs1EcmhRrNrXn0Ocf8e8Ec0/qzbJX2c9fG jC0AafZo2cEQ== X-IronPort-AV: E=McAfee;i="6000,8403,9930"; a="254189570" X-IronPort-AV: E=Sophos;i="5.81,266,1610438400"; d="scan'208";a="254189570" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2021 19:55:31 -0700 IronPort-SDR: F5sk56bjCu7mDmfyxkE4gHyWkHhOJL7UFme+Yms9VBQVVC3+4GsufUVjzF4DTREmN6zFvb8P62 yCb670MhcP8Q== X-IronPort-AV: E=Sophos;i="5.81,266,1610438400"; d="scan'208";a="407623015" Received: from unknown (HELO localhost.localdomain) ([10.240.183.57]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2021 19:55:29 -0700 From: Haiyang Zhao To: dts@dpdk.org Cc: lijuan.tu@intel.com, Haiyang Zhao Date: Mon, 22 Mar 2021 10:46:13 +0800 Message-Id: <20210322024616.14499-4-haiyangx.zhao@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210322024616.14499-1-haiyangx.zhao@intel.com> References: <20210322024616.14499-1-haiyangx.zhao@intel.com> Subject: [dts] [PATCH V1 3/6] framework/test_result: add driver/firmware/package 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" add driver/firmware/package in result and the related get method, and also update the index of other elements. Signed-off-by: Haiyang Zhao --- framework/test_result.py | 83 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 80 insertions(+), 3 deletions(-) diff --git a/framework/test_result.py b/framework/test_result.py index 35607451..6dd94451 100644 --- a/framework/test_result.py +++ b/framework/test_result.py @@ -46,6 +46,11 @@ class Result(object): internals = [ 'dut1', [ + 'kdriver', + 'firmware', + 'pkg', + 'driver', + 'dpdk_version', 'target1', 'nic1', [ 'suite1', [ 'case1', ['PASSED', ''], @@ -92,17 +97,85 @@ class Result(object): """ try: dut_idx = self.__internals.index(dut) - return self.__internals[dut_idx + 1][0] + return self.__internals[dut_idx + 1][4] except: return '' def __set_dpdk_version(self, dpdk_version): - if not self.internals[self.__dut + 1]: + if dpdk_version not in self.internals[self.__dut + 1]: self.internals[self.__dut + 1].append(dpdk_version) def __get_dpdk_version(self): + return self.internals[self.__dut + 1][3] + + def current_kdriver(self, dut): + """ + Returns the driver version for a given DUT + """ + try: + dut_idx = self.__internals.index(dut) + return self.__internals[dut_idx + 1][0] + except: + return '' + + def __set_kdriver(self, driver): + if not self.internals[self.__dut + 1]: + self.internals[self.__dut + 1].append(driver) + + def __get_kdriver(self): return self.internals[self.__dut + 1][0] + def current_firmware_version(self, dut): + """ + Returns the firmware version for a given DUT + """ + try: + dut_idx = self.__internals.index(dut) + return self.__internals[dut_idx + 1][1] + except: + return '' + + def __set_firmware(self, firmware): + if firmware not in self.internals[self.__dut + 1]: + self.internals[self.__dut + 1].append(firmware) + + def __get_firmware(self): + return self.internals[self.__dut + 1][1] + + def current_package_version(self, dut): + """ + Returns the DDP package version for a given DUT + """ + try: + dut_idx = self.__internals.index(dut) + return self.__internals[dut_idx + 1][2] + except: + return '' + + def __set_ddp_package(self, package): + if package not in self.internals[self.__dut + 1]: + self.internals[self.__dut + 1].append(package) + + def __get_ddp_package(self): + return self.internals[self.__dut + 1][2] + + def current_driver(self, dut): + """ + Returns the DDP package version for a given DUT + """ + try: + dut_idx = self.__internals.index(dut) + return self.__internals[dut_idx + 1][3] + except: + return '' + + def __set_driver(self, package): + if package not in self.internals[self.__dut + 1]: + self.internals[self.__dut + 1].append(package) + + def __get_driver(self): + return self.internals[self.__dut + 1][3] + def __current_targets(self): return self.internals[self.__dut + 1] @@ -210,7 +283,7 @@ class Result(object): dut_idx = self.__internals.index(dut) except: return None - return self.__internals[dut_idx + 1][1::3] + return self.__internals[dut_idx + 1][5::3] def current_nic(self, dut, target): """ @@ -305,6 +378,10 @@ class Result(object): """ dut = property(__get_dut, __set_dut) dpdk_version = property(__get_dpdk_version, __set_dpdk_version) + kdriver = property(__get_kdriver, __set_kdriver) + driver = property(__get_driver, __set_driver) + firmware = property(__get_firmware, __set_firmware) + package = property(__get_ddp_package, __set_ddp_package) target = property(__get_target, __set_target) test_suite = property(__get_test_suite, __set_test_suite) test_case = property(__get_test_case, __set_test_case) -- 2.17.1