test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts][PATCH V1] Optimize test scripts
@ 2021-11-11 17:33 Lewei Yang
  0 siblings, 0 replies; only message in thread
From: Lewei Yang @ 2021-11-11 17:33 UTC (permalink / raw)
  To: dts; +Cc: YangLewei

From: YangLewei <leweix.yang@intel.com>

Separate the test jumbo frame from other tests

Signed-off-by: YangLewei <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..4fa5c454 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
+        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..bc77fa41 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
+        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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-11  9:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-11 17:33 [dts][PATCH V1] Optimize test scripts Lewei Yang

test suite reviews and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git