* [dts] [PATCH] tests mac_filter: use scapy to send packets @ 2016-12-02 2:45 Jianbo Liu 2016-12-02 3:27 ` Liu, Yong 0 siblings, 1 reply; 7+ messages in thread From: Jianbo Liu @ 2016-12-02 2:45 UTC (permalink / raw) To: dts; +Cc: Jianbo Liu Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org> --- tests/TestSuite_mac_filter.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/TestSuite_mac_filter.py b/tests/TestSuite_mac_filter.py index 1c58b87..a06b812 100644 --- a/tests/TestSuite_mac_filter.py +++ b/tests/TestSuite_mac_filter.py @@ -86,9 +86,10 @@ class TestWhitelist(TestCase): Send 1 packet to portid. """ itf = self.tester.get_interface(self.tester.get_local_port(portid)) - pkt = Packet(pkt_type='UDP') - pkt.config_layer('ether', {'src': '52:00:00:00:00:00', 'dst': destMac}) - pkt.send_pkt(tx_port=itf) + pkt = 'Ether(dst="%s", src="52:00:00:00:00:00")/IP()/UDP()/("X"*46)' % destMac + self.tester.send_expect("scapy", ">>> ") + self.tester.scapy_append('sendp([%s], iface="%s")' % (pkt, itf)) + self.tester.scapy_execute() def test_add_remove_mac_address(self): """ -- 1.9.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dts] [PATCH] tests mac_filter: use scapy to send packets 2016-12-02 2:45 [dts] [PATCH] tests mac_filter: use scapy to send packets Jianbo Liu @ 2016-12-02 3:27 ` Liu, Yong 2016-12-02 3:45 ` Jianbo Liu 0 siblings, 1 reply; 7+ messages in thread From: Liu, Yong @ 2016-12-02 3:27 UTC (permalink / raw) To: Jianbo Liu, dts Hi Jianbo, Packet module is one abstract layer based on scapy. We abstracted this layer for monitoring scapy process and integrating sniff/configuration function. It should work the same as scapy command. I'm interesting in why your intended to use scapy replace of Packet module. Thanks, Marvin > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Jianbo Liu > Sent: Friday, December 02, 2016 10:46 AM > To: dts@dpdk.org > Cc: Jianbo Liu > Subject: [dts] [PATCH] tests mac_filter: use scapy to send packets > > Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org> > --- > tests/TestSuite_mac_filter.py | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/tests/TestSuite_mac_filter.py b/tests/TestSuite_mac_filter.py > index 1c58b87..a06b812 100644 > --- a/tests/TestSuite_mac_filter.py > +++ b/tests/TestSuite_mac_filter.py > @@ -86,9 +86,10 @@ class TestWhitelist(TestCase): > Send 1 packet to portid. > """ > itf = > self.tester.get_interface(self.tester.get_local_port(portid)) > - pkt = Packet(pkt_type='UDP') > - pkt.config_layer('ether', {'src': '52:00:00:00:00:00', 'dst': > destMac}) > - pkt.send_pkt(tx_port=itf) > + pkt = 'Ether(dst="%s", > src="52:00:00:00:00:00")/IP()/UDP()/("X"*46)' % destMac > + self.tester.send_expect("scapy", ">>> ") > + self.tester.scapy_append('sendp([%s], iface="%s")' % (pkt, itf)) > + self.tester.scapy_execute() > > def test_add_remove_mac_address(self): > """ > -- > 1.9.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dts] [PATCH] tests mac_filter: use scapy to send packets 2016-12-02 3:27 ` Liu, Yong @ 2016-12-02 3:45 ` Jianbo Liu 2016-12-02 5:44 ` Liu, Yong 0 siblings, 1 reply; 7+ messages in thread From: Jianbo Liu @ 2016-12-02 3:45 UTC (permalink / raw) To: Liu, Yong; +Cc: dts Hi Marvin, On 2 December 2016 at 11:27, Liu, Yong <yong.liu@intel.com> wrote: > Hi Jianbo, > Packet module is one abstract layer based on scapy. We abstracted this layer for monitoring scapy process and integrating sniff/configuration function. > It should work the same as scapy command. I'm interesting in why your intended to use scapy replace of Packet module. > I assume dts can be run on a different machine from tester. Am I right? But I got the following error, as the module sends packets through its local port, not the tester's port, but they are different if dts is not run on tester machine. ERROR: Test Case test_add_remove_mac_address Result ERROR: Traceback (most recent call last): File "/home/liujb/work/src/dts/framework/test_case.py", line 282, in _execute_test_case case_obj() File "/home/liujb/work/src/dts/tests/TestSuite_mac_filter.py", line 109, in test_add_remove_mac_address self.whitelist_send_packet(portid, self.dest) File "/home/liujb/work/src/dts/tests/TestSuite_mac_filter.py", line 91, in whitelist_send_packet pkt.send_pkt(tx_port=itf) File "/home/liujb/work/src/dts/framework/packet.py", line 464, in send_pkt self.pktgen.send_pkt(intf=self.tx_port) File "/home/liujb/work/src/dts/framework/packet.py", line 348, in send_pkt self.pkt.getlayer(0).src = get_if_hwaddr(intf) File "/usr/lib/python2.7/dist-packages/scapy/arch/__init__.py", line 39, in get_if_hwaddr addrfamily, mac = get_if_raw_hwaddr(iff) File "/usr/lib/python2.7/dist-packages/scapy/arch/linux.py", line 82, in get_if_raw_hwaddr return struct.unpack("16xh6s8x",get_if(iff,SIOCGIFHWADDR)) File "/usr/lib/python2.7/dist-packages/scapy/arch/linux.py", line 269, in get_if ifreq = ioctl(s, cmd, struct.pack("16s16x",iff)) IOError: [Errno 19] No such device > Thanks, > Marvin > >> -----Original Message----- >> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Jianbo Liu >> Sent: Friday, December 02, 2016 10:46 AM >> To: dts@dpdk.org >> Cc: Jianbo Liu >> Subject: [dts] [PATCH] tests mac_filter: use scapy to send packets >> >> Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org> >> --- >> tests/TestSuite_mac_filter.py | 7 ++++--- >> 1 file changed, 4 insertions(+), 3 deletions(-) >> >> diff --git a/tests/TestSuite_mac_filter.py b/tests/TestSuite_mac_filter.py >> index 1c58b87..a06b812 100644 >> --- a/tests/TestSuite_mac_filter.py >> +++ b/tests/TestSuite_mac_filter.py >> @@ -86,9 +86,10 @@ class TestWhitelist(TestCase): >> Send 1 packet to portid. >> """ >> itf = >> self.tester.get_interface(self.tester.get_local_port(portid)) >> - pkt = Packet(pkt_type='UDP') >> - pkt.config_layer('ether', {'src': '52:00:00:00:00:00', 'dst': >> destMac}) >> - pkt.send_pkt(tx_port=itf) >> + pkt = 'Ether(dst="%s", >> src="52:00:00:00:00:00")/IP()/UDP()/("X"*46)' % destMac >> + self.tester.send_expect("scapy", ">>> ") >> + self.tester.scapy_append('sendp([%s], iface="%s")' % (pkt, itf)) >> + self.tester.scapy_execute() >> >> def test_add_remove_mac_address(self): >> """ >> -- >> 1.9.1 > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dts] [PATCH] tests mac_filter: use scapy to send packets 2016-12-02 3:45 ` Jianbo Liu @ 2016-12-02 5:44 ` Liu, Yong 2016-12-02 6:06 ` Jianbo Liu 0 siblings, 1 reply; 7+ messages in thread From: Liu, Yong @ 2016-12-02 5:44 UTC (permalink / raw) To: Jianbo Liu; +Cc: dts Jianbo, could you explain your usage model? We are now running DTS on tester machine. > -----Original Message----- > From: Jianbo Liu [mailto:jianbo.liu@linaro.org] > Sent: Friday, December 02, 2016 11:45 AM > To: Liu, Yong > Cc: dts@dpdk.org > Subject: Re: [dts] [PATCH] tests mac_filter: use scapy to send packets > > Hi Marvin, > > On 2 December 2016 at 11:27, Liu, Yong <yong.liu@intel.com> wrote: > > Hi Jianbo, > > Packet module is one abstract layer based on scapy. We abstracted this > layer for monitoring scapy process and integrating sniff/configuration > function. > > It should work the same as scapy command. I'm interesting in why your > intended to use scapy replace of Packet module. > > > I assume dts can be run on a different machine from tester. Am I right? > But I got the following error, as the module sends packets through its > local port, not the tester's port, but they are different if dts is > not run on tester machine. Yes, that's our original plan. But based on time efficiency and real usage model, we assume Tester and DTS will use same machine. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dts] [PATCH] tests mac_filter: use scapy to send packets 2016-12-02 5:44 ` Liu, Yong @ 2016-12-02 6:06 ` Jianbo Liu 2016-12-02 6:13 ` Liu, Yong 0 siblings, 1 reply; 7+ messages in thread From: Jianbo Liu @ 2016-12-02 6:06 UTC (permalink / raw) To: Liu, Yong; +Cc: dts On 2 December 2016 at 13:44, Liu, Yong <yong.liu@intel.com> wrote: > Jianbo, could you explain your usage model? We are now running DTS on tester machine. > We want to integrate it into our CI environment. If running DTS on tester, it's very hard to setup. How does Intel setup these automation testings? >> -----Original Message----- >> From: Jianbo Liu [mailto:jianbo.liu@linaro.org] >> Sent: Friday, December 02, 2016 11:45 AM >> To: Liu, Yong >> Cc: dts@dpdk.org >> Subject: Re: [dts] [PATCH] tests mac_filter: use scapy to send packets >> >> Hi Marvin, >> >> On 2 December 2016 at 11:27, Liu, Yong <yong.liu@intel.com> wrote: >> > Hi Jianbo, >> > Packet module is one abstract layer based on scapy. We abstracted this >> layer for monitoring scapy process and integrating sniff/configuration >> function. >> > It should work the same as scapy command. I'm interesting in why your >> intended to use scapy replace of Packet module. >> > >> I assume dts can be run on a different machine from tester. Am I right? >> But I got the following error, as the module sends packets through its >> local port, not the tester's port, but they are different if dts is >> not run on tester machine. > > Yes, that's our original plan. But based on time efficiency and real usage model, we assume > Tester and DTS will use same machine. > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dts] [PATCH] tests mac_filter: use scapy to send packets 2016-12-02 6:06 ` Jianbo Liu @ 2016-12-02 6:13 ` Liu, Yong 2016-12-02 6:32 ` Jianbo Liu 0 siblings, 1 reply; 7+ messages in thread From: Liu, Yong @ 2016-12-02 6:13 UTC (permalink / raw) To: Jianbo Liu; +Cc: dts Jianbo, we use Jekins to schedule our automation tasks. DTS is used for generate function/performance result. All results on test machines will be collected and summary by Jekins Job. > -----Original Message----- > From: Jianbo Liu [mailto:jianbo.liu@linaro.org] > Sent: Friday, December 02, 2016 2:07 PM > To: Liu, Yong > Cc: dts@dpdk.org > Subject: Re: [dts] [PATCH] tests mac_filter: use scapy to send packets > > On 2 December 2016 at 13:44, Liu, Yong <yong.liu@intel.com> wrote: > > Jianbo, could you explain your usage model? We are now running DTS on > tester machine. > > > > We want to integrate it into our CI environment. If running DTS on > tester, it's very hard to setup. > How does Intel setup these automation testings? > > >> -----Original Message----- > >> From: Jianbo Liu [mailto:jianbo.liu@linaro.org] > >> Sent: Friday, December 02, 2016 11:45 AM > >> To: Liu, Yong > >> Cc: dts@dpdk.org > >> Subject: Re: [dts] [PATCH] tests mac_filter: use scapy to send packets > >> > >> Hi Marvin, > >> > >> On 2 December 2016 at 11:27, Liu, Yong <yong.liu@intel.com> wrote: > >> > Hi Jianbo, > >> > Packet module is one abstract layer based on scapy. We abstracted > this > >> layer for monitoring scapy process and integrating sniff/configuration > >> function. > >> > It should work the same as scapy command. I'm interesting in why your > >> intended to use scapy replace of Packet module. > >> > > >> I assume dts can be run on a different machine from tester. Am I right? > >> But I got the following error, as the module sends packets through its > >> local port, not the tester's port, but they are different if dts is > >> not run on tester machine. > > > > Yes, that's our original plan. But based on time efficiency and real > usage model, we assume > > Tester and DTS will use same machine. > > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dts] [PATCH] tests mac_filter: use scapy to send packets 2016-12-02 6:13 ` Liu, Yong @ 2016-12-02 6:32 ` Jianbo Liu 0 siblings, 0 replies; 7+ messages in thread From: Jianbo Liu @ 2016-12-02 6:32 UTC (permalink / raw) To: Liu, Yong; +Cc: dts On 2 December 2016 at 14:13, Liu, Yong <yong.liu@intel.com> wrote: > Jianbo, we use Jekins to schedule our automation tasks. DTS is used for generate function/performance result. > All results on test machines will be collected and summary by Jekins Job. > Thanks, that is what I want to achieve... >> -----Original Message----- >> From: Jianbo Liu [mailto:jianbo.liu@linaro.org] >> Sent: Friday, December 02, 2016 2:07 PM >> To: Liu, Yong >> Cc: dts@dpdk.org >> Subject: Re: [dts] [PATCH] tests mac_filter: use scapy to send packets >> >> On 2 December 2016 at 13:44, Liu, Yong <yong.liu@intel.com> wrote: >> > Jianbo, could you explain your usage model? We are now running DTS on >> tester machine. >> > >> >> We want to integrate it into our CI environment. If running DTS on >> tester, it's very hard to setup. >> How does Intel setup these automation testings? >> >> >> -----Original Message----- >> >> From: Jianbo Liu [mailto:jianbo.liu@linaro.org] >> >> Sent: Friday, December 02, 2016 11:45 AM >> >> To: Liu, Yong >> >> Cc: dts@dpdk.org >> >> Subject: Re: [dts] [PATCH] tests mac_filter: use scapy to send packets >> >> >> >> Hi Marvin, >> >> >> >> On 2 December 2016 at 11:27, Liu, Yong <yong.liu@intel.com> wrote: >> >> > Hi Jianbo, >> >> > Packet module is one abstract layer based on scapy. We abstracted >> this >> >> layer for monitoring scapy process and integrating sniff/configuration >> >> function. >> >> > It should work the same as scapy command. I'm interesting in why your >> >> intended to use scapy replace of Packet module. >> >> > >> >> I assume dts can be run on a different machine from tester. Am I right? >> >> But I got the following error, as the module sends packets through its >> >> local port, not the tester's port, but they are different if dts is >> >> not run on tester machine. >> > >> > Yes, that's our original plan. But based on time efficiency and real >> usage model, we assume >> > Tester and DTS will use same machine. Can we keep the original design, because it looks strange that some parts of dts can be run on different machine, others must on the same machine as tester? ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-12-02 6:32 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-12-02 2:45 [dts] [PATCH] tests mac_filter: use scapy to send packets Jianbo Liu 2016-12-02 3:27 ` Liu, Yong 2016-12-02 3:45 ` Jianbo Liu 2016-12-02 5:44 ` Liu, Yong 2016-12-02 6:06 ` Jianbo Liu 2016-12-02 6:13 ` Liu, Yong 2016-12-02 6:32 ` Jianbo Liu
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).