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