tests: support python 3.8
Make test framework python3 version independence. Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I1ef1eb77b6c1f422ebc4dad0818f87c8e587b34b
This commit is contained in:

committed by
Paul Vinciguerra

parent
dc90c719bc
commit
6e6ad64a4c
@ -87,7 +87,7 @@ def ip_to_dpo_proto(addr):
|
||||
|
||||
|
||||
def address_proto(ip_addr):
|
||||
if ip_addr.ip_addr.version is 4:
|
||||
if ip_addr.ip_addr.version == 4:
|
||||
return FibPathProto.FIB_PATH_NH_PROTO_IP4
|
||||
else:
|
||||
return FibPathProto.FIB_PATH_NH_PROTO_IP6
|
||||
@ -96,7 +96,7 @@ def address_proto(ip_addr):
|
||||
def find_route(test, addr, len, table_id=0):
|
||||
prefix = mk_network(addr, len)
|
||||
|
||||
if 4 is prefix.version:
|
||||
if 4 == prefix.version:
|
||||
routes = test.vapi.ip_route_dump(table_id, False)
|
||||
else:
|
||||
routes = test.vapi.ip_route_dump(table_id, True)
|
||||
@ -131,7 +131,7 @@ def find_mroute(test, grp_addr, src_addr, grp_addr_len,
|
||||
text_type(grp_addr),
|
||||
grp_addr_len)
|
||||
|
||||
if 4 is ip_mprefix.version:
|
||||
if 4 == ip_mprefix.version:
|
||||
routes = test.vapi.ip_mroute_dump(table_id, False)
|
||||
else:
|
||||
routes = test.vapi.ip_mroute_dump(table_id, True)
|
||||
|
Reference in New Issue
Block a user