aboutsummaryrefslogtreecommitdiffstats
path: root/test/vpp_pg_interface.py
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2017-01-02 10:18:34 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2017-01-02 22:55:09 +0000
commita913534837441c59e3f7717089f57fdbcda476b9 (patch)
tree93a19255b0af1158c9da23496a497f0c9c38fc1b /test/vpp_pg_interface.py
parentc86fa02201750a4770d7dab07b2294a5072fc1b9 (diff)
make test: rotate capture files after consuming arp/ndp
Change-Id: I512dc07638b4539d4a75e2ac40d3acee77f0bba6 Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/vpp_pg_interface.py')
-rw-r--r--test/vpp_pg_interface.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/vpp_pg_interface.py b/test/vpp_pg_interface.py
index d3db8d208a3..a79af037098 100644
--- a/test/vpp_pg_interface.py
+++ b/test/vpp_pg_interface.py
@@ -91,8 +91,7 @@ class VppPGInterface(VppInterface):
self._input_cli = "packet-generator new pcap %s source pg%u name %s" % (
self.in_path, self.pg_index, self.cap_name)
- def enable_capture(self):
- """ Enable capture on this packet-generator interface"""
+ def rotate_out_file(self):
try:
if os.path.isfile(self.out_path):
os.rename(self.out_path,
@@ -104,6 +103,10 @@ class VppPGInterface(VppInterface):
self._out_file))
except:
pass
+
+ def enable_capture(self):
+ """ Enable capture on this packet-generator interface"""
+ self.rotate_out_file()
# FIXME this should be an API, but no such exists atm
self.test.vapi.cli(self.capture_cli)
self._pcap_reader = None
@@ -328,6 +331,7 @@ class VppPGInterface(VppInterface):
self.test.logger.info("No ARP received on port %s" %
pg_interface.name)
return
+ self.rotate_out_file()
arp_reply = captured_packet.copy() # keep original for exception
# Make Dot1AD packet content recognizable to scapy
if arp_reply.type == 0x88a8:
@@ -387,6 +391,7 @@ class VppPGInterface(VppInterface):
self._local_mac = opt.lladdr
self.test.logger.debug(self.test.vapi.cli("show trace"))
# we now have the MAC we've been after
+ self.rotate_out_file()
return
except:
self.test.logger.info(
@@ -394,4 +399,5 @@ class VppPGInterface(VppInterface):
now = time.time()
self.test.logger.debug(self.test.vapi.cli("show trace"))
+ self.rotate_out_file()
raise Exception("Timeout while waiting for NDP response")