calculate per-thread time offset
[vpp.git] / test / test_classifier_ip6.py
index 9f4c20a..f6d12c7 100644 (file)
@@ -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:],
@@ -234,7 +236,7 @@ class TestClassifier(VppTestCase):
             miss_next_index=0,
             current_data_flag=1,
             current_data_offset=data_offset)
-        self.assertIsNotNone(r, msg='No response msg for add_del_table')
+        self.assertIsNotNone(r, 'No response msg for add_del_table')
         self.acl_tbl_idx[key] = r.new_table_index
 
     def create_classify_session(self, table_index, match, vrfid=0, is_add=1):
@@ -252,7 +254,7 @@ class TestClassifier(VppTestCase):
             binascii.unhexlify(match),
             opaque_index=0,
             metadata=vrfid)
-        self.assertIsNotNone(r, msg='No response msg for add_del_session')
+        self.assertIsNotNone(r, 'No response msg for add_del_session')
 
     def input_acl_set_interface(self, intf, table_index, is_add=1):
         """Configure Input ACL interface
@@ -266,7 +268,7 @@ class TestClassifier(VppTestCase):
             is_add,
             intf.sw_if_index,
             ip6_table_index=table_index)
-        self.assertIsNotNone(r, msg='No response msg for acl_set_interface')
+        self.assertIsNotNone(r, 'No response msg for acl_set_interface')
 
     def output_acl_set_interface(self, intf, table_index, is_add=1):
         """Configure Output ACL interface
@@ -280,7 +282,7 @@ class TestClassifier(VppTestCase):
             is_add,
             intf.sw_if_index,
             ip6_table_index=table_index)
-        self.assertIsNotNone(r, msg='No response msg for acl_set_interface')
+        self.assertIsNotNone(r, 'No response msg for acl_set_interface')
 
 
 class TestClassifierIP6(TestClassifier):