Code Review
/
vpp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
9889402
)
Simplify test/util.py:ppp.
32/16732/3
author
Paul Vinciguerra
<
[email protected]
>
Wed, 9 Jan 2019 05:36:39 +0000
(21:36 -0800)
committer
Damjan Marion
<
[email protected]
>
Mon, 21 Jan 2019 15:33:00 +0000
(15:33 +0000)
Change-Id: I10596335c7e8f51afc4bcee75132b7a25ebf2a4e
Signed-off-by: Paul Vinciguerra <
[email protected]
>
test/util.py
patch
|
blob
|
history
diff --git
a/test/util.py
b/test/util.py
index
9652b80
..
cf45c85
100644
(file)
--- 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):