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 DDB94A051A; Fri, 17 Jan 2020 09:42:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CF81B1D404; Fri, 17 Jan 2020 09:42:43 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 07BC11D37F for ; Fri, 17 Jan 2020 09:42:41 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jan 2020 00:42:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,329,1574150400"; d="scan'208";a="261845026" Received: from dpdk-moyufen06.sh.intel.com ([10.67.116.222]) by fmsmga001.fm.intel.com with ESMTP; 17 Jan 2020 00:42:40 -0800 From: yufengmx To: dts@dpdk.org, lijuan.tu@intel.com Cc: yufengmx Date: Fri, 17 Jan 2020 16:45:22 +0800 Message-Id: <20200117084522.59845-2-yufengx.mo@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200117084522.59845-1-yufengx.mo@intel.com> References: <20200117084522.59845-1-yufengx.mo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH V2 1/1] tests/l3fwd: support python3 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" support python3. Signed-off-by: yufengmx --- tests/l3fwd_base.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/l3fwd_base.py b/tests/l3fwd_base.py index 2a91cf8..132bff3 100644 --- a/tests/l3fwd_base.py +++ b/tests/l3fwd_base.py @@ -87,7 +87,7 @@ class L3fwdBase(object): return output_path def d_con(self, cmd): - _cmd = [cmd, '# ', 10] if isinstance(cmd, (str, unicode)) else cmd + _cmd = [cmd, '# ', 10] if isinstance(cmd, (str)) else cmd return self.dut.send_expect(*_cmd) def __get_ipv4_lpm_vm_config(self, lpm_config): @@ -192,7 +192,7 @@ class L3fwdBase(object): if index >= 2 * len(self.__valports): break port_id = \ - self.__valports[(index / 2) % len(self.__valports)] + self.__valports[int(index / 2) % len(self.__valports)] dmac = self.dut.get_mac_address(port_id) _layer = {'ether': {'dst': dmac, }, } _layer.update(config) @@ -230,7 +230,7 @@ class L3fwdBase(object): for index, _ in enumerate(self.__valports)] \ if len(self.__valports) > 1 else [[port(0), port(0)]] stream_ids = [] - step = len(streams) / len(self.__valports) + step = int(len(streams) / len(self.__valports)) for cnt, stream in enumerate(streams): pkt, field_config = stream index = cnt // step @@ -476,7 +476,7 @@ class L3fwdBase(object): with open(_js_file, 'w') as fp: json.dump(self.__json_results, fp, indent=4, separators=(',', ': '), - encoding="utf-8", sort_keys=True) + sort_keys=True) def __display_suite_result(self, data, mode): values = data.get('values') @@ -651,7 +651,7 @@ class L3fwdBase(object): def __parse_port_config(self, config): cores, total_threads, queue = config.split('/') - _thread = str(int(total_threads[:-1]) / int(cores[:-1])) + 'T' + _thread = str(int(int(total_threads[:-1]) / int(cores[:-1]))) + 'T' _cores = str(int(cores[:-1]) * len(self.__valports)) + 'C' # only use one socket cores_config = '/'.join(['1S', _cores, _thread]) -- 2.21.0