aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_dhcp6.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_dhcp6.py')
-rw-r--r--test/test_dhcp6.py44
1 files changed, 22 insertions, 22 deletions
diff --git a/test/test_dhcp6.py b/test/test_dhcp6.py
index e017feebffe..2037e62e9ea 100644
--- a/test/test_dhcp6.py
+++ b/test/test_dhcp6.py
@@ -226,7 +226,7 @@ class TestDHCPv6IANAControlPlane(VppTestCase):
self.T1 = 1
self.T2 = 2
- fib = self.vapi.ip6_fib_dump()
+ fib = self.vapi.ip_route_dump(0, True)
self.initial_addresses = set(self.get_interface_addresses(fib,
self.pg0))
@@ -247,14 +247,14 @@ class TestDHCPv6IANAControlPlane(VppTestCase):
def get_interface_addresses(fib, pg):
lst = []
for entry in fib:
- if entry.address_length == 128:
- path = entry.path[0]
+ if entry.route.prefix.prefixlen == 128:
+ path = entry.route.paths[0]
if path.sw_if_index == pg.sw_if_index:
- lst.append(entry.address)
+ lst.append(str(entry.route.prefix.network_address))
return lst
def get_addresses(self):
- fib = self.vapi.ip6_fib_dump()
+ fib = self.vapi.ip_route_dump(0, True)
addresses = set(self.get_interface_addresses(fib, self.pg0))
return addresses.difference(self.initial_addresses)
@@ -376,12 +376,12 @@ class TestDHCPv6IANAControlPlane(VppTestCase):
new_addresses = self.get_addresses()
self.assertEqual(len(new_addresses), 1)
addr = list(new_addresses)[0]
- self.assertEqual(inet_ntop(AF_INET6, addr), '7:8::2')
+ self.assertEqual(addr, '7:8::2')
self.sleep(2)
# check that the address is deleted
- fib = self.vapi.ip6_fib_dump()
+ fib = self.vapi.ip_route_dump(0, True)
addresses = set(self.get_interface_addresses(fib, self.pg0))
new_addresses = addresses.difference(self.initial_addresses)
self.assertEqual(len(new_addresses), 0)
@@ -430,7 +430,7 @@ class TestDHCPv6IANAControlPlane(VppTestCase):
self.sleep(0.5)
# check FIB contains no addresses
- fib = self.vapi.ip6_fib_dump()
+ fib = self.vapi.ip_route_dump(0, True)
addresses = set(self.get_interface_addresses(fib, self.pg0))
new_addresses = addresses.difference(self.initial_addresses)
self.assertEqual(len(new_addresses), 0)
@@ -447,7 +447,7 @@ class TestDHCPv6IANAControlPlane(VppTestCase):
self.sleep(0.5)
# check FIB contains no addresses
- fib = self.vapi.ip6_fib_dump()
+ fib = self.vapi.ip_route_dump(0, True)
addresses = set(self.get_interface_addresses(fib, self.pg0))
new_addresses = addresses.difference(self.initial_addresses)
self.assertEqual(len(new_addresses), 0)
@@ -477,7 +477,7 @@ class TestDHCPv6PDControlPlane(VppTestCase):
self.T1 = 1
self.T2 = 2
- fib = self.vapi.ip6_fib_dump()
+ fib = self.vapi.ip_route_dump(0, True)
self.initial_addresses = set(self.get_interface_addresses(fib,
self.pg1))
@@ -503,14 +503,14 @@ class TestDHCPv6PDControlPlane(VppTestCase):
def get_interface_addresses(fib, pg):
lst = []
for entry in fib:
- if entry.address_length == 128:
- path = entry.path[0]
+ if entry.route.prefix.prefixlen == 128:
+ path = entry.route.paths[0]
if path.sw_if_index == pg.sw_if_index:
- lst.append(entry.address)
+ lst.append(str(entry.route.prefix.network_address))
return lst
def get_addresses(self):
- fib = self.vapi.ip6_fib_dump()
+ fib = self.vapi.ip_route_dump(0, True)
addresses = set(self.get_interface_addresses(fib, self.pg1))
return addresses.difference(self.initial_addresses)
@@ -642,7 +642,7 @@ class TestDHCPv6PDControlPlane(VppTestCase):
new_addresses = self.get_addresses()
self.assertEqual(len(new_addresses), 1)
addr = list(new_addresses)[0]
- self.assertEqual(inet_ntop(AF_INET6, addr), '7:8:0:2::405')
+ self.assertEqual(addr, '7:8:0:2::405')
self.sleep(1)
@@ -656,21 +656,21 @@ class TestDHCPv6PDControlPlane(VppTestCase):
self.sleep(1)
# check FIB contains 2 addresses
- fib = self.vapi.ip6_fib_dump()
+ fib = self.vapi.ip_route_dump(0, True)
addresses = set(self.get_interface_addresses(fib, self.pg1))
new_addresses = addresses.difference(self.initial_addresses)
self.assertEqual(len(new_addresses), 2)
addr1 = list(new_addresses)[0]
addr2 = list(new_addresses)[1]
- if inet_ntop(AF_INET6, addr1) == '7:8:0:76::406':
+ if addr1 == '7:8:0:76::406':
addr1, addr2 = addr2, addr1
- self.assertEqual(inet_ntop(AF_INET6, addr1), '7:8:0:2::405')
- self.assertEqual(inet_ntop(AF_INET6, addr2), '7:8:0:76::406')
+ self.assertEqual(addr1, '7:8:0:2::405')
+ self.assertEqual(addr2, '7:8:0:76::406')
self.sleep(1)
# check that the addresses are deleted
- fib = self.vapi.ip6_fib_dump()
+ fib = self.vapi.ip_route_dump(0, True)
addresses = set(self.get_interface_addresses(fib, self.pg1))
new_addresses = addresses.difference(self.initial_addresses)
self.assertEqual(len(new_addresses), 0)
@@ -738,7 +738,7 @@ class TestDHCPv6PDControlPlane(VppTestCase):
self.sleep(0.5)
# check FIB contains no addresses
- fib = self.vapi.ip6_fib_dump()
+ fib = self.vapi.ip_route_dump(0, True)
addresses = set(self.get_interface_addresses(fib, self.pg1))
new_addresses = addresses.difference(self.initial_addresses)
self.assertEqual(len(new_addresses), 0)
@@ -771,7 +771,7 @@ class TestDHCPv6PDControlPlane(VppTestCase):
self.sleep(0.5)
# check FIB contains no addresses
- fib = self.vapi.ip6_fib_dump()
+ fib = self.vapi.ip_route_dump(0, True)
addresses = set(self.get_interface_addresses(fib, self.pg1))
new_addresses = addresses.difference(self.initial_addresses)
self.assertEqual(len(new_addresses), 0)