test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] framework:Fix run dts on python 3.8 SyntaxWarning
@ 2020-12-11  7:12 Xia Yan
  2020-12-11  7:31 ` Zhou, JunX W
  2020-12-15  7:13 ` Tu, Lijuan
  0 siblings, 2 replies; 3+ messages in thread
From: Xia Yan @ 2020-12-11  7:12 UTC (permalink / raw)
  To: dts; +Cc: Xia Yan

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 <yanx.xia@intel.com>
---
 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dts] [PATCH V1] framework:Fix run dts on python 3.8 SyntaxWarning
  2020-12-11  7:12 [dts] [PATCH V1] framework:Fix run dts on python 3.8 SyntaxWarning Xia Yan
@ 2020-12-11  7:31 ` Zhou, JunX W
  2020-12-15  7:13 ` Tu, Lijuan
  1 sibling, 0 replies; 3+ messages in thread
From: Zhou, JunX W @ 2020-12-11  7:31 UTC (permalink / raw)
  To: Xia, YanX, dts; +Cc: Xia, YanX

[-- Attachment #1: Type: text/plain, Size: 5167 bytes --]

Tested-by: Zhou, Jun <junx.w.zhou@intel.com>

-----Original Message-----
From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Xia Yan
Sent: Friday, December 11, 2020 3:13 PM
To: dts@dpdk.org
Cc: Xia, YanX <yanx.xia@intel.com>
Subject: [dts] [PATCH V1] framework:Fix run dts on python 3.8 SyntaxWarning

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 <yanx.xia@intel.com>
---
 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


[-- Attachment #2: dts.log --]
[-- Type: application/octet-stream, Size: 5004 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dts] [PATCH V1] framework:Fix run dts on python 3.8 SyntaxWarning
  2020-12-11  7:12 [dts] [PATCH V1] framework:Fix run dts on python 3.8 SyntaxWarning Xia Yan
  2020-12-11  7:31 ` Zhou, JunX W
@ 2020-12-15  7:13 ` Tu, Lijuan
  1 sibling, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2020-12-15  7:13 UTC (permalink / raw)
  To: Xia, YanX, dts; +Cc: Xia, YanX

> 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 <yanx.xia@intel.com>

Applied

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-15  7:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-11  7:12 [dts] [PATCH V1] framework:Fix run dts on python 3.8 SyntaxWarning Xia Yan
2020-12-11  7:31 ` Zhou, JunX W
2020-12-15  7:13 ` Tu, Lijuan

test suite reviews and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ https://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git