summaryrefslogtreecommitdiffstats
path: root/test/test_classifier.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_classifier.py')
-rw-r--r--test/test_classifier.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/test_classifier.py b/test/test_classifier.py
index ade96737e42..f865cb9f6d5 100644
--- a/test/test_classifier.py
+++ b/test/test_classifier.py
@@ -1,9 +1,8 @@
#!/usr/bin/env python
-import unittest
-import socket
import binascii
-import sys
+import socket
+import unittest
from framework import VppTestCase, VppTestRunner
@@ -218,9 +217,9 @@ class TestClassifier(VppTestCase):
:param int dst_port: destination port number "x"
"""
if src_ip:
- src_ip = socket.inet_aton(src_ip).encode('hex')
+ src_ip = binascii.hexlify(socket.inet_aton(src_ip))
if dst_ip:
- dst_ip = socket.inet_aton(dst_ip).encode('hex')
+ dst_ip = binascii.hexlify(socket.inet_aton(dst_ip))
return ('{:0>20}{:0>12}{:0>8}{:0>4}{:0>4}'.format(
hex(proto)[2:], src_ip, dst_ip, hex(src_port)[2:],