test suite reviews and discussions
 help / color / mirror / 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

end of thread, other threads:[~2020-01-20  5:45 UTC | newest]

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

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).