From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6CC3CA0C4C; Wed, 1 Dec 2021 07:12:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 333514068C; Wed, 1 Dec 2021 07:12:57 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 451284067B for ; Wed, 1 Dec 2021 07:12:55 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10184"; a="236621951" X-IronPort-AV: E=Sophos;i="5.87,278,1631602800"; d="scan'208";a="236621951" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2021 22:12:54 -0800 X-IronPort-AV: E=Sophos;i="5.87,278,1631602800"; d="scan'208";a="477424879" Received: from unknown (HELO dpdk.lan) ([10.240.183.77]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2021 22:12:52 -0800 From: Lewei Yang To: dts@dpdk.org Cc: Lewei Yang Subject: [dts][PATCH V1] test/smoke:remove specific parameters in common cases Date: Wed, 1 Dec 2021 14:12:58 +0000 Message-Id: <20211201141258.144488-1-leweix.yang@intel.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 remove specific parameters in common cases. Signed-off-by: Lewei Yang --- 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