* [dts] [PATCH V1] tests/shutdown_api: optimize script
@ 2019-10-21 17:59 Wenjie Li
2019-10-21 9:09 ` Yao, BingX Y
2019-11-04 2:39 ` Tu, Lijuan
0 siblings, 2 replies; 3+ messages in thread
From: Wenjie Li @ 2019-10-21 17:59 UTC (permalink / raw)
To: dts; +Cc: Wenjie Li
1. disable promisc packets
2. check the ports are UP before sending packets
Signed-off-by: Wenjie Li <wenjiex.a.li@intel.com>
---
tests/TestSuite_shutdown_api.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/tests/TestSuite_shutdown_api.py b/tests/TestSuite_shutdown_api.py
index 32bb765..7d5afa7 100644
--- a/tests/TestSuite_shutdown_api.py
+++ b/tests/TestSuite_shutdown_api.py
@@ -94,6 +94,10 @@ class TestShutdownApi(TestCase):
"""
Send packages according to parameters.
"""
+ # check the ports are UP before sending packets
+ res = self.pmdout.wait_link_status_up('all')
+ self.verify(res is True, 'there have port link is down')
+
port0_stats = self.get_stats(txPort)
gp0tx_pkts, gp0tx_bytes = [port0_stats['TX-packets'], port0_stats['TX-bytes']]
port1_stats = self.get_stats(rxPort)
@@ -188,6 +192,7 @@ class TestShutdownApi(TestCase):
Stop and Restar.
"""
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
self.dut.send_expect("set fwd mac", "testpmd>")
self.dut.send_expect("start", "testpmd> ")
@@ -244,6 +249,7 @@ class TestShutdownApi(TestCase):
testcorelist = self.dut.get_core_list("1S/8C/1T", socket=self.ports_socket)
self.pmdout.start_testpmd(testcorelist, "--portmask=%s --port-topology=loop" % utils.create_mask([self.ports[0]]), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
fwdcoremask = utils.create_mask(testcorelist[-3:])
self.dut.send_expect("port stop all", "testpmd> ", 100)
@@ -269,6 +275,7 @@ class TestShutdownApi(TestCase):
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
else:
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop --disable-crc-strip" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
out = self.dut.send_expect("show config rxtx", "testpmd> ")
Rx_offloads = re.compile('Rx offloads=(.*?)\s+?').findall(out, re.S)
crc_keep_temp = []
@@ -306,6 +313,7 @@ class TestShutdownApi(TestCase):
return
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
out = self.tester.send_expect(
"ethtool %s" % self.tester.get_interface(self.tester.get_local_port(self.ports[0])), "# ")
@@ -356,6 +364,7 @@ class TestShutdownApi(TestCase):
jumbo_size = 2048
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
self.dut.send_expect("port stop all", "testpmd> ", 100)
self.dut.send_expect("port config all max-pkt-len %d" % jumbo_size, "testpmd> ")
out = self.dut.send_expect("vlan set strip off all", "testpmd> ")
@@ -402,6 +411,7 @@ class TestShutdownApi(TestCase):
Enable/Disable RSS.
"""
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
self.dut.send_expect("port stop all", "testpmd> ", 100)
self.dut.send_expect("port config rss ip", "testpmd> ")
@@ -415,6 +425,7 @@ class TestShutdownApi(TestCase):
Change numbers of rxd and txd.
"""
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
self.dut.send_expect("port stop all", "testpmd> ", 100)
self.dut.send_expect("port config all rxd 1024", "testpmd> ")
@@ -434,6 +445,7 @@ class TestShutdownApi(TestCase):
Change the Number of rxd/txd.
"""
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
self.dut.send_expect("port stop all", "testpmd> ", 100)
self.dut.send_expect("port config all rxd 1024", "testpmd> ")
@@ -464,6 +476,7 @@ class TestShutdownApi(TestCase):
Change RX/TX thresholds
"""
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
self.dut.send_expect("port stop all", "testpmd> ", 100)
self.dut.send_expect("port config all txfreet 32", "testpmd> ")
@@ -500,6 +513,7 @@ class TestShutdownApi(TestCase):
stress_iterations = 10
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
tgenInput = []
for port in self.ports:
@@ -525,6 +539,7 @@ class TestShutdownApi(TestCase):
return
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
self.dut.send_expect("set fwd mac", "testpmd>")
self.dut.send_expect("start", "testpmd>")
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dts] [PATCH V1] tests/shutdown_api: optimize script
2019-10-21 17:59 [dts] [PATCH V1] tests/shutdown_api: optimize script Wenjie Li
@ 2019-10-21 9:09 ` Yao, BingX Y
2019-11-04 2:39 ` Tu, Lijuan
1 sibling, 0 replies; 3+ messages in thread
From: Yao, BingX Y @ 2019-10-21 9:09 UTC (permalink / raw)
To: Li, WenjieX A, dts; +Cc: Li, WenjieX A
[-- Attachment #1: Type: text/plain, Size: 6304 bytes --]
Tested-by: Yao, BingX Y <bingx.y.yao@intel.com>
-----Original Message-----
From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Wenjie Li
Sent: Tuesday, October 22, 2019 1:59 AM
To: dts@dpdk.org
Cc: Li, WenjieX A <wenjiex.a.li@intel.com>
Subject: [dts] [PATCH V1] tests/shutdown_api: optimize script
1. disable promisc packets
2. check the ports are UP before sending packets
Signed-off-by: Wenjie Li <wenjiex.a.li@intel.com>
---
tests/TestSuite_shutdown_api.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/tests/TestSuite_shutdown_api.py b/tests/TestSuite_shutdown_api.py index 32bb765..7d5afa7 100644
--- a/tests/TestSuite_shutdown_api.py
+++ b/tests/TestSuite_shutdown_api.py
@@ -94,6 +94,10 @@ class TestShutdownApi(TestCase):
"""
Send packages according to parameters.
"""
+ # check the ports are UP before sending packets
+ res = self.pmdout.wait_link_status_up('all')
+ self.verify(res is True, 'there have port link is down')
+
port0_stats = self.get_stats(txPort)
gp0tx_pkts, gp0tx_bytes = [port0_stats['TX-packets'], port0_stats['TX-bytes']]
port1_stats = self.get_stats(rxPort) @@ -188,6 +192,7 @@ class TestShutdownApi(TestCase):
Stop and Restar.
"""
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
self.dut.send_expect("set fwd mac", "testpmd>")
self.dut.send_expect("start", "testpmd> ") @@ -244,6 +249,7 @@ class TestShutdownApi(TestCase):
testcorelist = self.dut.get_core_list("1S/8C/1T", socket=self.ports_socket)
self.pmdout.start_testpmd(testcorelist, "--portmask=%s --port-topology=loop" % utils.create_mask([self.ports[0]]), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
fwdcoremask = utils.create_mask(testcorelist[-3:])
self.dut.send_expect("port stop all", "testpmd> ", 100) @@ -269,6 +275,7 @@ class TestShutdownApi(TestCase):
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
else:
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop --disable-crc-strip" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
out = self.dut.send_expect("show config rxtx", "testpmd> ")
Rx_offloads = re.compile('Rx offloads=(.*?)\s+?').findall(out, re.S)
crc_keep_temp = []
@@ -306,6 +313,7 @@ class TestShutdownApi(TestCase):
return
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
out = self.tester.send_expect(
"ethtool %s" % self.tester.get_interface(self.tester.get_local_port(self.ports[0])), "# ") @@ -356,6 +364,7 @@ class TestShutdownApi(TestCase):
jumbo_size = 2048
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
self.dut.send_expect("port stop all", "testpmd> ", 100)
self.dut.send_expect("port config all max-pkt-len %d" % jumbo_size, "testpmd> ")
out = self.dut.send_expect("vlan set strip off all", "testpmd> ") @@ -402,6 +411,7 @@ class TestShutdownApi(TestCase):
Enable/Disable RSS.
"""
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
self.dut.send_expect("port stop all", "testpmd> ", 100)
self.dut.send_expect("port config rss ip", "testpmd> ") @@ -415,6 +425,7 @@ class TestShutdownApi(TestCase):
Change numbers of rxd and txd.
"""
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
self.dut.send_expect("port stop all", "testpmd> ", 100)
self.dut.send_expect("port config all rxd 1024", "testpmd> ") @@ -434,6 +445,7 @@ class TestShutdownApi(TestCase):
Change the Number of rxd/txd.
"""
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
self.dut.send_expect("port stop all", "testpmd> ", 100)
self.dut.send_expect("port config all rxd 1024", "testpmd> ") @@ -464,6 +476,7 @@ class TestShutdownApi(TestCase):
Change RX/TX thresholds
"""
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
self.dut.send_expect("port stop all", "testpmd> ", 100)
self.dut.send_expect("port config all txfreet 32", "testpmd> ") @@ -500,6 +513,7 @@ class TestShutdownApi(TestCase):
stress_iterations = 10
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
tgenInput = []
for port in self.ports:
@@ -525,6 +539,7 @@ class TestShutdownApi(TestCase):
return
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
+ self.dut.send_expect("set promisc all off", "testpmd>")
self.dut.send_expect("set fwd mac", "testpmd>")
self.dut.send_expect("start", "testpmd>")
--
2.17.1
[-- Attachment #2: TestShutdownApi.log --]
[-- Type: application/octet-stream, Size: 329319 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dts] [PATCH V1] tests/shutdown_api: optimize script
2019-10-21 17:59 [dts] [PATCH V1] tests/shutdown_api: optimize script Wenjie Li
2019-10-21 9:09 ` Yao, BingX Y
@ 2019-11-04 2:39 ` Tu, Lijuan
1 sibling, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2019-11-04 2:39 UTC (permalink / raw)
To: Li, WenjieX A, dts; +Cc: Li, WenjieX A
Applied, thanks
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Wenjie Li
> Sent: Tuesday, October 22, 2019 1:59 AM
> To: dts@dpdk.org
> Cc: Li, WenjieX A <wenjiex.a.li@intel.com>
> Subject: [dts] [PATCH V1] tests/shutdown_api: optimize script
>
> 1. disable promisc packets
> 2. check the ports are UP before sending packets
>
> Signed-off-by: Wenjie Li <wenjiex.a.li@intel.com>
> ---
> tests/TestSuite_shutdown_api.py | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/tests/TestSuite_shutdown_api.py
> b/tests/TestSuite_shutdown_api.py index 32bb765..7d5afa7 100644
> --- a/tests/TestSuite_shutdown_api.py
> +++ b/tests/TestSuite_shutdown_api.py
> @@ -94,6 +94,10 @@ class TestShutdownApi(TestCase):
> """
> Send packages according to parameters.
> """
> + # check the ports are UP before sending packets
> + res = self.pmdout.wait_link_status_up('all')
> + self.verify(res is True, 'there have port link is down')
> +
> port0_stats = self.get_stats(txPort)
> gp0tx_pkts, gp0tx_bytes = [port0_stats['TX-packets'], port0_stats['TX-
> bytes']]
> port1_stats = self.get_stats(rxPort) @@ -188,6 +192,7 @@ class
> TestShutdownApi(TestCase):
> Stop and Restar.
> """
> self.pmdout.start_testpmd("Default", "--portmask=%s --port-
> topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
> + self.dut.send_expect("set promisc all off", "testpmd>")
>
> self.dut.send_expect("set fwd mac", "testpmd>")
> self.dut.send_expect("start", "testpmd> ") @@ -244,6 +249,7 @@ class
> TestShutdownApi(TestCase):
> testcorelist = self.dut.get_core_list("1S/8C/1T", socket=self.ports_socket)
>
> self.pmdout.start_testpmd(testcorelist, "--portmask=%s --port-
> topology=loop" % utils.create_mask([self.ports[0]]), socket=self.ports_socket)
> + self.dut.send_expect("set promisc all off", "testpmd>")
> fwdcoremask = utils.create_mask(testcorelist[-3:])
>
> self.dut.send_expect("port stop all", "testpmd> ", 100) @@ -269,6
> +275,7 @@ class TestShutdownApi(TestCase):
> self.pmdout.start_testpmd("Default", "--portmask=%s --port-
> topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
> else:
> self.pmdout.start_testpmd("Default", "--portmask=%s --port-
> topology=loop --disable-crc-strip" % utils.create_mask(self.ports),
> socket=self.ports_socket)
> + self.dut.send_expect("set promisc all off", "testpmd>")
> out = self.dut.send_expect("show config rxtx", "testpmd> ")
> Rx_offloads = re.compile('Rx offloads=(.*?)\s+?').findall(out, re.S)
> crc_keep_temp = []
> @@ -306,6 +313,7 @@ class TestShutdownApi(TestCase):
> return
>
> self.pmdout.start_testpmd("Default", "--portmask=%s --port-
> topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
> + self.dut.send_expect("set promisc all off", "testpmd>")
>
> out = self.tester.send_expect(
> "ethtool %s" %
> self.tester.get_interface(self.tester.get_local_port(self.ports[0])), "# ") @@ -
> 356,6 +364,7 @@ class TestShutdownApi(TestCase):
>
> jumbo_size = 2048
> self.pmdout.start_testpmd("Default", "--portmask=%s --port-
> topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
> + self.dut.send_expect("set promisc all off", "testpmd>")
> self.dut.send_expect("port stop all", "testpmd> ", 100)
> self.dut.send_expect("port config all max-pkt-len %d" % jumbo_size,
> "testpmd> ")
> out = self.dut.send_expect("vlan set strip off all", "testpmd> ") @@ -
> 402,6 +411,7 @@ class TestShutdownApi(TestCase):
> Enable/Disable RSS.
> """
> self.pmdout.start_testpmd("Default", "--portmask=%s --port-
> topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
> + self.dut.send_expect("set promisc all off", "testpmd>")
>
> self.dut.send_expect("port stop all", "testpmd> ", 100)
> self.dut.send_expect("port config rss ip", "testpmd> ") @@ -415,6
> +425,7 @@ class TestShutdownApi(TestCase):
> Change numbers of rxd and txd.
> """
> self.pmdout.start_testpmd("Default", "--portmask=%s --port-
> topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
> + self.dut.send_expect("set promisc all off", "testpmd>")
>
> self.dut.send_expect("port stop all", "testpmd> ", 100)
> self.dut.send_expect("port config all rxd 1024", "testpmd> ") @@ -434,6
> +445,7 @@ class TestShutdownApi(TestCase):
> Change the Number of rxd/txd.
> """
> self.pmdout.start_testpmd("Default", "--portmask=%s --port-
> topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
> + self.dut.send_expect("set promisc all off", "testpmd>")
>
> self.dut.send_expect("port stop all", "testpmd> ", 100)
> self.dut.send_expect("port config all rxd 1024", "testpmd> ") @@ -464,6
> +476,7 @@ class TestShutdownApi(TestCase):
> Change RX/TX thresholds
> """
> self.pmdout.start_testpmd("Default", "--portmask=%s --port-
> topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
> + self.dut.send_expect("set promisc all off", "testpmd>")
>
> self.dut.send_expect("port stop all", "testpmd> ", 100)
> self.dut.send_expect("port config all txfreet 32", "testpmd> ") @@ -
> 500,6 +513,7 @@ class TestShutdownApi(TestCase):
> stress_iterations = 10
>
> self.pmdout.start_testpmd("Default", "--portmask=%s --port-
> topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
> + self.dut.send_expect("set promisc all off", "testpmd>")
>
> tgenInput = []
> for port in self.ports:
> @@ -525,6 +539,7 @@ class TestShutdownApi(TestCase):
> return
>
> self.pmdout.start_testpmd("Default", "--portmask=%s --port-
> topology=loop" % utils.create_mask(self.ports), socket=self.ports_socket)
> + self.dut.send_expect("set promisc all off", "testpmd>")
> self.dut.send_expect("set fwd mac", "testpmd>")
> self.dut.send_expect("start", "testpmd>")
>
> --
> 2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-04 2:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-21 17:59 [dts] [PATCH V1] tests/shutdown_api: optimize script Wenjie Li
2019-10-21 9:09 ` Yao, BingX Y
2019-11-04 2:39 ` Tu, Lijuan
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).