From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D00DDA0527; Fri, 27 Nov 2020 03:56:59 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B1A1FCABE; Fri, 27 Nov 2020 03:56:57 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id D08C4CA6A for ; Fri, 27 Nov 2020 03:56:55 +0100 (CET) IronPort-SDR: 8cqpCUW3e6Uag9F7gvV/wdG92IzxFo4/z2KVUzndGJQqMkspR3z0mSBXiIMXk3Cjh+8JOshJ8j TIb9E8dc4qyA== X-IronPort-AV: E=McAfee;i="6000,8403,9817"; a="233947116" X-IronPort-AV: E=Sophos;i="5.78,373,1599548400"; d="scan'208";a="233947116" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Nov 2020 18:56:55 -0800 IronPort-SDR: nI4PLucjKyL7gIrL81FQ8cSsAWlEShVWce/8uHP7lOEku1f40I5BLpgQyJeLb96M6Hu8r4o6uT H3iF8Bd4RW2g== X-IronPort-AV: E=Sophos;i="5.78,373,1599548400"; d="scan'208";a="313557329" Received: from unknown (HELO localhost.localdomain) ([10.240.183.57]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Nov 2020 18:56:53 -0800 From: Haiyang Zhao To: Lijuan.Tu@intel.com, dts@dpdk.org Cc: Haiyang Zhao Date: Fri, 27 Nov 2020 10:50:28 +0800 Message-Id: <20201127025029.22276-7-haiyangx.zhao@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201127025029.22276-1-haiyangx.zhao@intel.com> References: <20201127025029.22276-1-haiyangx.zhao@intel.com> Subject: [dts] [PATCH V1 6/7] framework/test_result: add dpdk_version in Result X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 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 dpdk_version and get method in class Result, and modify all_targets as target element index changed. Signed-off-by: Haiyang Zhao --- framework/test_result.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/framework/test_result.py b/framework/test_result.py index e5a2b4e..3560745 100644 --- a/framework/test_result.py +++ b/framework/test_result.py @@ -86,6 +86,23 @@ class Result(object): def __get_dut(self): return self.__internals[self.__dut] + def current_dpdk_version(self, dut): + """ + Returns the dpdk version for a given DUT + """ + try: + dut_idx = self.__internals.index(dut) + return self.__internals[dut_idx + 1][0] + except: + return '' + + def __set_dpdk_version(self, dpdk_version): + if not self.internals[self.__dut + 1]: + self.internals[self.__dut + 1].append(dpdk_version) + + def __get_dpdk_version(self): + return self.internals[self.__dut + 1][0] + def __current_targets(self): return self.internals[self.__dut + 1] @@ -193,7 +210,7 @@ class Result(object): dut_idx = self.__internals.index(dut) except: return None - return self.__internals[dut_idx + 1][::3] + return self.__internals[dut_idx + 1][1::3] def current_nic(self, dut, target): """ @@ -287,6 +304,7 @@ class Result(object): presented interface. """ dut = property(__get_dut, __set_dut) + dpdk_version = property(__get_dpdk_version, __set_dpdk_version) 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