From: David Liu <dliu@iol.unh.edu>
To: dts@dpdk.org
Cc: David Liu <dliu@iol.unh.edu>
Subject: [dts] [PATCH] Add MTU Check
Date: Thu, 23 Apr 2020 10:04:28 -0400 [thread overview]
Message-ID: <CAAuqQpS9tt_nZD+aF_s8bmPFpOoyKetPsf_aHyLErAK6xf08vg@mail.gmail.com> (raw)
[-- 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 --]
next reply other threads:[~2020-04-23 14:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-23 14:04 David Liu [this message]
2020-04-24 5:30 ` 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=CAAuqQpS9tt_nZD+aF_s8bmPFpOoyKetPsf_aHyLErAK6xf08vg@mail.gmail.com \
--to=dliu@iol.unh.edu \
--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).