test suite reviews and discussions
 help / color / Atom feed
* [dts]  [PATCH V2] tests/ kni: modify send_packet method
@ 2020-01-22  7:45 Zeng Xiaoxiao
  2020-01-22  8:50 ` Zhou, JunX W
  2020-02-10  8:57 ` Tu, Lijuan
  0 siblings, 2 replies; 3+ messages in thread
From: Zeng Xiaoxiao @ 2020-01-22  7:45 UTC (permalink / raw)
  To: dts; +Cc: Zeng Xiaoxiao

*.use scapy_append will cause drop packets.

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

diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py
index f1f85df..f611383 100644
--- a/tests/TestSuite_kni.py
+++ b/tests/TestSuite_kni.py
@@ -43,6 +43,7 @@ import time
 from random import randint
 from pktgen import PacketGeneratorHelper
 from test_case import TestCase
+import packet
 
 dut_ports = []
 port_virtual_interaces = []
@@ -259,6 +260,7 @@ class TestKni(TestCase):
                     "The linux tool brctl is needed to run this test suite")
 
         self.dut.send_expect("sed -i -e 's/KNI_KMOD_ETHTOOL=n$/KNI_KMOD_ETHTOOL=y/' config/common_base", "# ", 30)
+        self.dut.send_expect("sed -i -e 's/CONFIG_RTE_KNI_KMOD=n$/CONFIG_RTE_KNI_KMOD=y/' config/common_base", "# ", 30)
         self.dut.build_install_dpdk(self.target)
 
         out = self.dut.build_dpdk_apps("./examples/kni/")
@@ -707,20 +709,15 @@ class TestKni(TestCase):
             tx_mac = self.tester.get_mac(tx_port)
             tx_interface = self.tester.get_interface(tx_port)
 
-            self.tester.scapy_append('dstmac = "%s"' % rx_mac)
-            self.tester.scapy_append('srcmac = "%s"' % tx_mac)
+            scapy_str = ['Ether(src = "%s",dst="%s")/IP()/UDP()/("X"*28)' % (tx_mac, rx_mac),
+                         'Ether(src = "%s",dst="%s")/IP()/TCP()/("X"*28)' % (tx_mac, rx_mac),
+                         'Ether(src = "%s",dst="%s")/IP()/ICMP()/("X"*28)' % (tx_mac, rx_mac),
+                         'Ether(src = "%s",dst="%s")/IP()/("X"*38)' % (tx_mac, rx_mac),
+                         'Ether(src = "%s",dst="%s")/("X"*46)' % (tx_mac, rx_mac), ]
 
-            self.tester.scapy_append(
-                'sendp([Ether(src = srcmac,dst=dstmac)/IP()/UDP()/("X"*28)],iface="%s",count=200)' % tx_interface)
-            self.tester.scapy_append(
-                'sendp([Ether(src = srcmac,dst=dstmac)/IP()/TCP()/("X"*28)],iface="%s",count=200)' % tx_interface)
-            self.tester.scapy_append(
-                'sendp([Ether(src = srcmac,dst=dstmac)/IP()/ICMP()/("X"*28)],iface="%s",count=200)' % tx_interface)
-            self.tester.scapy_append(
-                'sendp([Ether(src = srcmac,dst=dstmac)/IP()/("X"*38)],iface="%s",count=200)' % tx_interface)
-            self.tester.scapy_append(
-                'sendp([Ether(src = srcmac,dst=dstmac)/("X"*46)],iface="%s",count=200)' % tx_interface)
-            self.tester.scapy_execute()
+            pkt = packet.Packet()
+            pkt.update_pkt(scapy_str)
+            pkt.send_pkt(self.tester, tx_port=tx_interface, count=200)
 
             out = self.dut.send_expect("ifconfig %s" % virtual_interface, "# ")
             m = re.search(rx_match, out)
-- 
1.8.3.1


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

* Re: [dts] [PATCH V2] tests/ kni: modify send_packet method
  2020-01-22  7:45 [dts] [PATCH V2] tests/ kni: modify send_packet method Zeng Xiaoxiao
@ 2020-01-22  8:50 ` Zhou, JunX W
  2020-02-10  8:57 ` Tu, Lijuan
  1 sibling, 0 replies; 3+ messages in thread
From: Zhou, JunX W @ 2020-01-22  8:50 UTC (permalink / raw)
  To: Zeng, XiaoxiaoX, dts; +Cc: Zeng, XiaoxiaoX

[-- Attachment #1: Type: text/plain, Size: 3255 bytes --]

Tested_by: Zhou, JunX W<junx.w.zhou@intel.com>

-----Original Message-----
From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Zeng Xiaoxiao
Sent: Wednesday, January 22, 2020 3:45 PM
To: dts@dpdk.org
Cc: Zeng, XiaoxiaoX <xiaoxiaox.zeng@intel.com>
Subject: [dts] [PATCH V2] tests/ kni: modify send_packet method

*.use scapy_append will cause drop packets.

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

diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py index f1f85df..f611383 100644
--- a/tests/TestSuite_kni.py
+++ b/tests/TestSuite_kni.py
@@ -43,6 +43,7 @@ import time
 from random import randint
 from pktgen import PacketGeneratorHelper  from test_case import TestCase
+import packet
 
 dut_ports = []
 port_virtual_interaces = []
@@ -259,6 +260,7 @@ class TestKni(TestCase):
                     "The linux tool brctl is needed to run this test suite")
 
         self.dut.send_expect("sed -i -e 's/KNI_KMOD_ETHTOOL=n$/KNI_KMOD_ETHTOOL=y/' config/common_base", "# ", 30)
+        self.dut.send_expect("sed -i -e 
+ 's/CONFIG_RTE_KNI_KMOD=n$/CONFIG_RTE_KNI_KMOD=y/' config/common_base", 
+ "# ", 30)
         self.dut.build_install_dpdk(self.target)
 
         out = self.dut.build_dpdk_apps("./examples/kni/")
@@ -707,20 +709,15 @@ class TestKni(TestCase):
             tx_mac = self.tester.get_mac(tx_port)
             tx_interface = self.tester.get_interface(tx_port)
 
-            self.tester.scapy_append('dstmac = "%s"' % rx_mac)
-            self.tester.scapy_append('srcmac = "%s"' % tx_mac)
+            scapy_str = ['Ether(src = "%s",dst="%s")/IP()/UDP()/("X"*28)' % (tx_mac, rx_mac),
+                         'Ether(src = "%s",dst="%s")/IP()/TCP()/("X"*28)' % (tx_mac, rx_mac),
+                         'Ether(src = "%s",dst="%s")/IP()/ICMP()/("X"*28)' % (tx_mac, rx_mac),
+                         'Ether(src = "%s",dst="%s")/IP()/("X"*38)' % (tx_mac, rx_mac),
+                         'Ether(src = "%s",dst="%s")/("X"*46)' % 
+ (tx_mac, rx_mac), ]
 
-            self.tester.scapy_append(
-                'sendp([Ether(src = srcmac,dst=dstmac)/IP()/UDP()/("X"*28)],iface="%s",count=200)' % tx_interface)
-            self.tester.scapy_append(
-                'sendp([Ether(src = srcmac,dst=dstmac)/IP()/TCP()/("X"*28)],iface="%s",count=200)' % tx_interface)
-            self.tester.scapy_append(
-                'sendp([Ether(src = srcmac,dst=dstmac)/IP()/ICMP()/("X"*28)],iface="%s",count=200)' % tx_interface)
-            self.tester.scapy_append(
-                'sendp([Ether(src = srcmac,dst=dstmac)/IP()/("X"*38)],iface="%s",count=200)' % tx_interface)
-            self.tester.scapy_append(
-                'sendp([Ether(src = srcmac,dst=dstmac)/("X"*46)],iface="%s",count=200)' % tx_interface)
-            self.tester.scapy_execute()
+            pkt = packet.Packet()
+            pkt.update_pkt(scapy_str)
+            pkt.send_pkt(self.tester, tx_port=tx_interface, count=200)
 
             out = self.dut.send_expect("ifconfig %s" % virtual_interface, "# ")
             m = re.search(rx_match, out)
--
1.8.3.1


[-- Attachment #2: TestKni.log --]
[-- Type: application/octet-stream, Size: 2686976 bytes --]

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

* Re: [dts] [PATCH V2] tests/ kni: modify send_packet method
  2020-01-22  7:45 [dts] [PATCH V2] tests/ kni: modify send_packet method Zeng Xiaoxiao
  2020-01-22  8:50 ` Zhou, JunX W
@ 2020-02-10  8:57 ` Tu, Lijuan
  1 sibling, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2020-02-10  8:57 UTC (permalink / raw)
  To: Zeng, XiaoxiaoX, dts; +Cc: Zeng, XiaoxiaoX

Applied, thanks

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Zeng Xiaoxiao
> Sent: Wednesday, January 22, 2020 3:45 PM
> To: dts@dpdk.org
> Cc: Zeng, XiaoxiaoX <xiaoxiaox.zeng@intel.com>
> Subject: [dts] [PATCH V2] tests/ kni: modify send_packet method
> 
> *.use scapy_append will cause drop packets.
> 
> Signed-off-by: Zeng Xiaoxiao <xiaoxiaox.zeng@intel.com>
> ---
>  tests/TestSuite_kni.py | 23 ++++++++++-------------
>  1 file changed, 10 insertions(+), 13 deletions(-)
> 
> diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py index
> f1f85df..f611383 100644
> --- a/tests/TestSuite_kni.py
> +++ b/tests/TestSuite_kni.py
> @@ -43,6 +43,7 @@ import time
>  from random import randint
>  from pktgen import PacketGeneratorHelper  from test_case import TestCase
> +import packet
> 
>  dut_ports = []
>  port_virtual_interaces = []
> @@ -259,6 +260,7 @@ class TestKni(TestCase):
>                      "The linux tool brctl is needed to run this test suite")
> 
>          self.dut.send_expect("sed -i -e
> 's/KNI_KMOD_ETHTOOL=n$/KNI_KMOD_ETHTOOL=y/'
> config/common_base", "# ", 30)
> +        self.dut.send_expect("sed -i -e
> + 's/CONFIG_RTE_KNI_KMOD=n$/CONFIG_RTE_KNI_KMOD=y/'
> config/common_base",
> + "# ", 30)
>          self.dut.build_install_dpdk(self.target)
> 
>          out = self.dut.build_dpdk_apps("./examples/kni/")
> @@ -707,20 +709,15 @@ class TestKni(TestCase):
>              tx_mac = self.tester.get_mac(tx_port)
>              tx_interface = self.tester.get_interface(tx_port)
> 
> -            self.tester.scapy_append('dstmac = "%s"' % rx_mac)
> -            self.tester.scapy_append('srcmac = "%s"' % tx_mac)
> +            scapy_str = ['Ether(src = "%s",dst="%s")/IP()/UDP()/("X"*28)' %
> (tx_mac, rx_mac),
> +                         'Ether(src = "%s",dst="%s")/IP()/TCP()/("X"*28)' % (tx_mac,
> rx_mac),
> +                         'Ether(src = "%s",dst="%s")/IP()/ICMP()/("X"*28)' % (tx_mac,
> rx_mac),
> +                         'Ether(src = "%s",dst="%s")/IP()/("X"*38)' % (tx_mac, rx_mac),
> +                         'Ether(src = "%s",dst="%s")/("X"*46)' %
> + (tx_mac, rx_mac), ]
> 
> -            self.tester.scapy_append(
> -                'sendp([Ether(src =
> srcmac,dst=dstmac)/IP()/UDP()/("X"*28)],iface="%s",count=200)' %
> tx_interface)
> -            self.tester.scapy_append(
> -                'sendp([Ether(src =
> srcmac,dst=dstmac)/IP()/TCP()/("X"*28)],iface="%s",count=200)' %
> tx_interface)
> -            self.tester.scapy_append(
> -                'sendp([Ether(src =
> srcmac,dst=dstmac)/IP()/ICMP()/("X"*28)],iface="%s",count=200)' %
> tx_interface)
> -            self.tester.scapy_append(
> -                'sendp([Ether(src =
> srcmac,dst=dstmac)/IP()/("X"*38)],iface="%s",count=200)' % tx_interface)
> -            self.tester.scapy_append(
> -                'sendp([Ether(src =
> srcmac,dst=dstmac)/("X"*46)],iface="%s",count=200)' % tx_interface)
> -            self.tester.scapy_execute()
> +            pkt = packet.Packet()
> +            pkt.update_pkt(scapy_str)
> +            pkt.send_pkt(self.tester, tx_port=tx_interface, count=200)
> 
>              out = self.dut.send_expect("ifconfig %s" % virtual_interface, "# ")
>              m = re.search(rx_match, out)
> --
> 1.8.3.1


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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-22  7:45 [dts] [PATCH V2] tests/ kni: modify send_packet method Zeng Xiaoxiao
2020-01-22  8:50 ` Zhou, JunX W
2020-02-10  8:57 ` 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