diff options
Diffstat (limited to 'test/test_lb.py')
-rw-r--r-- | test/test_lb.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/test/test_lb.py b/test/test_lb.py index 93b389a1444..4603bd10db8 100644 --- a/test/test_lb.py +++ b/test/test_lb.py @@ -9,6 +9,8 @@ from scapy.data import IP_PROTOS from framework import VppTestCase from util import ppp +from vpp_ip_route import VppIpRoute, VppRoutePath +from vpp_ip import INVALID_INDEX """ TestLB is a subclass of VPPTestCase classes. @@ -50,13 +52,17 @@ class TestLB(VppTestCase): i.disable_ipv6_ra() i.resolve_arp() i.resolve_ndp() - dst4 = socket.inet_pton(socket.AF_INET, "10.0.0.0") - dst6 = socket.inet_pton(socket.AF_INET6, "2002::") - cls.vapi.ip_add_del_route(dst_address=dst4, dst_address_length=24, - next_hop_address=cls.pg1.remote_ip4n) - cls.vapi.ip_add_del_route(dst_address=dst6, dst_address_length=16, - next_hop_address=cls.pg1.remote_ip6n, - is_ipv6=1) + + dst4 = VppIpRoute(cls, "10.0.0.0", 24, + [VppRoutePath(cls.pg1.remote_ip4, + INVALID_INDEX)], + register=False) + dst4.add_vpp_config() + dst6 = VppIpRoute(cls, "2002::", 16, + [VppRoutePath(cls.pg1.remote_ip6, + INVALID_INDEX)], + register=False) + dst6.add_vpp_config() cls.vapi.lb_conf(ip4_src_address="39.40.41.42", ip6_src_address="2004::1") except Exception: |