Simplify test/util.py:ppp.
Change-Id: I10596335c7e8f51afc4bcee75132b7a25ebf2a4e Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
This commit is contained in:

committed by
Damjan Marion

parent
9889402b79
commit
b951ad84ab
12
test/util.py
12
test/util.py
@ -19,15 +19,9 @@ from vpp_papi import mac_pton
|
|||||||
|
|
||||||
def ppp(headline, packet):
|
def ppp(headline, packet):
|
||||||
""" Return string containing the output of scapy packet.show() call. """
|
""" Return string containing the output of scapy packet.show() call. """
|
||||||
o = BytesIO()
|
return '%s\n%s\n\n%s\n' % (headline,
|
||||||
old_stdout = sys.stdout
|
hexdump(packet, dump=True),
|
||||||
sys.stdout = o
|
packet.show(dump=True))
|
||||||
print(headline)
|
|
||||||
hexdump(packet)
|
|
||||||
print("")
|
|
||||||
packet.show()
|
|
||||||
sys.stdout = old_stdout
|
|
||||||
return o.getvalue()
|
|
||||||
|
|
||||||
|
|
||||||
def ppc(headline, capture, limit=10):
|
def ppc(headline, capture, limit=10):
|
||||||
|
Reference in New Issue
Block a user