[dts] [PATCH v2 12/17] tests/userspace_ethtool: Replace sniff_packets to tester.tcpdump_sniff_packets

Phil Yang phil.yang at arm.com
Fri Mar 30 12:41:04 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_userspace_ethtool.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/TestSuite_userspace_ethtool.py b/tests/TestSuite_userspace_ethtool.py
index 84b1f1e..4a37a0b 100644
--- a/tests/TestSuite_userspace_ethtool.py
+++ b/tests/TestSuite_userspace_ethtool.py
@@ -39,7 +39,6 @@ import utils
 import time
 import re
 from test_case import TestCase
-from packet import Packet, sniff_packets, load_sniff_packets
 import random
 from etgen import IxiaPacketGenerator
 from settings import HEADER_SIZE
@@ -478,9 +477,10 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
             tester_port = self.tester.get_local_port(port)
             intf = self.tester.get_interface(tester_port)
             # send and sniff packet
-            inst = sniff_packets(intf, timeout=5)
+            inst = self.tester.tcpdump_sniff_packets(intf, timeout=5)
             pkt.send_pkt(tx_port=intf)
-            pkts = load_sniff_packets(inst)
+            self.tester.session.copy_file_from("/tmp/sniff_%s.pcap" % intf, "/tmp/")
+            pkts = self.tester.load_tcpdump_sniff_packets(inst)
             self.verify(len(pkts) == 1, "Packet not forwarded as expected")
             src_mac = pkts[0].strip_layer_element("layer2", "src")
             self.verify(src_mac == valid_mac, "Forwarded packet not match default mac")
-- 
2.7.4



More information about the dts mailing list