classify: make tests support python3
Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I7c4a12165fa0928fb2b8d99fc1c8d5de16377e7e
This commit is contained in:
@@ -210,9 +210,9 @@ class TestClassifier(VppTestCase):
|
||||
:param int dst_port: destination port number "x"
|
||||
"""
|
||||
if src_ip:
|
||||
src_ip = binascii.hexlify(socket.inet_aton(src_ip))
|
||||
src_ip = binascii.hexlify(socket.inet_aton(src_ip)).decode('ascii')
|
||||
if dst_ip:
|
||||
dst_ip = binascii.hexlify(socket.inet_aton(dst_ip))
|
||||
dst_ip = binascii.hexlify(socket.inet_aton(dst_ip)).decode('ascii')
|
||||
|
||||
return ('{!s:0>20}{!s:0>12}{!s:0>8}{!s:0>4}{!s:0>4}'.format(
|
||||
hex(proto)[2:], src_ip, dst_ip, hex(src_port)[2:],
|
||||
|
@@ -744,9 +744,8 @@ class VppPapiProvider(object):
|
||||
:param current_data_flag: (Default value = 0)
|
||||
:param current_data_offset: (Default value = 0)
|
||||
"""
|
||||
|
||||
mask_len = ((len(mask) - 1) / 16 + 1) * 16
|
||||
mask = mask + '\0' * (mask_len - len(mask))
|
||||
mask_len = ((len(mask) - 1) // 16 + 1) * 16
|
||||
mask = mask + b'\0' * (mask_len - len(mask))
|
||||
return self.api(
|
||||
self.papi.classify_add_del_table,
|
||||
{'is_add': is_add,
|
||||
@@ -783,8 +782,8 @@ class VppPapiProvider(object):
|
||||
:param metadata: (Default value = 0)
|
||||
"""
|
||||
|
||||
match_len = ((len(match) - 1) / 16 + 1) * 16
|
||||
match = match + '\0' * (match_len - len(match))
|
||||
match_len = ((len(match) - 1) // 16 + 1) * 16
|
||||
match = match + b'\0' * (match_len - len(match))
|
||||
return self.api(
|
||||
self.papi.classify_add_del_session,
|
||||
{'is_add': is_add,
|
||||
|
Reference in New Issue
Block a user