aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_gbp.py9
-rw-r--r--test/test_svs.py15
2 files changed, 9 insertions, 15 deletions
diff --git a/test/test_gbp.py b/test/test_gbp.py
index 132bd247dd1..8e873f345e7 100644
--- a/test/test_gbp.py
+++ b/test/test_gbp.py
@@ -10,6 +10,7 @@ from vpp_ip_route import VppIpRoute, VppRoutePath, VppIpTable
from vpp_ip import *
from vpp_mac import *
from vpp_papi_provider import L2_PORT_TYPE
+from vpp_papi.vpp_format import VPPFormat
from scapy.packet import Raw
from scapy.layers.l2 import Ether, ARP
@@ -162,7 +163,7 @@ class VppGbpSubnet(VppObject):
sw_if_index=None, epg=None):
self._test = test
self.table_id = table_id
- self.prefix = VppIpPrefix(address, address_len)
+ self.prefix = "{}/{}".format(address, address_len)
self.is_internal = is_internal
self.sw_if_index = sw_if_index
self.epg = epg
@@ -172,7 +173,7 @@ class VppGbpSubnet(VppObject):
1,
self.table_id,
self.is_internal,
- self.prefix.encode(),
+ self.prefix,
sw_if_index=self.sw_if_index if self.sw_if_index else 0xffffffff,
epg_id=self.epg if self.epg else 0xffff)
self._test.registry.register(self, self._test.logger)
@@ -182,7 +183,7 @@ class VppGbpSubnet(VppObject):
0,
self.table_id,
self.is_internal,
- self.prefix.encode())
+ self.prefix)
def __str__(self):
return self.object_id()
@@ -195,7 +196,7 @@ class VppGbpSubnet(VppObject):
ss = self._test.vapi.gbp_subnet_dump()
for s in ss:
if s.subnet.table_id == self.table_id and \
- s.subnet.prefix == self.prefix:
+ VPPFormat.unformat(s.subnet.prefix) == self.prefix:
return True
return False
diff --git a/test/test_svs.py b/test/test_svs.py
index 8429f437ae1..cfbe75ed974 100644
--- a/test/test_svs.py
+++ b/test/test_svs.py
@@ -1,8 +1,6 @@
#!/usr/bin/env python
from framework import VppTestCase, VppTestRunner
-from vpp_ip import VppIpPrefix
-
from vpp_ip_route import VppIpTable
from scapy.packet import Raw
@@ -104,9 +102,7 @@ class TestSVS(VppTestCase):
#
for i in range(1, 4):
self.vapi.svs_route_add_del(
- table_id,
- VppIpPrefix("%d.0.0.0" % i, 8).encode(),
- i)
+ table_id, "%d.0.0.0/8" % i, i)
#
# Enable SVS on pg0/pg1 using table 1001/1002
@@ -173,8 +169,7 @@ class TestSVS(VppTestCase):
for table_id in table_ids:
for i in range(1, 4):
self.vapi.svs_route_add_del(
- table_id,
- VppIpPrefix("%d.0.0.0" % i, 8).encode(),
+ table_id, "%d.0.0.0/8" % i,
0, is_add=0)
self.vapi.svs_table_add_del(
VppEnum.vl_api_address_family_t.ADDRESS_IP4,
@@ -234,8 +229,7 @@ class TestSVS(VppTestCase):
#
for i in range(1, 4):
self.vapi.svs_route_add_del(
- table_id,
- VppIpPrefix("2001:%d::" % i, 32).encode(),
+ table_id, "2001:%d::/32" % i,
i)
#
@@ -304,8 +298,7 @@ class TestSVS(VppTestCase):
for table_id in table_ids:
for i in range(1, 4):
self.vapi.svs_route_add_del(
- table_id,
- VppIpPrefix("2001:%d::" % i, 32).encode(),
+ table_id, "2001:%d::/32" % i,
0, is_add=0)
self.vapi.svs_table_add_del(
VppEnum.vl_api_address_family_t.ADDRESS_IP6,