test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] Add MTU Check
@ 2020-04-23 14:04 David Liu
  2020-04-24  5:30 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: David Liu @ 2020-04-23 14:04 UTC (permalink / raw)
  To: dts; +Cc: David Liu

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

Signed-off-by: David Liu <dliu@iol.unh.edu>
---
 test_plans/MTU_test_plan.rst | 35 ++++++++++++++++++++++++
 tests/TestSuite_MTU.py       | 53 ++++++++++++++++++++++++++++++++++++
 2 files changed, 88 insertions(+)
 create mode 100644 test_plans/MTU_test_plan.rst
 create mode 100644 tests/TestSuite_MTU.py

diff --git a/test_plans/MTU_test_plan.rst b/test_plans/MTU_test_plan.rst
new file mode 100644
index 0000000..c343748
--- /dev/null
+++ b/test_plans/MTU_test_plan.rst
@@ -0,0 +1,35 @@
+=============================================
+MTU Check
+=============================================
+
+This check will use testpmmd to check if MTU is set to 1500/2400/4800/9000
+as required and appear in the set status.
+
+Prerequisites
+=============
+
+Compile DPDK and testpmd. Be able to have the testpmd run.
+
+Test Case: set MTU size
+==========================================
+
+Run testpmd in interactive mode ::
+
+  $ ./dpdk-testpmd -- -i
+
+This can be run with other arguments as well, depending on your setup.
+
+(port_id) - the id for the port you are working on.
+The port has to be stopped before setting MTU size.
+Run this command in testpmd ::
+
+  testpmd> port stop (port_id)
+
+(mtu_size) - the size for MTU you want to set.
+Run this command in testpmd ::
+  testpmd> port config mtu (mtu_size)
+
+(port_id) - the id for the port you are working on.
+Verify the output from matches with the correct size::
+  testpmd> show port info (port_id)
+
diff --git a/tests/TestSuite_MTU.py b/tests/TestSuite_MTU.py
new file mode 100644
index 0000000..e84e23c
--- /dev/null
+++ b/tests/TestSuite_MTU.py
@@ -0,0 +1,53 @@
+"""
+DPDK Test suite.
+Testing MTU with different szie in testpmd
+"""
+
+import utils
+import time
+from test_case import TestCase
+from pmd_output import PmdOutput
+
+class TestMTU(TestCase):
+
+    def set_up_all(self):
+        """
+        Run at the start of each test suite.
+        """
+        self.dut.build_install_dpdk(self.target)
+        self.pmdout = PmdOutput(self.dut)
+        self.pmdout.start_testpmd()
+        self.dut_ports = self.dut.get_ports()
+
+    def set_up(self):
+        """
+        Run before each test case.
+        Nothing to do.
+        """
+        pass
+
+    def set_MTU_size(self):
+        """
+        Run port config mtu $port $size to set size and check if they have
the right value
+        """
+        MTU_sizes = [1500, 2400, 4800, 9000]
+        for size in MTU_sizes:
+            for port in self.dut_ports:
+                self.dut.send_command('port stop {}'.format(port))
+                self.dut.send_command('port config mtu {} {}'.format(port,
size))
+                port_info = self.dut.send_command('show port {}
{}'.format('info', port))
+                self.verify(str(size) in port_info, 'MTU size set
{}'.format(size))
+
+    def tear_down(self):
+        """
+        Run after each test case.
+        Nothing to do.
+        """
+        pass
+
+    def tear_down_all(self):
+        """
+        Quit out of testpmd
+        """
+        self.dut.send_expect("quit", "# ", 30)
+
--
2.17.1

[-- Attachment #2: Type: text/html, Size: 3992 bytes --]

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

end of thread, other threads:[~2020-04-24  5:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-23 14:04 [dts] [PATCH] Add MTU Check David Liu
2020-04-24  5:30 ` 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).