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 A4A59A04DB; Fri, 11 Dec 2020 08:10:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 67719AC9A; Fri, 11 Dec 2020 08:10:04 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 411D037B7 for ; Fri, 11 Dec 2020 08:10:02 +0100 (CET) IronPort-SDR: B4/fwX8uj7PaiKFM3pcT3AaRq0UACvTITncQoSdoJ2TW6EkYxjNew+a00EWRkLP9f6+irLjIBe tfGo1jgx47zA== X-IronPort-AV: E=McAfee;i="6000,8403,9831"; a="171826434" X-IronPort-AV: E=Sophos;i="5.78,410,1599548400"; d="scan'208";a="171826434" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2020 23:10:01 -0800 IronPort-SDR: C/sc/DGKtN1yGJ9QefLp5XfETA6S5dIKqRC3kZiuBQHV0YrgkBY1pPjXMIU78/yx7hX5iRMr75 cElhFR7F2rPg== X-IronPort-AV: E=Sophos;i="5.78,410,1599548400"; d="scan'208";a="545099690" Received: from unknown (HELO localhost.localdomain) ([10.240.183.80]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2020 23:10:00 -0800 From: Xia Yan To: dts@dpdk.org Cc: Xia Yan Date: Fri, 11 Dec 2020 15:12:50 +0800 Message-Id: <20201211071250.26875-1-yanx.xia@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V1] framework:Fix run dts on python 3.8 SyntaxWarning 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" modify dut,logger,packet,project_dpdk,settings,tester and virt_resource under the framework to run dts python 3.8 SyntaxWarning Signed-off-by: Xia Yan --- framework/dut.py | 2 +- framework/logger.py | 2 +- framework/packet.py | 4 ++-- framework/project_dpdk.py | 4 ++-- framework/settings.py | 2 +- framework/tester.py | 2 +- framework/virt_resource.py | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/framework/dut.py b/framework/dut.py index dcf833b4..4c732ec9 100644 --- a/framework/dut.py +++ b/framework/dut.py @@ -573,7 +573,7 @@ class Dut(Crb): """ Setup Freebsd hugepages. """ - if hugepages is -1: + if hugepages == -1: hugepages = 4096 num_buffers = hugepages / 1024 diff --git a/framework/logger.py b/framework/logger.py index 4600c5fc..63e1d831 100644 --- a/framework/logger.py +++ b/framework/logger.py @@ -465,7 +465,7 @@ class LogParser(object): def __dict_log(self, lvl_name, msg): tmp = {} - if lvl_name is not '': + if lvl_name != '': tmp[lvl_name] = msg return tmp diff --git a/framework/packet.py b/framework/packet.py index 7d974db0..1c325ff2 100644 --- a/framework/packet.py +++ b/framework/packet.py @@ -209,7 +209,7 @@ class scapy(object): def strip_vlan(self, element, p_index=0): value = None - if self.pkts[p_index].haslayer('Dot1Q') is 0: + if self.pkts[p_index].haslayer('Dot1Q') == 0: return None if element == 'vlan': @@ -227,7 +227,7 @@ class scapy(object): def strip_etag(self, element, p_index=0): value = None - if self.pkts[p_index].haslayer('Dot1BR') is 0: + if self.pkts[p_index].haslayer('Dot1BR') == 0: return None if element == 'ECIDbase': diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py index 259282f4..583fcd6c 100644 --- a/framework/project_dpdk.py +++ b/framework/project_dpdk.py @@ -308,7 +308,7 @@ class DPDKdut(Dut): if 'i386' in cur_path: pkg_path = cur_path break - assert(pkg_path is not ''), "please make sure you env have the i386 pkg-config path" + assert(pkg_path != ''), "please make sure you env have the i386 pkg-config path" self.send_expect("export CFLAGS=-m32", "# ") self.send_expect("export PKG_CONFIG_LIBDIR=%s" % pkg_path, "# ") @@ -545,7 +545,7 @@ class DPDKdut(Dut): if 'i386' in cur_path: pkg_path = cur_path break - assert(pkg_path is not ''), "please make sure you env have the i386 pkg-config path" + assert(pkg_path != ''), "please make sure you env have the i386 pkg-config path" self.send_expect("export CFLAGS=-m32", "# ", alt_session=True) self.send_expect("export PKG_CONFIG_LIBDIR=%s" % pkg_path, "# ", alt_session=True) diff --git a/framework/settings.py b/framework/settings.py index 2b6a3ce3..c5edbb7a 100644 --- a/framework/settings.py +++ b/framework/settings.py @@ -385,7 +385,7 @@ def accepted_nic(pci_id): if pci_id not in list(NICS.values()): return False - if nic is 'any': + if nic == 'any': return True else: diff --git a/framework/tester.py b/framework/tester.py index b2cbdb0d..ec233b8a 100644 --- a/framework/tester.py +++ b/framework/tester.py @@ -354,7 +354,7 @@ class Tester(Crb): try: for port_info in self.ports_info: nic_type = port_info.get('type') - if nic_type is not 'trex': + if nic_type != 'trex': continue pci_bus = port_info.get('pci') port_inst = port_info.get('port') diff --git a/framework/virt_resource.py b/framework/virt_resource.py index 4356ee50..6ae2a28b 100644 --- a/framework/virt_resource.py +++ b/framework/virt_resource.py @@ -83,7 +83,7 @@ class VirtResource(object): def __port_on_socket(self, pci, socket): for port in self.ports_info: if port['pci'] == pci: - if socket is -1: + if socket == -1: return True if port['numa'] == socket: @@ -118,7 +118,7 @@ class VirtResource(object): def __core_on_socket(self, core, socket): for dut_core in self.dut.cores: if int(dut_core['thread']) == core: - if socket is -1: + if socket == -1: return True if int(dut_core['socket']) == socket: -- 2.17.1