summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-01-08 21:36:39 -0800
committerDamjan Marion <dmarion@me.com>2019-01-21 15:33:00 +0000
commitb951ad84ab542aaebb646bf61130618b5fef8bda (patch)
tree3bf5a0ee6fec5425ffdfee6e4172fcdf8fb34965 /test
parent9889402b79240d679568ba9b3eaa39e631a0b2e5 (diff)
Simplify test/util.py:ppp.
Change-Id: I10596335c7e8f51afc4bcee75132b7a25ebf2a4e Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test')
-rw-r--r--test/util.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/test/util.py b/test/util.py
index 9652b803f1d..cf45c85a5f4 100644
--- a/test/util.py
+++ b/test/util.py
@@ -19,15 +19,9 @@ from vpp_papi import mac_pton
def ppp(headline, packet):
""" Return string containing the output of scapy packet.show() call. """
- o = BytesIO()
- old_stdout = sys.stdout
- sys.stdout = o
- print(headline)
- hexdump(packet)
- print("")
- packet.show()
- sys.stdout = old_stdout
- return o.getvalue()
+ return '%s\n%s\n\n%s\n' % (headline,
+ hexdump(packet, dump=True),
+ packet.show(dump=True))
def ppc(headline, capture, limit=10):