From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 642B7A00C4; Thu, 23 Apr 2020 16:05:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5A2C01BE9D; Thu, 23 Apr 2020 16:05:08 +0200 (CEST) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by dpdk.org (Postfix) with ESMTP id 698CA1BF91 for ; Thu, 23 Apr 2020 16:05:07 +0200 (CEST) Received: by mail-lj1-f173.google.com with SMTP id f11so1718412ljp.1 for ; Thu, 23 Apr 2020 07:05:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; h=mime-version:from:date:message-id:subject:to:cc; bh=5Yav051HwZpV0uyMmbE3+mdbWwATUv9LAiBONqi+LYo=; b=Gu3gGmDqtmZ12n4omwo+lE6mm0+CO9rPxiCydrjuteyOtqrI1ionzM+nTBxXvAnus7 ut3LwBMDqU4q+3iXHkftNdewJMEnvzb0JMIXtJfrUE29HYoToKXfgSl0pYqj/RmG02aA iz3j6hF55SFuCamBqYO60HT01R9rID96XKeQ4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=5Yav051HwZpV0uyMmbE3+mdbWwATUv9LAiBONqi+LYo=; b=qevDBoVlHNCqFMxIz5eQJtF+el+BoTUDJu5lq4ReJg6QmGtICmHjcYE24U9uhefckY X3uaqDJhOcOoEminCJiBL/zZLiu+VDCm2iPPO3Ad5SuoqMVoB3C+AsXXOzW6qh5h/dpY SL705izbVbS0GG15LhQexfiOYzTpEs/GFAHlsDnzWhmslHgRH00f6YTYkJKxxXMT0x99 TmFnazpxzYlqcZdJ0H+s+17GV53DLWT23zSRb+zKKRyvCCQm9/rk5eRYpTDu1u5lN2oo EaWEkusU/dj7EEiatbNtjP9p/GC0XrnXC9dL+akVtx3EXkNYrWO0DM0OnzDmFkljIJGS 2Ugg== X-Gm-Message-State: AGi0PuZj77pbQnFXaVUjMT76FdmxTIv2s5L88/crCLc/2CNSdm0eTpFl xnCx8Wyc0uwBgZgxiIgHCJp0lMTRf+AGb4vxCodlDU06WIU= X-Google-Smtp-Source: APiQypJXQLpf3V/yl2R2s1xURCi+JRrSLW1i0QW8ZjvTSRMOakcPMpXSAsxxLU8PGpVPP4sDkCO8QIH2YLFAHUSce2Y= X-Received: by 2002:a05:651c:1104:: with SMTP id d4mr2520569ljo.128.1587650706436; Thu, 23 Apr 2020 07:05:06 -0700 (PDT) MIME-Version: 1.0 From: David Liu Date: Thu, 23 Apr 2020 10:04:28 -0400 Message-ID: To: dts@dpdk.org Cc: David Liu Content-Type: multipart/alternative; boundary="00000000000062942f05a3f5bcd2" Subject: [dts] [PATCH] Add MTU Check X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" --00000000000062942f05a3f5bcd2 Content-Type: text/plain; charset="UTF-8" Signed-off-by: David Liu --- 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 --00000000000062942f05a3f5bcd2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Signed-off-by: David Liu <dliu@iol.unh.edu>
---
=C2=A0test_plan= s/MTU_test_plan.rst | 35 ++++++++++++++++++++++++
=C2=A0tests/TestSuite_= MTU.py=C2=A0 =C2=A0 =C2=A0 =C2=A0| 53 ++++++++++++++++++++++++++++++++++++<= br>=C2=A02 files changed, 88 insertions(+)
=C2=A0create mode 100644 test= _plans/MTU_test_plan.rst
=C2=A0create mode 100644 tests/TestSuite_MTU.py=

diff --git a/test_plans/MTU_test_plan.rst b/test_plans/MTU_test_pla= n.rst
new file mode 100644
index 0000000..c343748
--- /dev/null+++ b/test_plans/MTU_test_plan.rst
@@ -0,0 +1,35 @@
+=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
+MTU Check
+=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
+
+This check wil= l use testpmmd to check if MTU is set to 1500/2400/4800/9000
+as require= d and appear in the set status.
+
+Prerequisites
+=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D
+
+Compile DPDK and testpmd. Be able to have= the testpmd run.
+
+Test Case: set MTU size
+=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
+
+Run testpmd in interactive mode = ::
+
+=C2=A0 $ ./dpdk-testpmd -- -i
+
+This can be run with oth= er 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 sett= ing MTU size.
+Run this command in testpmd ::
+
+=C2=A0 testpmd>= ; port stop (port_id)
+
+(mtu_size) - the size for MTU you want to se= t.
+Run this command in testpmd ::
+=C2=A0 testpmd> port config mt= u (mtu_size)
+
+(port_id) - the id for the port you are working on.+Verify the output from matches with the correct size::
+=C2=A0 testpm= d> show port info (port_id)
+
diff --git a/tests/TestSuite_MTU.py = b/tests/TestSuite_MTU.py
new file mode 100644
index 0000000..e84e23c<= br>--- /dev/null
+++ b/tests/TestSuite_MTU.py
@@ -0,0 +1,53 @@
+&q= uot;""
+DPDK Test suite.
+Testing MTU with different szie i= n testpmd
+"""
+
+import utils
+import time
+= from test_case import TestCase
+from pmd_output import PmdOutput
++class TestMTU(TestCase):
+
+=C2=A0 =C2=A0 def set_up_all(self):
= +=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
+=C2=A0 =C2=A0 =C2=A0 = =C2=A0 Run at the start of each test suite.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0= """
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.build_install_= dpdk(self.target)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.pmdout =3D PmdOutput= (self.dut)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.pmdout.start_testpmd()
+= =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut_ports =3D self.dut.get_ports()
++=C2=A0 =C2=A0 def set_up(self):
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 "&qu= ot;"=C2=A0
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Run before each test case.= =C2=A0 =C2=A0 =C2=A0 =C2=A0
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Nothing to do.<= br>+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """=C2=A0
+=C2=A0 =C2=A0 = =C2=A0 =C2=A0 pass
+
+=C2=A0 =C2=A0 def set_MTU_size(self):
+=C2= =A0 =C2=A0 =C2=A0 =C2=A0 """
+=C2=A0 =C2=A0 =C2=A0 =C2=A0= Run port config mtu $port $size to set size and check if they have the rig= ht value
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
+=C2=A0 =C2= =A0 =C2=A0 =C2=A0 MTU_sizes =3D [1500, 2400, 4800, 9000]
+=C2=A0 =C2=A0 = =C2=A0 =C2=A0 for size in MTU_sizes:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 for port in self.dut_ports:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 self.dut.send_command('port stop {}'.format(po= rt))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.s= end_command('port config mtu {} {}'.format(port, size))
+=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 port_info =3D self.dut.sen= d_command('show port {} {}'.format('info', port))
+=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify(str(size) = in port_info, 'MTU size set {}'.format(size))
+
+=C2=A0 =C2= =A0 def tear_down(self):
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """=
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Run after each test case.
+=C2=A0 =C2= =A0 =C2=A0 =C2=A0 Nothing to do.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 "&quo= t;"=C2=A0
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 pass
+
+=C2=A0 =C2=A0 = def tear_down_all(self):
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """=
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Quit out of testpmd
+=C2=A0 =C2=A0 =C2= =A0 =C2=A0 """
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send= _expect("quit", "# ", 30)=C2=A0 =C2=A0
+=C2=A0 =C2= =A0 =C2=A0 =C2=A0
--
2.17.1
=C2=A0=C2= =A0
--00000000000062942f05a3f5bcd2--