[dts] [PATCH v2 16/17] tests/vlan: Replace sniff_packets to tester.tcpdump_sniff_packets

Phil Yang phil.yang at arm.com
Fri Mar 30 12:41:08 CEST 2018


Make sniff_packet running on the tester. Create a ssh connection to the
tester then call tcpdump.

Signed-off-by: Phil Yang <phil.yang at arm.com>
---
 tests/TestSuite_vlan.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/TestSuite_vlan.py b/tests/TestSuite_vlan.py
index 0f1833b..16841dc 100644
--- a/tests/TestSuite_vlan.py
+++ b/tests/TestSuite_vlan.py
@@ -43,7 +43,6 @@ import time
 
 from test_case import TestCase
 from pmd_output import PmdOutput
-from packet import Packet, sniff_packets, load_sniff_packets
 
 
 class TestVlan(TestCase):
@@ -88,7 +87,8 @@ class TestVlan(TestCase):
             netobj.add_vlan(vlan_id = self.vlan)
 
     def get_tcpdump_package(self):
-        pkts = load_sniff_packets(self.inst)
+        self.tester.session.copy_file_from("/tmp/sniff_%s.pcap" % self.rxItf, "/tmp/")
+        pkts = self.tester.load_tcpdump_sniff_packets(self.inst)
         vlans = []
         for packet in pkts:
             vlan = packet.strip_element_vlan("vlan")
@@ -110,7 +110,7 @@ class TestVlan(TestCase):
         # the package dect mac must is dut tx port id when the port promisc is off
         self.dmac = self.dut.get_mac_address(dutRxPortId)
 
-        self.inst = sniff_packets(self.rxItf)
+        self.inst = self.tester.tcpdump_sniff_packets(self.rxItf)
         # FIXME  send a burst with only num packet
         if vid == -1:
             pkt = Packet(pkt_type='UDP')
-- 
2.7.4



More information about the dts mailing list