summaryrefslogtreecommitdiffstats
path: root/test/test_ip4.py
diff options
context:
space:
mode:
authorJakub Grajciar <jgrajcia@cisco.com>2019-03-01 08:55:49 +0100
committerOle Trøan <otroan@employees.org>2019-03-15 10:24:22 +0000
commite63325e3ca03c847963863446345e6c80a2c0cfd (patch)
treecae33764e6186727697e91862c32f2b08334866b /test/test_ip4.py
parent4ba4edd15085ce31145ef5da6342e435c57c1150 (diff)
API: Cleanup APIs interface.api
Use of consistent API types for interface.api Change-Id: Ieb54cebb4ac96b432a3f0b41596718aa2f34885b Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Diffstat (limited to 'test/test_ip4.py')
-rw-r--r--test/test_ip4.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/test/test_ip4.py b/test/test_ip4.py
index c8c0a71d171..8282d134836 100644
--- a/test/test_ip4.py
+++ b/test/test_ip4.py
@@ -17,6 +17,7 @@ from vpp_ip_route import VppIpRoute, VppRoutePath, VppIpMRoute, \
VppMRoutePath, MRouteItfFlags, MRouteEntryFlags, VppMplsIpBind, \
VppMplsTable, VppIpTable
from vpp_sub_interface import VppSubInterface, VppDot1QSubint, VppDot1ADSubint
+from vpp_ip import VppIpPrefix
class TestIPv4(VppTestCase):
@@ -810,8 +811,8 @@ class TestIPSubNets(VppTestCase):
ip_addr_n = socket.inet_pton(socket.AF_INET, "10.10.10.10")
self.vapi.sw_interface_add_del_address(
- sw_if_index=self.pg0.sw_if_index, address=ip_addr_n,
- address_length=16)
+ sw_if_index=self.pg0.sw_if_index,
+ prefix=VppIpPrefix("10.10.10.10", 16).encode())
pn = (Ether(src=self.pg1.remote_mac,
dst=self.pg1.local_mac) /
@@ -829,8 +830,9 @@ class TestIPSubNets(VppTestCase):
# remove the sub-net and we are forwarding via the cover again
self.vapi.sw_interface_add_del_address(
- sw_if_index=self.pg0.sw_if_index, address=ip_addr_n,
- address_length=16, is_add=0)
+ sw_if_index=self.pg0.sw_if_index,
+ prefix=VppIpPrefix("10.10.10.10", 16).encode(), is_add=0)
+
self.pg1.add_stream(pn)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
@@ -847,8 +849,8 @@ class TestIPSubNets(VppTestCase):
ip_addr_n = socket.inet_pton(socket.AF_INET, "10.10.10.10")
self.vapi.sw_interface_add_del_address(
- sw_if_index=self.pg0.sw_if_index, address=ip_addr_n,
- address_length=31)
+ sw_if_index=self.pg0.sw_if_index,
+ prefix=VppIpPrefix("10.10.10.10", 31).encode())
pn = (Ether(src=self.pg1.remote_mac,
dst=self.pg1.local_mac) /
@@ -864,8 +866,9 @@ class TestIPSubNets(VppTestCase):
# remove the sub-net and we are forwarding via the cover again
self.vapi.sw_interface_add_del_address(
- sw_if_index=self.pg0.sw_if_index, address=ip_addr_n,
- address_length=31, is_add=0)
+ sw_if_index=self.pg0.sw_if_index,
+ prefix=VppIpPrefix("10.10.10.10", 31).encode(), is_add=0)
+
self.pg1.add_stream(pn)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()