test suite reviews and discussions
 help / color / mirror / Atom feed
* [PATCH 0/7] Fix for Fedora 37
@ 2023-04-14 12:52 Akihiko Odaki
  2023-04-14 12:52 ` [PATCH 1/7] Replace Pcapy with Pcapyplus Akihiko Odaki
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Akihiko Odaki @ 2023-04-14 12:52 UTC (permalink / raw)
  Cc: dts, Akihiko Odaki

This series includes changes necessary to run tests on Fedora 37 virtual
machine.

Akihiko Odaki (7):
  Replace Pcapy with Pcapyplus
  Update numpy from 1.18.5 to 1.24.2
  framework/ssh_pexpect: Remove duplicate regex flags
  framework: Remove unused variable
  nics/system_info: Accept memory with unknown speed
  framework/packet: Fix tcpdump help parse
  tests/ip_pipeline: Use common tcpdump methods

 ci/dts_requirements.txt            |   4 +-
 doc/dts_gsg/usr_guide/sys_reqs.rst |   6 +-
 framework/dut.py                   |   1 -
 framework/packet.py                |   5 +-
 framework/ssh_pexpect.py           |   4 +-
 nics/system_info.py                |   6 +-
 requirements.txt                   |   4 +-
 tests/TestSuite_ip_pipeline.py     | 106 ++++++++---------------------
 8 files changed, 45 insertions(+), 91 deletions(-)

-- 
2.40.0


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

* [PATCH 1/7] Replace Pcapy with Pcapyplus
  2023-04-14 12:52 [PATCH 0/7] Fix for Fedora 37 Akihiko Odaki
@ 2023-04-14 12:52 ` Akihiko Odaki
  2023-04-14 12:52 ` [PATCH 2/7] Update numpy from 1.18.5 to 1.24.2 Akihiko Odaki
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Akihiko Odaki @ 2023-04-14 12:52 UTC (permalink / raw)
  Cc: dts, Akihiko Odaki

Pcapy is no longer maintained and incompatible with the latest
distutils as described at:
https://github.com/helpsystems/pcapy/issues/73

Replace it with Pcapyplus, a maintained fork.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 ci/dts_requirements.txt            | 2 +-
 doc/dts_gsg/usr_guide/sys_reqs.rst | 4 ++--
 requirements.txt                   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ci/dts_requirements.txt b/ci/dts_requirements.txt
index 4fcbcc60..0ffeb152 100644
--- a/ci/dts_requirements.txt
+++ b/ci/dts_requirements.txt
@@ -6,7 +6,7 @@ xlwt==1.3.0
 pexpect==4.7.0
 numpy==1.18.5
 docutils
-pcapy
+pcapyplus
 xlrd
 scapy==2.4.4
 threadpool
diff --git a/doc/dts_gsg/usr_guide/sys_reqs.rst b/doc/dts_gsg/usr_guide/sys_reqs.rst
index b91eef9d..e4682894 100644
--- a/doc/dts_gsg/usr_guide/sys_reqs.rst
+++ b/doc/dts_gsg/usr_guide/sys_reqs.rst
@@ -42,7 +42,7 @@ To run DTS, `Python3` must be installed, and it uses the following packages:
 * numpy: it provides method to deal with array-processing test results.
 * pexpect: it provides API to automate interactive SSH sessions.
 * docutils:it is a modular system for processing documentation into useful formats, such as HTML, XML, and LaTeX
-* pcapy: it is a Python extension module that interfaces with the libpcap packet capture library. Pcapy enables python scripts to capture packets on the network.
+* pcapyplus: it is a Python extension module that interfaces with the libpcap packet capture library. Pcapyplus enables python scripts to capture packets on the network.
 * xlrd: it is a Python module that extracts data from Excel spreadsheets.
 * threadpool: it is a Python module that maintains a pool of worker threads to perform time consuming operations in parallel.
 * scapy: it is a Python program that enables the user to send, sniff and dissect and forge network packets.
@@ -57,7 +57,7 @@ They are recorded in `requirements.txt`.
     pexpect==4.7.0
     numpy==1.18.5
     docutils
-    pcapy
+    pcapyplus
     xlrd
     scapy==2.4.4
     threadpool
diff --git a/requirements.txt b/requirements.txt
index 7f1a2f6c..9668a385 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -6,7 +6,7 @@ xlwt==1.3.0
 pexpect==4.7.0
 numpy==1.18.5
 docutils
-pcapy
+pcapyplus
 xlrd
 scapy==2.4.4
 threadpool
-- 
2.40.0


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

* [PATCH 2/7] Update numpy from 1.18.5 to 1.24.2
  2023-04-14 12:52 [PATCH 0/7] Fix for Fedora 37 Akihiko Odaki
  2023-04-14 12:52 ` [PATCH 1/7] Replace Pcapy with Pcapyplus Akihiko Odaki
@ 2023-04-14 12:52 ` Akihiko Odaki
  2023-04-14 12:52 ` [PATCH 3/7] framework/ssh_pexpect: Remove duplicate regex flags Akihiko Odaki
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Akihiko Odaki @ 2023-04-14 12:52 UTC (permalink / raw)
  Cc: dts, Akihiko Odaki

This includes a fix for Python 3.10:
https://github.com/numpy/numpy/pull/16417

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 ci/dts_requirements.txt            | 2 +-
 doc/dts_gsg/usr_guide/sys_reqs.rst | 2 +-
 requirements.txt                   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ci/dts_requirements.txt b/ci/dts_requirements.txt
index 0ffeb152..0f665e03 100644
--- a/ci/dts_requirements.txt
+++ b/ci/dts_requirements.txt
@@ -4,7 +4,7 @@
 
 xlwt==1.3.0
 pexpect==4.7.0
-numpy==1.18.5
+numpy==1.24.2
 docutils
 pcapyplus
 xlrd
diff --git a/doc/dts_gsg/usr_guide/sys_reqs.rst b/doc/dts_gsg/usr_guide/sys_reqs.rst
index e4682894..876c3476 100644
--- a/doc/dts_gsg/usr_guide/sys_reqs.rst
+++ b/doc/dts_gsg/usr_guide/sys_reqs.rst
@@ -55,7 +55,7 @@ They are recorded in `requirements.txt`.
     ...
     xlwt==1.3.0
     pexpect==4.7.0
-    numpy==1.18.5
+    numpy==1.24.2
     docutils
     pcapyplus
     xlrd
diff --git a/requirements.txt b/requirements.txt
index 9668a385..034b717b 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -4,7 +4,7 @@
 
 xlwt==1.3.0
 pexpect==4.7.0
-numpy==1.18.5
+numpy==1.24.2
 docutils
 pcapyplus
 xlrd
-- 
2.40.0


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

* [PATCH 3/7] framework/ssh_pexpect: Remove duplicate regex flags
  2023-04-14 12:52 [PATCH 0/7] Fix for Fedora 37 Akihiko Odaki
  2023-04-14 12:52 ` [PATCH 1/7] Replace Pcapy with Pcapyplus Akihiko Odaki
  2023-04-14 12:52 ` [PATCH 2/7] Update numpy from 1.18.5 to 1.24.2 Akihiko Odaki
@ 2023-04-14 12:52 ` Akihiko Odaki
  2023-04-14 12:52 ` [PATCH 4/7] framework: Remove unused variable Akihiko Odaki
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Akihiko Odaki @ 2023-04-14 12:52 UTC (permalink / raw)
  Cc: dts, Akihiko Odaki

The regex pattern "(?i)" sets global re.I flag. Not only the duplicate
regex flags are redundant, but the flags not placed at the start of the
regex makes it incompatible with Python 3.11, according to:
https://docs.python.org/3.11/library/re.html#regular-expression-syntax

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 framework/ssh_pexpect.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/framework/ssh_pexpect.py b/framework/ssh_pexpect.py
index 97406896..2132c066 100644
--- a/framework/ssh_pexpect.py
+++ b/framework/ssh_pexpect.py
@@ -50,7 +50,7 @@ class SSHPexpect:
                             original_prompt="[$#>]",
                             port=self.port,
                             login_timeout=20,
-                            password_regex=r"(?i)(?:password:)|(?:passphrase for key)|(?i)(password for .+:)",
+                            password_regex=r"(?i)(?:password:)|(?:passphrase for key)|(password for .+:)",
                         )
                     except Exception as e:
                         print(e)
@@ -68,7 +68,7 @@ class SSHPexpect:
                     self.username,
                     self.password,
                     original_prompt="[$#>]",
-                    password_regex=r"(?i)(?:password:)|(?:passphrase for key)|(?i)(password for .+:)",
+                    password_regex=r"(?i)(?:password:)|(?:passphrase for key)|(password for .+:)",
                 )
             self.send_expect("stty -echo", "#")
             self.send_expect("stty columns 1000", "#")
-- 
2.40.0


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

* [PATCH 4/7] framework: Remove unused variable
  2023-04-14 12:52 [PATCH 0/7] Fix for Fedora 37 Akihiko Odaki
                   ` (2 preceding siblings ...)
  2023-04-14 12:52 ` [PATCH 3/7] framework/ssh_pexpect: Remove duplicate regex flags Akihiko Odaki
@ 2023-04-14 12:52 ` Akihiko Odaki
  2023-04-14 12:52 ` [PATCH 5/7] nics/system_info: Accept memory with unknown speed Akihiko Odaki
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Akihiko Odaki @ 2023-04-14 12:52 UTC (permalink / raw)
  Cc: dts, Akihiko Odaki

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 framework/dut.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/framework/dut.py b/framework/dut.py
index 481c0cb6..87dda906 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -825,7 +825,6 @@ class Dut(Crb):
         """
         Check that whether auto scanned ports ready to use
         """
-        pci_addr = "%s:%s" % (pci_bus, pci_id)
         if self.nic_type == "any":
             return True
         elif self.nic_type == "cfg":
-- 
2.40.0


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

* [PATCH 5/7] nics/system_info: Accept memory with unknown speed
  2023-04-14 12:52 [PATCH 0/7] Fix for Fedora 37 Akihiko Odaki
                   ` (3 preceding siblings ...)
  2023-04-14 12:52 ` [PATCH 4/7] framework: Remove unused variable Akihiko Odaki
@ 2023-04-14 12:52 ` Akihiko Odaki
  2023-04-14 12:52 ` [PATCH 6/7] framework/packet: Fix tcpdump help parse Akihiko Odaki
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Akihiko Odaki @ 2023-04-14 12:52 UTC (permalink / raw)
  Cc: dts, Akihiko Odaki

A virtual machine may only have memories with unknown speed. Rejecting
memories with unknown speed cause an exception in such a case because
_strip_memory() expects there is one valid memory at least.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 nics/system_info.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/nics/system_info.py b/nics/system_info.py
index 3e80d4bd..c841a505 100644
--- a/nics/system_info.py
+++ b/nics/system_info.py
@@ -57,7 +57,7 @@ class SystemInfo(object):
         speed_regex = r"(\s+)Speed: (.*)"
         size = ""
         locate = ""
-        speed = "Unknown"
+        speed = None
         memory_infos = []
         memory_channel = set()
         lines = memories.split("\r\n")
@@ -75,10 +75,10 @@ class SystemInfo(object):
             s_m = re.match(speed_regex, line)
             if s_m:
                 speed = s_m.group(2)
-            if speed != "Unknown":
+            if speed is not None:
                 memory = {"Size": size, "Locate": locate, "Speed": speed}
                 memory_infos.append(memory)
-                speed = "Unknown"
+                speed = None
                 total_size += int(size)
                 memory_channel.add(locate[0])
 
-- 
2.40.0


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

* [PATCH 6/7] framework/packet: Fix tcpdump help parse
  2023-04-14 12:52 [PATCH 0/7] Fix for Fedora 37 Akihiko Odaki
                   ` (4 preceding siblings ...)
  2023-04-14 12:52 ` [PATCH 5/7] nics/system_info: Accept memory with unknown speed Akihiko Odaki
@ 2023-04-14 12:52 ` Akihiko Odaki
  2023-04-14 12:52 ` [PATCH 7/7] tests/ip_pipeline: Use common tcpdump methods Akihiko Odaki
  2023-05-06  7:27 ` [PATCH 0/7] Fix for Fedora 37 Akihiko Odaki
  7 siblings, 0 replies; 10+ messages in thread
From: Akihiko Odaki @ 2023-04-14 12:52 UTC (permalink / raw)
  Cc: dts, Akihiko Odaki

tcpdump version 4.99.3 puts several options in one line as follows:
> $ tcpdump --help
> tcpdump version 4.99.3
> libpcap version 1.10.3 (with TPACKET_V3)
> OpenSSL 3.0.5 5 Jul 2022
> Usage: tcpdump [-AbdDefhHIJKlLnNOpqStuUvxX#] [ -B size ] [ -c count ] [--count]
>		[ -C file_size ] [ -E algo:secret ] [ -F file ] [ -G seconds ]
> 		[ -i interface ] [ --immediate-mode ] [ -j tstamptype ]
> 		[ -M secret ] [ --number ] [ --print ] [ -Q in|out|inout ]
> 		[ -r file ] [ -s snaplen ] [ -T type ] [ --version ]
> 		[ -V file ] [ -w file ] [ -W filecount ] [ -y datalinktype ]
> 		[ --time-stamp-precision precision ] [ --micro ] [ --nano ]
> 		[ -z postrotate-command ] [ -Z user ] [ expression ]

This change allows to match a substring representing an option.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 framework/packet.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/framework/packet.py b/framework/packet.py
index f56bf178..9603ec7b 100644
--- a/framework/packet.py
+++ b/framework/packet.py
@@ -1099,7 +1099,7 @@ def start_tcpdump(crb, intf, count=0, filters=None, lldp_forbid=True):
     tcpdump_help = tcpdump_session.send_command("tcpdump -h")
 
     for line in tcpdump_help.split("\n"):
-        m = re.match(direct_param, line)
+        m = re.search(direct_param, line)
         if m:
             opt = re.search("-Q", m.group(2))
             if opt:
-- 
2.40.0


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

* [PATCH 7/7] tests/ip_pipeline: Use common tcpdump methods
  2023-04-14 12:52 [PATCH 0/7] Fix for Fedora 37 Akihiko Odaki
                   ` (5 preceding siblings ...)
  2023-04-14 12:52 ` [PATCH 6/7] framework/packet: Fix tcpdump help parse Akihiko Odaki
@ 2023-04-14 12:52 ` Akihiko Odaki
  2023-05-25  2:52   ` lijuan.tu
  2023-05-06  7:27 ` [PATCH 0/7] Fix for Fedora 37 Akihiko Odaki
  7 siblings, 1 reply; 10+ messages in thread
From: Akihiko Odaki @ 2023-04-14 12:52 UTC (permalink / raw)
  Cc: dts, Akihiko Odaki

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 framework/packet.py            |   3 +
 tests/TestSuite_ip_pipeline.py | 106 +++++++++------------------------
 2 files changed, 32 insertions(+), 77 deletions(-)

diff --git a/framework/packet.py b/framework/packet.py
index 9603ec7b..a53cef34 100644
--- a/framework/packet.py
+++ b/framework/packet.py
@@ -1063,6 +1063,9 @@ def get_filter_cmd(filters=[]):
             elif list(pktfilter["config"].keys())[0] == "dstport":
                 dport = pktfilter["config"]["dstport"]
                 filter_cmd = "dst port %s" % dport
+            elif list(pktfilter["config"].keys())[0] == "dsthost":
+                dport = pktfilter["config"]["dsthost"]
+                filter_cmd = "dst host %s" % dport
         elif pktfilter["layer"] == "userdefined":
             if list(pktfilter["config"].keys())[0] == "pcap-filter":
                 filter_cmd = pktfilter["config"]["pcap-filter"]
diff --git a/tests/TestSuite_ip_pipeline.py b/tests/TestSuite_ip_pipeline.py
index 043516dd..c28622cd 100644
--- a/tests/TestSuite_ip_pipeline.py
+++ b/tests/TestSuite_ip_pipeline.py
@@ -2,7 +2,6 @@
 # Copyright(c) 2010-2018 Intel Corporation
 #
 
-import re
 import time
 from time import sleep
 
@@ -17,48 +16,6 @@ from framework.test_case import TestCase, skip_unsupported_host_driver
 
 
 class TestIPPipeline(TestCase):
-    def get_flow_direction_param_of_tcpdump(self):
-        """
-        get flow dirction param depend on tcpdump version
-        """
-        param = ""
-        direct_param = r"(\s+)\[ (\S+) in\|out\|inout \]"
-        out = self.tester.send_expect("tcpdump -h", "# ")
-        for line in out.split("\n"):
-            m = re.match(direct_param, line)
-            if m:
-                opt = re.search("-Q", m.group(2))
-                if opt:
-                    param = "-Q" + " in"
-                else:
-                    opt = re.search("-P", m.group(2))
-                    if opt:
-                        param = "-P" + " in"
-        if len(param) == 0:
-            self.logger.info("tcpdump not support direction choice!!!")
-        return param
-
-    def tcpdump_start_sniff(self, interface, filters=""):
-        """
-        Starts tcpdump in the background to sniff packets that received by interface.
-        """
-        command = "rm -f /tmp/tcpdump_{0}.pcap".format(interface)
-        self.tester.send_expect(command, "#")
-        command = "tcpdump -n -e {0} -w /tmp/tcpdump_{1}.pcap -i {1} {2} 2>/tmp/tcpdump_{1}.out &".format(
-            self.param_flow_dir, interface, filters
-        )
-        self.tester.send_expect(command, "# ")
-
-    def tcpdump_stop_sniff(self):
-        """
-        Stops the tcpdump process running in the background.
-        """
-        self.tester.send_expect("killall tcpdump", "# ")
-        # For the [pid]+ Done tcpdump... message after killing the process
-        sleep(1)
-        self.tester.send_expect('echo "Cleaning buffer"', "# ")
-        sleep(1)
-
     def write_pcap_file(self, pcap_file, pkts):
         try:
             wrpcap(pcap_file, pkts)
@@ -74,7 +31,7 @@ class TestIPPipeline(TestCase):
 
         return pcap_pkts
 
-    def send_and_sniff_pkts(self, from_port, to_port, pcap_file, filters="", count=1):
+    def send_and_sniff_pkts(self, from_port, to_port, pcap_file, filters=[], count=1):
         """
         Sent pkts that read from the pcap_file.
         Return the sniff pkts.
@@ -85,7 +42,7 @@ class TestIPPipeline(TestCase):
         tx_interface = self.tester.get_interface(tx_port)
         rx_interface = self.tester.get_interface(rx_port)
 
-        self.tcpdump_start_sniff(rx_interface, filters)
+        inst = self.tester.tcpdump_sniff_packets(rx_interface, filters=filters)
 
         # check that the link status of the port sending the packet is up
         self.tester.is_interface_up(tx_interface)
@@ -100,9 +57,7 @@ class TestIPPipeline(TestCase):
         )
         self.tester.scapy_execute()
 
-        self.tcpdump_stop_sniff()
-
-        return self.read_pcap_file("/tmp/tcpdump_%s.pcap" % rx_interface)
+        return self.tester.load_tcpdump_sniff_packets(inst).pktgen.pkts
 
     def setup_env(self, port_nums, driver):
         """
@@ -217,7 +172,6 @@ class TestIPPipeline(TestCase):
         self.verify("Error" not in out, "Compilation error")
         self.app_ip_pipline_path = self.dut.apps_name["ip_pipeline"]
         self.app_testpmd_path = self.dut.apps_name["test-pmd"]
-        self.param_flow_dir = self.get_flow_direction_param_of_tcpdump()
 
     def set_up(self):
         """
@@ -261,7 +215,7 @@ class TestIPPipeline(TestCase):
         pcap_file = "/tmp/route_0.pcap"
         pkt = [Ether(dst=self.dut_p0_mac) / IP(dst="100.0.0.1") / Raw(load="X" * 26)]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "dst host 100.0.0.1"
+        filters = [{"layer": "network", "config": {"dsthost": "100.0.0.1"}}]
         sniff_pkts = self.send_and_sniff_pkts(0, 0, pcap_file, filters)
         dst_mac_list = []
         for packet in sniff_pkts:
@@ -272,7 +226,7 @@ class TestIPPipeline(TestCase):
         pcap_file = "/tmp/route_1.pcap"
         pkt = [Ether(dst=self.dut_p0_mac) / IP(dst="100.64.0.1") / Raw(load="X" * 26)]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "dst host 100.64.0.1"
+        filters = [{"layer": "network", "config": {"dsthost": "100.64.0.1"}}]
         sniff_pkts = self.send_and_sniff_pkts(0, 1, pcap_file, filters)
         dst_mac_list = []
         for packet in sniff_pkts:
@@ -283,7 +237,7 @@ class TestIPPipeline(TestCase):
         pcap_file = "/tmp/route_2.pcap"
         pkt = [Ether(dst=self.dut_p0_mac) / IP(dst="100.128.0.1") / Raw(load="X" * 26)]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "dst host 100.128.0.1"
+        filters = [{"layer": "network", "config": {"dsthost": "100.128.0.1"}}]
         sniff_pkts = self.send_and_sniff_pkts(0, 2, pcap_file, filters)
         dst_mac_list = []
         for packet in sniff_pkts:
@@ -294,7 +248,7 @@ class TestIPPipeline(TestCase):
         pcap_file = "/tmp/route_3.pcap"
         pkt = [Ether(dst=self.dut_p0_mac) / IP(dst="100.192.0.1") / Raw(load="X" * 26)]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "dst host 100.192.0.1"
+        filters = [{"layer": "network", "config": {"dsthost": "100.192.0.1"}}]
         sniff_pkts = self.send_and_sniff_pkts(0, 3, pcap_file, filters)
         dst_mac_list = []
         for packet in sniff_pkts:
@@ -346,7 +300,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "dst host 100.0.0.1"
+        filters = [{"layer": "network", "config": {"dsthost": "100.0.0.1"}}]
         sniff_pkts = self.send_and_sniff_pkts(0, 0, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -362,7 +316,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "dst host 100.64.0.1"
+        filters = [{"layer": "network", "config": {"dsthost": "100.64.0.1"}}]
         sniff_pkts = self.send_and_sniff_pkts(0, 1, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -378,7 +332,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "dst host 100.128.0.1"
+        filters = [{"layer": "network", "config": {"dsthost": "100.128.0.1"}}]
         sniff_pkts = self.send_and_sniff_pkts(0, 2, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -394,7 +348,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "dst host 100.192.0.1"
+        filters = [{"layer": "network", "config": {"dsthost": "100.192.0.1"}}]
         sniff_pkts = self.send_and_sniff_pkts(0, 3, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -446,7 +400,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "tcp"
+        filters = [{"layer": "userdefined", "config": {"pcap-filter": "tcp"}}]
         sniff_pkts = self.send_and_sniff_pkts(0, 0, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -462,7 +416,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "tcp"
+        filters = [{"layer": "userdefined", "config": {"pcap-filter": "tcp"}}]
         sniff_pkts = self.send_and_sniff_pkts(0, 1, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -478,7 +432,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "tcp"
+        filters = [{"layer": "userdefined", "config": {"pcap-filter": "tcp"}}]
         sniff_pkts = self.send_and_sniff_pkts(0, 2, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -494,7 +448,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "tcp"
+        filters = [{"layer": "userdefined", "config": {"pcap-filter": "tcp"}}]
         sniff_pkts = self.send_and_sniff_pkts(0, 3, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -546,7 +500,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "tcp"
+        filters = [{"layer": "userdefined", "config": {"pcap-filter": "tcp"}}]
         sniff_pkts = self.send_and_sniff_pkts(0, 1, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -562,7 +516,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "tcp"
+        filters = [{"layer": "userdefined", "config": {"pcap-filter": "tcp"}}]
         sniff_pkts = self.send_and_sniff_pkts(1, 0, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -578,7 +532,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "tcp"
+        filters = [{"layer": "userdefined", "config": {"pcap-filter": "tcp"}}]
         sniff_pkts = self.send_and_sniff_pkts(2, 3, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -594,7 +548,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "tcp"
+        filters = [{"layer": "userdefined", "config": {"pcap-filter": "tcp"}}]
         sniff_pkts = self.send_and_sniff_pkts(3, 2, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -680,7 +634,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "tcp"
+        filters = [{"layer": "userdefined", "config": {"pcap-filter": "tcp"}}]
         sniff_pkts = self.send_and_sniff_pkts(0, 1, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -696,7 +650,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "tcp"
+        filters = [{"layer": "userdefined", "config": {"pcap-filter": "tcp"}}]
         sniff_pkts = self.send_and_sniff_pkts(1, 0, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -712,7 +666,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "tcp"
+        filters = [{"layer": "userdefined", "config": {"pcap-filter": "tcp"}}]
         sniff_pkts = self.send_and_sniff_pkts(2, 3, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -728,7 +682,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "tcp"
+        filters = [{"layer": "userdefined", "config": {"pcap-filter": "tcp"}}]
         sniff_pkts = self.send_and_sniff_pkts(3, 2, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -792,7 +746,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "tcp"
+        filters = [{"layer": "userdefined", "config": {"pcap-filter": "tcp"}}]
         sniff_pkts = self.send_and_sniff_pkts(0, 1, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -808,7 +762,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "tcp"
+        filters = [{"layer": "userdefined", "config": {"pcap-filter": "tcp"}}]
         sniff_pkts = self.send_and_sniff_pkts(1, 0, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -824,7 +778,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "tcp"
+        filters = [{"layer": "userdefined", "config": {"pcap-filter": "tcp"}}]
         sniff_pkts = self.send_and_sniff_pkts(2, 3, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -840,7 +794,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "tcp"
+        filters = [{"layer": "userdefined", "config": {"pcap-filter": "tcp"}}]
         sniff_pkts = self.send_and_sniff_pkts(3, 2, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -893,7 +847,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "tcp"
+        filters = [{"layer": "userdefined", "config": {"pcap-filter": "tcp"}}]
         sniff_pkts = self.send_and_sniff_pkts(0, 1, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -909,7 +863,7 @@ class TestIPPipeline(TestCase):
             / Raw(load="X" * 6)
         ]
         self.write_pcap_file(pcap_file, pkt)
-        filters = "tcp"
+        filters = [{"layer": "userdefined", "config": {"pcap-filter": "tcp"}}]
         sniff_pkts = self.send_and_sniff_pkts(1, 0, pcap_file, filters)
         dst_ip_list = []
         for packet in sniff_pkts:
@@ -1041,8 +995,6 @@ class TestIPPipeline(TestCase):
         """
         Run after each test case.
         """
-        # kill all tcpdump
-        self.tcpdump_stop_sniff()
         # close app
         self.dut.send_expect("^C", "# ")
         self.dut.kill_all()
-- 
2.40.0


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

* Re: [PATCH 0/7] Fix for Fedora 37
  2023-04-14 12:52 [PATCH 0/7] Fix for Fedora 37 Akihiko Odaki
                   ` (6 preceding siblings ...)
  2023-04-14 12:52 ` [PATCH 7/7] tests/ip_pipeline: Use common tcpdump methods Akihiko Odaki
@ 2023-05-06  7:27 ` Akihiko Odaki
  7 siblings, 0 replies; 10+ messages in thread
From: Akihiko Odaki @ 2023-05-06  7:27 UTC (permalink / raw)
  To: dts

On 2023/04/14 21:52, Akihiko Odaki wrote:
> This series includes changes necessary to run tests on Fedora 37 virtual
> machine.
> 
> Akihiko Odaki (7):
>    Replace Pcapy with Pcapyplus
>    Update numpy from 1.18.5 to 1.24.2
>    framework/ssh_pexpect: Remove duplicate regex flags
>    framework: Remove unused variable
>    nics/system_info: Accept memory with unknown speed
>    framework/packet: Fix tcpdump help parse
>    tests/ip_pipeline: Use common tcpdump methods
> 
>   ci/dts_requirements.txt            |   4 +-
>   doc/dts_gsg/usr_guide/sys_reqs.rst |   6 +-
>   framework/dut.py                   |   1 -
>   framework/packet.py                |   5 +-
>   framework/ssh_pexpect.py           |   4 +-
>   nics/system_info.py                |   6 +-
>   requirements.txt                   |   4 +-
>   tests/TestSuite_ip_pipeline.py     | 106 ++++++++---------------------
>   8 files changed, 45 insertions(+), 91 deletions(-)
> 

Hi,

Can anyone have a look at this series?

Regards,
Akihiko Odaki

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

* [PATCH 7/7] tests/ip_pipeline: Use common tcpdump methods
  2023-04-14 12:52 ` [PATCH 7/7] tests/ip_pipeline: Use common tcpdump methods Akihiko Odaki
@ 2023-05-25  2:52   ` lijuan.tu
  0 siblings, 0 replies; 10+ messages in thread
From: lijuan.tu @ 2023-05-25  2:52 UTC (permalink / raw)
  To: , Akihiko Odaki; +Cc: dts, Akihiko Odaki

On Fri, 14 Apr 2023 21:52:55 +0900, Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>

Acked-by: Lijuan Tu <lijuan.tu@intel.com>
Series applied, thanks

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

end of thread, other threads:[~2023-05-25  2:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-14 12:52 [PATCH 0/7] Fix for Fedora 37 Akihiko Odaki
2023-04-14 12:52 ` [PATCH 1/7] Replace Pcapy with Pcapyplus Akihiko Odaki
2023-04-14 12:52 ` [PATCH 2/7] Update numpy from 1.18.5 to 1.24.2 Akihiko Odaki
2023-04-14 12:52 ` [PATCH 3/7] framework/ssh_pexpect: Remove duplicate regex flags Akihiko Odaki
2023-04-14 12:52 ` [PATCH 4/7] framework: Remove unused variable Akihiko Odaki
2023-04-14 12:52 ` [PATCH 5/7] nics/system_info: Accept memory with unknown speed Akihiko Odaki
2023-04-14 12:52 ` [PATCH 6/7] framework/packet: Fix tcpdump help parse Akihiko Odaki
2023-04-14 12:52 ` [PATCH 7/7] tests/ip_pipeline: Use common tcpdump methods Akihiko Odaki
2023-05-25  2:52   ` lijuan.tu
2023-05-06  7:27 ` [PATCH 0/7] Fix for Fedora 37 Akihiko Odaki

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).