test suite reviews and discussions
 help / color / mirror / Atom feed
From: Lewei Yang <leweix.yang@intel.com>
To: dts@dpdk.org
Cc: Lewei Yang <leweix.yang@intel.com>
Subject: [dts][PATCH V1] test/smoke:remove specific parameters in common cases
Date: Wed,  1 Dec 2021 14:12:58 +0000	[thread overview]
Message-ID: <20211201141258.144488-1-leweix.yang@intel.com> (raw)

remove specific parameters in common cases.

Signed-off-by: Lewei Yang <leweix.yang@intel.com>
---
 test_plans/pf_smoke_test_plan.rst | 14 ++++++++------
 test_plans/vf_smoke_test_plan.rst | 13 +++++++------
 tests/TestSuite_pf_smoke.py       | 17 ++++++++++-------
 tests/TestSuite_vf_smoke.py       | 19 ++++++++++++-------
 4 files changed, 37 insertions(+), 26 deletions(-)

diff --git a/test_plans/pf_smoke_test_plan.rst b/test_plans/pf_smoke_test_plan.rst
index 2b6c6128..ffcd2105 100644
--- a/test_plans/pf_smoke_test_plan.rst
+++ b/test_plans/pf_smoke_test_plan.rst
@@ -71,7 +71,7 @@ Prerequisites
 
 8. Launch dpdk on PF::
 
-    ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:86:00.0 --file-prefix=pf -- -i --max-pkt-len=9600 --tx-offloads=0x00008000 --rxq=4 --txq=4
+    ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:86:00.0 --file-prefix=pf -- -i --rxq=4 --txq=4
     testpmd> set fwd mac
     testpmd> set verbose 3
     testpmd> start
@@ -79,13 +79,15 @@ Prerequisites
 
 Test Case 1: test enable and disable jumbo frame
 ====================================================
-1. set fwd mode is mac::
+1. when launch dpdk on PF, add  parameter '--max-pkt-len=9600 --tx-offloads=0x00008000'
+
+2. set fwd mode is mac::
 
     testpmd> set fwd mac
     testpmd> set verbose 3
     testpmd> start
 
-2. Send a packet with size 9601 bytes ::
+3. Send a packet with size 9601 bytes ::
 
     testpmd> show port stats 0
 
@@ -96,7 +98,7 @@ Test Case 1: test enable and disable jumbo frame
 
 Verify that TX-bytes on port 0 and RX-bytes on port 0 are 0.
 
-3. Send a packet with size 9600 bytes ::
+4. Send a packet with size 9600 bytes ::
 
     testpmd> show port stats 0
 
@@ -107,11 +109,11 @@ Verify that TX-bytes on port 0 and RX-bytes on port 0 are 0.
 
 Verify that TX-bytes on port 0 and RX-bytes on port 0 are 9600.
 
-4. Set mtu is 1500 ::
+5. Set mtu is 1500 ::
 
     testpmd> port config mtu 1500
 
-5. Send a packet with size 1518 bytes ::
+6. Send a packet with size 1518 bytes ::
 
     testpmd> show port stats 0
 
diff --git a/test_plans/vf_smoke_test_plan.rst b/test_plans/vf_smoke_test_plan.rst
index 650f759c..43330c10 100644
--- a/test_plans/vf_smoke_test_plan.rst
+++ b/test_plans/vf_smoke_test_plan.rst
@@ -82,7 +82,7 @@ Prerequisites
 
 8. Launch dpdk on VF::
 
-    ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:86:01.0 --file-prefix=pf -- -i --max-pkt-len=9600 --tx-offloads=0x00008000 --rxq=4 --txq=4
+    ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:86:01.0 --file-prefix=pf -- -i --rxq=4 --txq=4
     testpmd> set fwd mac
     testpmd> set verbose 3
     testpmd> start
@@ -91,14 +91,15 @@ Prerequisites
 
 Test Case 1: test enable and disable jumbo frame
 ====================================================
+1. when launch dpdk on VF, add  parameter '--max-pkt-len=9600 --tx-offloads=0x00008000'
 
-1. set fwd mode is mac::
+2. set fwd mode is mac::
 
     testpmd> set fwd mac
     testpmd> set verbose 3
     testpmd> start
 
-2. Send a packet with size 9601 bytes ::
+3. Send a packet with size 9601 bytes ::
 
     testpmd> show port stats 0
 
@@ -109,7 +110,7 @@ Test Case 1: test enable and disable jumbo frame
 
 Verify that TX-bytes on port 0 and RX-bytes on port 0 are 0.
 
-3. Send a packet with size 9600 bytes ::
+4. Send a packet with size 9600 bytes ::
 
     testpmd> show port stats 0
 
@@ -120,11 +121,11 @@ Verify that TX-bytes on port 0 and RX-bytes on port 0 are 0.
 
 Verify that TX-bytes on port 0 and RX-bytes on port 0 are 9600.
 
-4. Set mtu is 1500 ::
+5. Set mtu is 1500 ::
 
     testpmd> port config mtu 1500
 
-5. Send a packet with size 1518 bytes ::
+6. Send a packet with size 1518 bytes ::
 
     testpmd> show port stats 0
 
diff --git a/tests/TestSuite_pf_smoke.py b/tests/TestSuite_pf_smoke.py
index 7477f498..a8e4adde 100644
--- a/tests/TestSuite_pf_smoke.py
+++ b/tests/TestSuite_pf_smoke.py
@@ -72,9 +72,6 @@ class TestPfSmoke(TestCase):
         # set default app parameter
         self.pmd_out = PmdOutput(self.dut)
         self.ports = [self.dut.ports_info[self.smoke_dut_ports[0]]['pci']]
-        self.param = '--max-pkt-len={} --tx-offloads=0x8000 --rxq={} --txq={}'.format(JUMBO_FRAME_LENGTH,
-                                                                                      LAUNCH_QUEUE,
-                                                                                      LAUNCH_QUEUE)
         self.test_func = SmokeTest(self)
         self.check_session = self.dut.new_session(suite="pf_smoke_test")
 
@@ -82,15 +79,19 @@ class TestPfSmoke(TestCase):
         """
         Run before each test case.
         """
+        # set tester mtu and testpmd parameter
+        if self._suite_result.test_case == "test_pf_jumbo_frames":
+            self.tester.send_expect("ifconfig {} mtu {}".format(self.smoke_tester_nic, JUMBO_FRAME_MTU), '# ')
+            self.param = '--max-pkt-len={} --tx-offloads=0x8000 --rxq={} --txq={}'.format(JUMBO_FRAME_LENGTH,
+                                                                                          LAUNCH_QUEUE,
+                                                                                          LAUNCH_QUEUE)
+        else:
+            self.param = '--rxq={} --txq={}'.format(LAUNCH_QUEUE, LAUNCH_QUEUE)
         # verify app launch state.
         out = self.check_session.send_expect("ls -l /var/run/dpdk |awk '/^d/ {print $NF}'", '# ', 1)
         if out == '' or 'No such file or directory' in out:
             self.pf_launch_dpdk_app()
 
-        # set tester mtu
-        if self._suite_result.test_case == "test_pf_jumbo_frames":
-            self.tester.send_expect("ifconfig {} mtu {}".format(self.smoke_tester_nic, JUMBO_FRAME_MTU), '# ')
-
     def pf_launch_dpdk_app(self):
         self.pmd_out.start_testpmd(cores=self.cores, ports=self.ports, param=self.param)
 
@@ -146,6 +147,8 @@ class TestPfSmoke(TestCase):
             self.dut.send_expect("port config all rxq {}".format(LAUNCH_QUEUE), "testpmd> ")
             self.dut.send_expect("port config all txq {}".format(LAUNCH_QUEUE), "testpmd> ")
             self.dut.send_expect("port start all", "testpmd> ")
+        self.dut.send_expect("quit", "# ")
+        self.dut.kill_all()
 
     def tear_down_all(self):
         if self.check_session:
diff --git a/tests/TestSuite_vf_smoke.py b/tests/TestSuite_vf_smoke.py
index ab939acc..d63db2be 100644
--- a/tests/TestSuite_vf_smoke.py
+++ b/tests/TestSuite_vf_smoke.py
@@ -92,9 +92,6 @@ class TestVfSmoke(TestCase):
             self.ports = [self.vf0_prop['opt_host']]
 
         self.pmd_out = PmdOutput(self.dut)
-        self.param = '--max-pkt-len={} --tx-offloads=0x8000 --rxq={} --txq={}'.format(JUMBO_FRAME_LENGTH,
-                                                                                      LAUNCH_QUEUE,
-                                                                                      LAUNCH_QUEUE)
         self.test_func = SmokeTest(self)
         self.check_session = self.dut.new_session(suite="vf_smoke_test")
 
@@ -102,14 +99,20 @@ class TestVfSmoke(TestCase):
         """
         Run before each test case.
         """
+        # set tester mtu and testpmd parameter
+        if self._suite_result.test_case == "test_vf_jumbo_frames":
+            self.tester.send_expect("ifconfig {} mtu {}".format(self.smoke_tester_nic, JUMBO_FRAME_MTU), '# ')
+            self.param = '--max-pkt-len={} --tx-offloads=0x8000 --rxq={} --txq={}'.format(JUMBO_FRAME_LENGTH,
+                                                                                          LAUNCH_QUEUE,
+                                                                                          LAUNCH_QUEUE)
+        else:
+            self.param = '--rxq={} --txq={}'.format(LAUNCH_QUEUE, LAUNCH_QUEUE)
+
         # verify app launch state.
         out = self.check_session.send_expect("ls -l /var/run/dpdk |awk '/^d/ {print $NF}'", '# ', 1)
         if out == '' or 'No such file or directory' in out:
             self.vf_launch_dpdk_app()
 
-        if self._suite_result.test_case == "test_vf_jumbo_frames":
-            self.tester.send_expect("ifconfig {} mtu {}".format(self.smoke_tester_nic, JUMBO_FRAME_MTU), '# ')
-
     def vf_launch_dpdk_app(self):
         self.pmd_out.start_testpmd(cores=self.cores, ports=self.ports, param=self.param)
 
@@ -155,7 +158,7 @@ class TestVfSmoke(TestCase):
         # set tester mtu to default value
         self.pmd_out.execute_cmd("stop")
         if self._suite_result.test_case == "test_vf_jumbo_frames":
-            self.tester.send_expect("ifconfig {} mtu {}".format(self.smoke_tester_nic, DEFAULT_PKG_LEN), '# ')
+            self.tester.send_expect("ifconfig {} mtu {}".format(self.smoke_tester_nic, DEFAULT_MTU_VALUE), '# ')
 
         # set dpdk queues to launch value
         if self._suite_result.test_case == "test_vf_tx_rx_queue":
@@ -163,6 +166,8 @@ class TestVfSmoke(TestCase):
             self.dut.send_expect("port config all rxq {}".format(LAUNCH_QUEUE), "testpmd> ")
             self.dut.send_expect("port config all txq {}".format(LAUNCH_QUEUE), "testpmd> ")
             self.dut.send_expect("port start all", "testpmd> ")
+        self.dut.send_expect("quit", "# ")
+        self.dut.kill_all()
 
     def tear_down_all(self):
         if self.check_session:
-- 
2.33.1


             reply	other threads:[~2021-12-01  6:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01 14:12 Lewei Yang [this message]
2021-12-16 10:49 ` 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=20211201141258.144488-1-leweix.yang@intel.com \
    --to=leweix.yang@intel.com \
    --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).