test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yong Liu <yong.liu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH 3/3] tests: add l2fwd sample forwarding integrity check test
Date: Thu, 22 Oct 2015 09:02:20 +0800	[thread overview]
Message-ID: <1445475740-15671-4-git-send-email-yong.liu@intel.com> (raw)
In-Reply-To: <1445475740-15671-1-git-send-email-yong.liu@intel.com>

From: Marvin Liu <yong.liu@intel.com>

Add new test case for check l2fwd sample forwarded packets. The case will
meansure different core and queue configurations.

Signed-off-by: Marvin Liu <yong.liu@intel.com>

diff --git a/tests/TestSuite_l2fwd.py b/tests/TestSuite_l2fwd.py
index 5c79cbf..e36bafb 100644
--- a/tests/TestSuite_l2fwd.py
+++ b/tests/TestSuite_l2fwd.py
@@ -113,7 +113,7 @@ class TestL2fwd(TestCase):
         self.dut.send_expect("fg", "l2fwd ", 5)
         self.dut.send_expect("^C", "# ", 5)
 
-    def test_port_testing(self):
+    def notest_port_testing(self):
         """
         Check port forwarding.
         """
@@ -143,6 +143,33 @@ class TestL2fwd(TestCase):
 
         self.quit_l2fwd()
 
+    def test_l2fwd_integrity(self):
+        """
+        Check port forwarding.
+        """
+        # the cases use the first two ports
+        port_mask = dts.create_mask([self.dut_ports[0], self.dut_ports[1]])
+
+        core_mask = dts.create_mask(self.dut.get_core_list(self.core_config,
+                                                           socket=self.ports_socket))
+        for queues in self.test_queues:
+
+            command_line = "./examples/l2fwd/build/app/l2fwd -n %d -c %s -- -q %s -p %s &" % \
+                (self.dut.get_memory_channels(), core_mask,
+                 str(queues['queues']), port_mask)
+
+            self.dut.send_expect(command_line, "memory mapped", 60)
+
+            tgen_input = []
+            tx_port = self.tester.get_local_port(self.dut_ports[0])
+            rx_port = self.tester.get_local_port(self.dut_ports[1])
+            tgen_input.append((tx_port, rx_port))
+
+            result = self.tester.check_random_pkts(tgen_input, allow_miss=False)
+            self.verify(result != False, "Packet integrity check failed")
+
+            self.quit_l2fwd()
+
     def test_perf_l2fwd_performance(self):
         """
         Benchmark performance for frame_sizes.
-- 
1.9.3

      parent reply	other threads:[~2015-10-22  1:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22  1:02 [dts] [PATCH 0/3] packet integrity check in sample applications Yong Liu
2015-10-22  1:02 ` [dts] [PATCH 1/3] framework: support packet objects transmit and analysis Yong Liu
2015-10-22  1:02 ` [dts] [PATCH 2/3] framework: add packet integrity verification funtion Yong Liu
2015-10-22  1:02 ` Yong Liu [this message]

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=1445475740-15671-4-git-send-email-yong.liu@intel.com \
    --to=yong.liu@intel.com \
    --cc=dts@dpdk.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).