summaryrefslogtreecommitdiffstats
path: root/test/test_classifier_ip6.py
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2018-11-25 10:35:29 -0800
committerOle Trøan <otroan@employees.org>2018-11-27 09:01:27 +0000
commit6e4c6ad92e59045f0babf5af5093cb8402ec37fb (patch)
tree59edf45a2f162be15a7603540b399cefa8990670 /test/test_classifier_ip6.py
parent6c746172ef2a8ab7b6a267a889fedd1336f00371 (diff)
VPP-1508 python3 tests: .encode('hex')
Change to binascii.hexlify() for consistent bahavior. Change-Id: Ie430cdd1ffeb6510db4aa037546e42d85992093b Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/test_classifier_ip6.py')
-rw-r--r--test/test_classifier_ip6.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/test_classifier_ip6.py b/test/test_classifier_ip6.py
index 9f4c20aae3e..cbcf5c47257 100644
--- a/test/test_classifier_ip6.py
+++ b/test/test_classifier_ip6.py
@@ -184,9 +184,11 @@ class TestClassifier(VppTestCase):
:param int dst_port: destination port number "x"
"""
if src_ip:
- src_ip = socket.inet_pton(socket.AF_INET6, src_ip).encode('hex')
+ src_ip = binascii.hexlify(socket.inet_pton(
+ socket.AF_INET6, src_ip))
if dst_ip:
- dst_ip = socket.inet_pton(socket.AF_INET6, dst_ip).encode('hex')
+ dst_ip = binascii.hexlify(socket.inet_pton(
+ socket.AF_INET6, dst_ip))
return ('{:0>14}{:0>34}{:0>32}{:0>4}{:0>4}'.format(
hex(nh)[2:], src_ip, dst_ip, hex(src_port)[2:],