test suite reviews and discussions
 help / color / Atom feed
* [dts]  [PATCH V1] tests/rss_to_rte_flow:modify send_packet
@ 2020-01-19  9:34 Zeng Xiaoxiao
  2020-01-20  5:45 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: Zeng Xiaoxiao @ 2020-01-19  9:34 UTC (permalink / raw)
  To: dts; +Cc: Zeng Xiaoxiao

Signed-off-by: Zeng Xiaoxiao <xiaoxiaox.zeng@intel.com>
---
 tests/TestSuite_rss_to_rte_flow.py | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/tests/TestSuite_rss_to_rte_flow.py b/tests/TestSuite_rss_to_rte_flow.py
index d062dd5..593d694 100644
--- a/tests/TestSuite_rss_to_rte_flow.py
+++ b/tests/TestSuite_rss_to_rte_flow.py
@@ -38,6 +38,7 @@ Test moving RSS to rte_flow.
 
 import time
 import re
+import packet
 
 from test_case import TestCase
 from pmd_output import PmdOutput
@@ -115,18 +116,18 @@ class TestRSS_to_Rteflow(TestCase):
         """
         Sends packets.
         """
-        self.tester.scapy_foreground()
-        time.sleep(2)
+        pkt_list = []
         for i in range(128):
             if ptype == "ipv4-udp":
-                packet = r'sendp([Ether(dst="%s", src="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")/UDP(dport=%d, sport=%d)], iface="%s")' % (
-                    self.pf_mac, self.tester_mac, i + 1, i + 2, i + 21, i + 22, itf)
+                scapy_pkt = 'Ether(dst="%s", src="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")/UDP(dport=%d, sport=%d)' % (
+                    self.pf_mac, self.tester_mac, i + 1, i + 2, i + 21, i + 22)
             elif ptype == "ipv4-other":
-                packet = r'sendp([Ether(dst="%s", src="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")], iface="%s")' % (
-                    self.pf_mac, self.tester_mac, i + 1, i + 2, itf)
-            self.tester.scapy_append(packet)
-        self.tester.scapy_execute()
-        time.sleep(2)
+                scapy_pkt = 'Ether(dst="%s", src="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")' % (self.pf_mac, self.tester_mac, i + 1, i + 2)
+            pkt_list.append(scapy_pkt)
+
+        pkt = packet.Packet()
+        pkt.update_pkt(pkt_list)
+        pkt.send_pkt(self.tester, tx_port=itf)
 
     def check_packet_queue(self, queue, out):
         """
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dts] [PATCH V1] tests/rss_to_rte_flow:modify send_packet
  2020-01-19  9:34 [dts] [PATCH V1] tests/rss_to_rte_flow:modify send_packet Zeng Xiaoxiao
@ 2020-01-20  5:45 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2020-01-20  5:45 UTC (permalink / raw)
  To: Zeng, XiaoxiaoX, dts; +Cc: Zeng, XiaoxiaoX

applied

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Zeng Xiaoxiao
> Sent: Sunday, January 19, 2020 5:34 PM
> To: dts@dpdk.org
> Cc: Zeng, XiaoxiaoX <xiaoxiaox.zeng@intel.com>
> Subject: [dts] [PATCH V1] tests/rss_to_rte_flow:modify send_packet
> 
> Signed-off-by: Zeng Xiaoxiao <xiaoxiaox.zeng@intel.com>
> ---
>  tests/TestSuite_rss_to_rte_flow.py | 19 ++++++++++---------
>  1 file changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/tests/TestSuite_rss_to_rte_flow.py
> b/tests/TestSuite_rss_to_rte_flow.py
> index d062dd5..593d694 100644
> --- a/tests/TestSuite_rss_to_rte_flow.py
> +++ b/tests/TestSuite_rss_to_rte_flow.py
> @@ -38,6 +38,7 @@ Test moving RSS to rte_flow.
> 
>  import time
>  import re
> +import packet
> 
>  from test_case import TestCase
>  from pmd_output import PmdOutput
> @@ -115,18 +116,18 @@ class TestRSS_to_Rteflow(TestCase):
>          """
>          Sends packets.
>          """
> -        self.tester.scapy_foreground()
> -        time.sleep(2)
> +        pkt_list = []
>          for i in range(128):
>              if ptype == "ipv4-udp":
> -                packet = r'sendp([Ether(dst="%s", src="%s")/IP(src="192.168.0.%d",
> dst="192.168.0.%d")/UDP(dport=%d, sport=%d)], iface="%s")' % (
> -                    self.pf_mac, self.tester_mac, i + 1, i + 2, i + 21, i + 22, itf)
> +                scapy_pkt = 'Ether(dst="%s", src="%s")/IP(src="192.168.0.%d",
> dst="192.168.0.%d")/UDP(dport=%d, sport=%d)' % (
> +                    self.pf_mac, self.tester_mac, i + 1, i + 2, i + 21, i + 22)
>              elif ptype == "ipv4-other":
> -                packet = r'sendp([Ether(dst="%s", src="%s")/IP(src="192.168.0.%d",
> dst="192.168.0.%d")], iface="%s")' % (
> -                    self.pf_mac, self.tester_mac, i + 1, i + 2, itf)
> -            self.tester.scapy_append(packet)
> -        self.tester.scapy_execute()
> -        time.sleep(2)
> +                scapy_pkt = 'Ether(dst="%s", src="%s")/IP(src="192.168.0.%d",
> dst="192.168.0.%d")' % (self.pf_mac, self.tester_mac, i + 1, i + 2)
> +            pkt_list.append(scapy_pkt)
> +
> +        pkt = packet.Packet()
> +        pkt.update_pkt(pkt_list)
> +        pkt.send_pkt(self.tester, tx_port=itf)
> 
>      def check_packet_queue(self, queue, out):
>          """
> --
> 1.8.3.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-19  9:34 [dts] [PATCH V1] tests/rss_to_rte_flow:modify send_packet Zeng Xiaoxiao
2020-01-20  5:45 ` Tu, Lijuan

test suite reviews and discussions

Archives are clonable:
	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


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


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