Fix for some tests that verify packets caught by scapy filters
Change-Id: I87b113ea0add90ba473af24514367df5e40e6399
(cherry picked from commit 671e8a518c5d76abf9efb3cae057469cd17a3d64)
diff --git a/TestON/drivers/common/cli/emulator/scapyclidriver.py b/TestON/drivers/common/cli/emulator/scapyclidriver.py
index e2d5b0b..bcaebfb 100644
--- a/TestON/drivers/common/cli/emulator/scapyclidriver.py
+++ b/TestON/drivers/common/cli/emulator/scapyclidriver.py
@@ -877,7 +877,7 @@
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanAndExit()
- def readPackets( self ):
+ def readPackets( self, detailed=False ):
"""
Read all the packets captured by the previous filter
"""
@@ -887,7 +887,10 @@
self.clearBuffer()
main.log.debug( self.name + ": end clear buffer" )
- self.handle.sendline( "pkts.summary()")
+ if detailed:
+ self.handle.sendline( "[p for p in pkts]")
+ else:
+ self.handle.sendline( "pkts.summary()")
output = self.clearBuffer()
except pexpect.TIMEOUT:
main.log.exception( self.name + ": Command timed out" )
diff --git a/TestON/tests/dependencies/topology.py b/TestON/tests/dependencies/topology.py
index 720bf92..7cdd9ab 100644
--- a/TestON/tests/dependencies/topology.py
+++ b/TestON/tests/dependencies/topology.py
@@ -361,7 +361,7 @@
finished = receiver.checkFilter()
packet = ""
if finished:
- packets = receiver.readPackets()
+ packets = receiver.readPackets( detailed=True )
for packet in packets.splitlines():
main.log.debug( packet )
else:
@@ -448,7 +448,7 @@
finished = dstHandle.checkFilter()
packet = ""
if finished:
- packets = dstHandle.readPackets()
+ packets = receiver.readPackets( detailed=True )
for packet in packets.splitlines():
main.log.debug( packet )
else: