test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Tu, Lijuan" <lijuan.tu@intel.com>
To: David Liu <dliu@iol.unh.edu>, "dts@dpdk.org" <dts@dpdk.org>
Cc: "Chen, Zhaoyan" <zhaoyan.chen@intel.com>
Subject: Re: [dts] [PATCH] Add MTU Check
Date: Fri, 24 Apr 2020 05:30:40 +0000	[thread overview]
Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BC0F8FA@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <CAAuqQpS9tt_nZD+aF_s8bmPFpOoyKetPsf_aHyLErAK6xf08vg@mail.gmail.com>

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

Hi David,

I found you just check the command “port config mtu (mtu_size)”, and no any stream to verify whether the function works. Is this your purpose?
If you just want to check the testpmd configuration, and not care about the functionality, the case is ok, but as a validation member, I prefer to consider the true functionality, we should check the whether it can transmit packet as expected. For example, packet size less than mtu should be transmitted successfully, and the grater one should failed. In my point, we should cover both positive and negative cases.

There is test suite very similar as mtu, test_plans/jumboframes_test_plan.rst, I think they are testing the same functionality, but using different testpmd command.


From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of David Liu
Sent: Thursday, April 23, 2020 10:04 PM
To: dts@dpdk.org<mailto:dts@dpdk.org>
Cc: David Liu <dliu@iol.unh.edu<mailto:dliu@iol.unh.edu>>
Subject: [dts] [PATCH] Add MTU Check

Signed-off-by: David Liu <dliu@iol.unh.edu<mailto: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: 9987 bytes --]

      reply	other threads:[~2020-04-24  5:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23 14:04 David Liu
2020-04-24  5:30 ` Tu, Lijuan [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=8CE3E05A3F976642AAB0F4675D0AD20E0BC0F8FA@SHSMSX101.ccr.corp.intel.com \
    --to=lijuan.tu@intel.com \
    --cc=dliu@iol.unh.edu \
    --cc=dts@dpdk.org \
    --cc=zhaoyan.chen@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
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).