test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yogesh Jangra <yogesh.jangra@intel.com>
To: dts@dpdk.org
Cc: venkata.suresh.kumar.p@intel.com, churchill.khangar@intel.com,
	yogesh.jangra@intel.com
Subject: [dts] [PATCH 2/2] tests/pipeline: add variable bit and learner table test suite
Date: Mon, 27 Sep 2021 21:53:03 -0400
Message-ID: <1632793983-301126-3-git-send-email-yogesh.jangra@intel.com> (raw)
In-Reply-To: <1632793983-301126-1-git-send-email-yogesh.jangra@intel.com>

This patch has the pipeline test suite changes to cover
the scenarios on variable bit field headers and learner
table features.

Signed-off-by: Yogesh Jangra <yogesh.jangra@intel.com>
Signed-off-by: Churchill Khangar <churchill.khangar@intel.com>
Tested-by: Venkata Suresh Kumar P <venkata.suresh.kumar.p@intel.com>
---
 tests/TestSuite_pipeline.py | 138 ++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 126 insertions(+), 12 deletions(-)

diff --git a/tests/TestSuite_pipeline.py b/tests/TestSuite_pipeline.py
index e00f2e9..b6dc890 100644
--- a/tests/TestSuite_pipeline.py
+++ b/tests/TestSuite_pipeline.py
@@ -423,16 +423,22 @@ class TestPipeline(TestCase):
 
     def run_dpdk_app(self, cli_file):
 
-        cmd = "sed -i -e 's/0000:00:04.0/%s/' {}".format(cli_file) % self.dut_p0_pci
-        self.dut.send_expect(cmd, "# ", 20)
-        cmd = "sed -i -e 's/0000:00:05.0/%s/' {}".format(cli_file) % self.dut_p1_pci
-        self.dut.send_expect(cmd, "# ", 20)
-        cmd = "sed -i -e 's/0000:00:06.0/%s/' {}".format(cli_file) % self.dut_p2_pci
-        self.dut.send_expect(cmd, "# ", 20)
-        cmd = "sed -i -e 's/0000:00:07.0/%s/' {}".format(cli_file) % self.dut_p3_pci
-        self.dut.send_expect(cmd, "# ", 20)
-        cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file)
-        self.dut.send_expect(cmd, "PIPELINE0 enable", 60)
+        cmd = "test -f {} && echo \"File exists!\"".format(cli_file)
+        self.dut.send_expect(cmd, "File exists!", 1)
+        try:
+            cmd = "sed -i -e 's/0000:00:04.0/%s/' {}".format(cli_file) % self.dut_p0_pci
+            self.dut.send_expect(cmd, "# ", 20)
+            cmd = "sed -i -e 's/0000:00:05.0/%s/' {}".format(cli_file) % self.dut_p1_pci
+            self.dut.send_expect(cmd, "# ", 20)
+            cmd = "sed -i -e 's/0000:00:06.0/%s/' {}".format(cli_file) % self.dut_p2_pci
+            self.dut.send_expect(cmd, "# ", 20)
+            cmd = "sed -i -e 's/0000:00:07.0/%s/' {}".format(cli_file) % self.dut_p3_pci
+            self.dut.send_expect(cmd, "# ", 20)
+            cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, self.eal_para, cli_file)
+            self.dut.send_expect(cmd, "PIPELINE0 enable", 60)
+        except Exception:
+            self.dut.send_expect("^C", "# ", 20)
+            self.verify(0, "ERROR in running DPDK application")
 
     def send_pkts(self, from_port, to_port, in_pcap):
         """
@@ -4491,12 +4497,31 @@ class TestPipeline(TestCase):
     def test_ring_port_001(self):
 
         cli_file = '/tmp/pipeline/ring_port_001/ring_port_001.cli'
-        self.run_dpdk_app(cli_file)
+        cmd = "test -f {} && echo \"File exists!\"".format(cli_file)
+        self.dut.send_expect(cmd, "File exists!", 10)
+        try:
+            cmd = "sed -i -e 's/0000:00:04.0/%s/' {}".format(cli_file) % self.dut_p0_pci
+            self.dut.send_expect(cmd, "# ", 10)
+            cmd = "sed -i -e 's/0000:00:05.0/%s/' {}".format(cli_file) % self.dut_p1_pci
+            self.dut.send_expect(cmd, "# ", 10)
+            cmd = "sed -i -e 's/0000:00:06.0/%s/' {}".format(cli_file) % self.dut_p2_pci
+            self.dut.send_expect(cmd, "# ", 10)
+            cmd = "sed -i -e 's/0000:00:07.0/%s/' {}".format(cli_file) % self.dut_p3_pci
+            self.dut.send_expect(cmd, "# ", 10)
+
+            ports = [self.dut_p0_pci, self.dut_p1_pci, self.dut_p2_pci, self.dut_p3_pci]
+            vdevs = ['net_ring0']
+            eal_params = self.dut.create_eal_parameters(cores=list(range(4)), ports=ports, vdevs=vdevs)
+            cmd = "{0} {1} -- -s {2}".format(self.app_pipeline_path, eal_params, cli_file)
+            self.dut.send_expect(cmd, "PIPELINE0 enable", 60)
+        except Exception:
+            self.dut.send_expect("^C", "# ", 20)
+            self.verify(0, "ERROR in running DPDK application")
 
         in_pcap = 'pipeline/ring_port_001/pcap_files/in_1.txt'
         out_pcap = 'pipeline/ring_port_001/pcap_files/out_1.txt'
         self.send_and_sniff_pkts(0, 1, in_pcap, out_pcap, "udp")
-        self.dut.send_expect("^C", "# ", 20)
+        self.dut.send_expect("^C", "# ", 10)
 
     def test_u100_001(self):
 
@@ -4884,6 +4909,95 @@ class TestPipeline(TestCase):
         # self.send_scapy_pkts(0)
         pass
 
+    def test_profile_001(self):
+
+        cli_file = '/tmp/pipeline/profile_001/profile_001.cli'
+        self.run_dpdk_app(cli_file)
+
+        in_pcap = ['pipeline/profile_001/pcap_files/in_1.txt']
+        out_pcap_1 = 'pipeline/profile_001/pcap_files/out_1.txt'
+        out_pcap_2 = 'pipeline/profile_001/pcap_files/out_2.txt'
+        out_pcap_3 = 'pipeline/profile_001/pcap_files/out_3.txt'
+        out_pcap_4 = 'pipeline/profile_001/pcap_files/out_4.txt'
+        out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3, out_pcap_4]
+        filters = ["tcp"] * 4
+        tx_port = [0]
+        rx_port = [0, 1, 2, 3]
+        self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)
+        self.dut.send_expect("^C", "# ", 20)
+
+    def test_varbit_001(self):
+
+        cli_file = '/tmp/pipeline/varbit_001/varbit_001.cli'
+        self.run_dpdk_app(cli_file)
+
+        in_pcap = 'pipeline/varbit_001/pcap_files/in_1.txt'
+        out_pcap = 'pipeline/varbit_001/pcap_files/out_1.txt'
+        self.send_and_sniff_pkts(0, 1, in_pcap, out_pcap, "tcp")
+        self.dut.send_expect("^C", "# ", 20)
+
+    def test_learner_001(self):
+
+        cli_file = '/tmp/pipeline/learner_001/learner_001.cli'
+        self.run_dpdk_app(cli_file)
+
+        in_pcap = ['pipeline/learner_001/pcap_files/in_1.txt']
+        out_pcap = ['pipeline/learner_001/pcap_files/out_1.txt']
+        filters = ["tcp"]
+        tx_port = [0]
+        rx_port = [0]
+        self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)
+        in_pcap = ['pipeline/learner_001/pcap_files/in_2.txt']
+        out_pcap = ['pipeline/learner_001/pcap_files/out_2.txt']
+        filters = ["tcp"]
+        tx_port = [1]
+        rx_port = [1]
+        self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)
+        in_pcap = ['pipeline/learner_001/pcap_files/in_3.txt']
+        out_pcap = ['pipeline/learner_001/pcap_files/out_3.txt']
+        filters = ["tcp"]
+        tx_port = [2]
+        rx_port = [2]
+        self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)
+        in_pcap = ['pipeline/learner_001/pcap_files/in_4.txt']
+        out_pcap = ['pipeline/learner_001/pcap_files/out_4.txt']
+        filters = ["tcp"]
+        tx_port = [3]
+        rx_port = [3]
+        self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)
+        self.dut.send_expect("^C", "# ", 20)
+
+    def test_learner_002(self):
+
+        cli_file = '/tmp/pipeline/learner_002/learner_002.cli'
+        self.run_dpdk_app(cli_file)
+
+        in_pcap = ['pipeline/learner_002/pcap_files/in_1.txt']
+        out_pcap = ['pipeline/learner_002/pcap_files/out_1.txt']
+        filters = ["tcp"]
+        tx_port = [0]
+        rx_port = [0]
+        self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)
+        in_pcap = ['pipeline/learner_002/pcap_files/in_2.txt']
+        out_pcap = ['pipeline/learner_002/pcap_files/out_2.txt']
+        filters = ["tcp"]
+        tx_port = [1]
+        rx_port = [1]
+        self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)
+        in_pcap = ['pipeline/learner_002/pcap_files/in_3.txt']
+        out_pcap = ['pipeline/learner_002/pcap_files/out_3.txt']
+        filters = ["tcp"]
+        tx_port = [2]
+        rx_port = [2]
+        self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)
+        in_pcap = ['pipeline/learner_002/pcap_files/in_4.txt']
+        out_pcap = ['pipeline/learner_002/pcap_files/out_4.txt']
+        filters = ["tcp"]
+        tx_port = [3]
+        rx_port = [3]
+        self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)
+        self.dut.send_expect("^C", "# ", 20)
+
     def tear_down(self):
         """
         Run after each test case.
-- 
1.8.3.1


  parent reply	other threads:[~2021-09-28  9:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28  1:53 [dts] [PATCH 0/2] add pipeline varbit and learner table features test coverage Yogesh Jangra
2021-09-28  1:53 ` [dts] [PATCH 1/2] dep: add variable bit and learner table pipeline test suite dependencies Yogesh Jangra
2021-09-28  1:53 ` Yogesh Jangra [this message]
2021-10-26  5:31   ` [dts] [PATCH 2/2] tests/pipeline: add variable bit and learner table test suite Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1632793983-301126-3-git-send-email-yogesh.jangra@intel.com \
    --to=yogesh.jangra@intel.com \
    --cc=churchill.khangar@intel.com \
    --cc=dts@dpdk.org \
    --cc=venkata.suresh.kumar.p@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

test suite reviews and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://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/ http://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