test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [V1 0/5] fix pylama errors
@ 2022-03-11  2:00 Jun Dong
  2022-03-11  2:00 ` [dts] [V1 1/5] framework/ixia_network/ixnet: " Jun Dong
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Jun Dong @ 2022-03-11  2:00 UTC (permalink / raw)
  To: dts, ohilyard; +Cc: lijuan.tu, qingx.sun, junx.dong

After first round pylama checking, there are some pylama check errors 
in framework and some CI used test cases. so fixed those errors.

Jun Dong (5):
  framework/ixia_network/ixnet: fix pylama errors
  framework/pktgen_ixia_network: fix pylama errors
  framework/tester: fix pylama errors
  tests/TestSuite_mtu_update: fix pylama errors
  tests/TestSuite_stats_checks: fix pylama errors

 framework/ixia_network/ixnet.py  |  1 +
 framework/pktgen_ixia_network.py |  2 +-
 framework/tester.py              |  2 +-
 tests/TestSuite_mtu_update.py    | 18 ------------------
 tests/TestSuite_stats_checks.py  | 22 ----------------------
 5 files changed, 3 insertions(+), 42 deletions(-)

-- 
2.25.1


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

* [dts] [V1 1/5] framework/ixia_network/ixnet: fix pylama errors
  2022-03-11  2:00 [dts] [V1 0/5] fix pylama errors Jun Dong
@ 2022-03-11  2:00 ` Jun Dong
  2022-03-11  2:00 ` [dts] [V1 2/5] framework/pktgen_ixia_network: " Jun Dong
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Jun Dong @ 2022-03-11  2:00 UTC (permalink / raw)
  To: dts, ohilyard; +Cc: lijuan.tu, qingx.sun, junx.dong

Pylama found the following errors:
framework/ixia_network/ixnet.py:703: [E] E1101 Instance of 'IxnetTrafficGenerator' has no 'OUTPUT_DIR' member [pylint]

Signed-off-by: Jun Dong <junx.dong@intel.com>
---
 framework/ixia_network/ixnet.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/framework/ixia_network/ixnet.py b/framework/ixia_network/ixnet.py
index 479b4448..4e066216 100644
--- a/framework/ixia_network/ixnet.py
+++ b/framework/ixia_network/ixnet.py
@@ -68,6 +68,7 @@ class IxnetTrafficGenerator(object):
         # initialize ixNetwork
         self.new_blank_config()
         self.tg_vports = self.assign_ports(self.tg_ports)
+        self.OUTPUT_DIR = None
 
     def get_session_id(self, api_server):
         url = '{server}/api/v1/sessions'.format(server=api_server)
-- 
2.25.1


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

* [dts] [V1 2/5] framework/pktgen_ixia_network: fix pylama errors
  2022-03-11  2:00 [dts] [V1 0/5] fix pylama errors Jun Dong
  2022-03-11  2:00 ` [dts] [V1 1/5] framework/ixia_network/ixnet: " Jun Dong
@ 2022-03-11  2:00 ` Jun Dong
  2022-03-11  2:00 ` [dts] [V1 3/5] framework/tester: " Jun Dong
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Jun Dong @ 2022-03-11  2:00 UTC (permalink / raw)
  To: dts, ohilyard; +Cc: lijuan.tu, qingx.sun, junx.dong

Pylama found the following errors:
framework/pktgen_ixia_network.py:70: [E] E0401 Unable to import 'ixia_network' [pylint]

Signed-off-by: Jun Dong <junx.dong@intel.com>
---
 framework/pktgen_ixia_network.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/framework/pktgen_ixia_network.py b/framework/pktgen_ixia_network.py
index 3a58abe5..2049d188 100644
--- a/framework/pktgen_ixia_network.py
+++ b/framework/pktgen_ixia_network.py
@@ -67,7 +67,7 @@ class IxNetworkPacketGenerator(PacketGenerator):
 
     def _connect(self, conf):
         # initialize ixNetwork class
-        from ixia_network import IxNetwork
+        from framework.ixia_network import IxNetwork
         self._conn = IxNetwork(self.pktgen_type, conf, self.logger)
         for p in self._conn.get_ports():
             self._ports.append(p)
-- 
2.25.1


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

* [dts] [V1 3/5] framework/tester: fix pylama errors
  2022-03-11  2:00 [dts] [V1 0/5] fix pylama errors Jun Dong
  2022-03-11  2:00 ` [dts] [V1 1/5] framework/ixia_network/ixnet: " Jun Dong
  2022-03-11  2:00 ` [dts] [V1 2/5] framework/pktgen_ixia_network: " Jun Dong
@ 2022-03-11  2:00 ` Jun Dong
  2022-03-11  2:00 ` [dts] [V1 4/5] tests/TestSuite_mtu_update: " Jun Dong
  2022-03-11  2:00 ` [dts] [V1 5/5] tests/TestSuite_stats_checks: " Jun Dong
  4 siblings, 0 replies; 7+ messages in thread
From: Jun Dong @ 2022-03-11  2:00 UTC (permalink / raw)
  To: dts, ohilyard; +Cc: lijuan.tu, qingx.sun, junx.dong

Pylama found the following errors:
framework/tester.py:249: [E] E1136 Value 'self.duts' is unsubscriptable [pylint]
framework/tester.py:261: [E] E1133 Non-iterable value self.duts is used in an iterating context [pylint]

Signed-off-by: Jun Dong <junx.dong@intel.com>
---
 framework/tester.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/framework/tester.py b/framework/tester.py
index ff3ecb61..8380ccf8 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -85,7 +85,7 @@ class Tester(Crb):
         check_crb_python_version(self)
 
         self.bgProcIsRunning = False
-        self.duts = None
+        self.duts = []
         self.inBg = 0
         self.scapyCmds = []
         self.bgCmds = []
-- 
2.25.1


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

* [dts] [V1 4/5] tests/TestSuite_mtu_update: fix pylama errors
  2022-03-11  2:00 [dts] [V1 0/5] fix pylama errors Jun Dong
                   ` (2 preceding siblings ...)
  2022-03-11  2:00 ` [dts] [V1 3/5] framework/tester: " Jun Dong
@ 2022-03-11  2:00 ` Jun Dong
  2022-03-11  2:00 ` [dts] [V1 5/5] tests/TestSuite_stats_checks: " Jun Dong
  4 siblings, 0 replies; 7+ messages in thread
From: Jun Dong @ 2022-03-11  2:00 UTC (permalink / raw)
  To: dts, ohilyard; +Cc: lijuan.tu, qingx.sun, junx.dong

Pylama found the following errors:
tests/TestSuite_mtu_update.py:178: [E] E0102 method already defined line 68 [pylint]
tests/TestSuite_mtu_update.py:184: [E] E0102 method already defined line 74 [pylint]

Signed-off-by: Jun Dong <junx.dong@intel.com>
---
 tests/TestSuite_mtu_update.py | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/tests/TestSuite_mtu_update.py b/tests/TestSuite_mtu_update.py
index a3cad5c7..e6062202 100644
--- a/tests/TestSuite_mtu_update.py
+++ b/tests/TestSuite_mtu_update.py
@@ -175,19 +175,6 @@ class TestMtuUpdate(TestCase):
         """
         self.dut.kill_all()
 
-    def tear_down(self):
-        """
-        Run after each test case.
-        """
-        self.dut.kill_all()
-
-    def tear_down_all(self):
-        """
-        When the case of this test suite finished, the environment should
-        clear up.
-        """
-        self.dut.kill_all()
-
     def admin_tester_port(self, local_port, status):
         """
         Do some operations to the network interface port, such as "up" or "down".
@@ -211,11 +198,6 @@ class TestMtuUpdate(TestCase):
         """
         self.admin_tester_port(self.tester.get_local_port(self.tx_port), f"mtu {mtu:d}")
         self.admin_tester_port(self.tester.get_local_port(self.rx_port), f"mtu {mtu:d}")
-    #
-    #
-    #
-    # Test cases.
-    #
 
     def helper_test_mut_checks(self, packet_size):
         """
-- 
2.25.1


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

* [dts] [V1 5/5] tests/TestSuite_stats_checks: fix pylama errors
  2022-03-11  2:00 [dts] [V1 0/5] fix pylama errors Jun Dong
                   ` (3 preceding siblings ...)
  2022-03-11  2:00 ` [dts] [V1 4/5] tests/TestSuite_mtu_update: " Jun Dong
@ 2022-03-11  2:00 ` Jun Dong
  2022-03-11  5:14   ` Tu, Lijuan
  4 siblings, 1 reply; 7+ messages in thread
From: Jun Dong @ 2022-03-11  2:00 UTC (permalink / raw)
  To: dts, ohilyard; +Cc: lijuan.tu, qingx.sun, junx.dong

Pylama found the following errors:
tests/TestSuite_stats_checks.py:265: [E] E0102 method already defined line 65 [pylint]
tests/TestSuite_stats_checks.py:271: [E] E0102 method already defined line 71 [pylint]

Signed-off-by: Jun Dong <junx.dong@intel.com>
---
 tests/TestSuite_stats_checks.py | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/tests/TestSuite_stats_checks.py b/tests/TestSuite_stats_checks.py
index ab120010..e72a67ab 100644
--- a/tests/TestSuite_stats_checks.py
+++ b/tests/TestSuite_stats_checks.py
@@ -48,7 +48,6 @@ from framework.test_case import TestCase
 
 ETHER_HEADER_LEN = 18
 IP_HEADER_LEN = 20
-ETHER_STANDARD_MTU = 1518
 RANDOM_IP_POOL = ['192.168.10.222/0']
 prefix_list = ['rx_good_packets', 'tx_good_packets', 'rx_good_bytes', 'tx_good_bytes']
 
@@ -62,21 +61,6 @@ class TestStatsChecks(TestCase):
     # of TestCase. This was done because the current test system doesn't support
     # inheritance.
     #
-    def tear_down(self):
-        """
-        Run after each test case.
-        """
-        self.dut.kill_all()
-
-    def tear_down_all(self):
-        """
-        When the case of this test suite finished, the environment should
-        clear up.
-        """
-        self.tester.send_expect(f"ifconfig {self.tester.get_interface(self.tester.get_local_port(self.rx_port))} " +
-                                f"mtu {ETHER_STANDARD_MTU}", "# ")
-        super().tear_down_all()
-
     def exec(self, command: str) -> str:
         """
         An abstraction to remove repeated code throughout the subclasses of this class
@@ -275,12 +259,6 @@ class TestStatsChecks(TestCase):
         """
         self.dut.kill_all()
 
-    #
-    #
-    #
-    # Test cases.
-    #
-
     def test_stats_checks(self):
         self.pmdout.start_testpmd("Default")
         self.exec("port start all")
-- 
2.25.1


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

* RE: [dts] [V1 5/5] tests/TestSuite_stats_checks: fix pylama errors
  2022-03-11  2:00 ` [dts] [V1 5/5] tests/TestSuite_stats_checks: " Jun Dong
@ 2022-03-11  5:14   ` Tu, Lijuan
  0 siblings, 0 replies; 7+ messages in thread
From: Tu, Lijuan @ 2022-03-11  5:14 UTC (permalink / raw)
  To: Dong, JunX, dts, ohilyard; +Cc: Sun, QingX

> -----Original Message-----
> From: Dong, JunX <junx.dong@intel.com>
> Sent: 2022年3月11日 10:00
> To: dts@dpdk.org; ohilyard@iol.unh.edu
> Cc: Tu, Lijuan <lijuan.tu@intel.com>; Sun, QingX <qingx.sun@intel.com>; Dong,
> JunX <junx.dong@intel.com>
> Subject: [dts] [V1 5/5] tests/TestSuite_stats_checks: fix pylama errors
> 
> Pylama found the following errors:
> tests/TestSuite_stats_checks.py:265: [E] E0102 method already defined line 65
> [pylint]
> tests/TestSuite_stats_checks.py:271: [E] E0102 method already defined line 71
> [pylint]
> 
> Signed-off-by: Jun Dong <junx.dong@intel.com>

Series applied.

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

end of thread, other threads:[~2022-03-11  5:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-11  2:00 [dts] [V1 0/5] fix pylama errors Jun Dong
2022-03-11  2:00 ` [dts] [V1 1/5] framework/ixia_network/ixnet: " Jun Dong
2022-03-11  2:00 ` [dts] [V1 2/5] framework/pktgen_ixia_network: " Jun Dong
2022-03-11  2:00 ` [dts] [V1 3/5] framework/tester: " Jun Dong
2022-03-11  2:00 ` [dts] [V1 4/5] tests/TestSuite_mtu_update: " Jun Dong
2022-03-11  2:00 ` [dts] [V1 5/5] tests/TestSuite_stats_checks: " Jun Dong
2022-03-11  5:14   ` Tu, Lijuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).