X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_vxlan6.py;h=b1fda508394da2ac4e72aaa75f4234ee3e6679dd;hb=774b5dbe7f2f69eabb38fee300f32dc7ee687e7f;hp=6f8fee71ec03aec80be7fa7e3417be01d4bc6041;hpb=a5b2eec0535f9025319a752891d77ff9948ae0df;p=vpp.git diff --git a/test/test_vxlan6.py b/test/test_vxlan6.py index 6f8fee71ec0..b1fda508394 100644 --- a/test/test_vxlan6.py +++ b/test/test_vxlan6.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import socket import unittest @@ -9,6 +9,8 @@ from scapy.layers.l2 import Ether from scapy.layers.inet6 import IPv6, UDP from scapy.layers.vxlan import VXLAN from scapy.utils import atol +from vpp_ip_route import VppIpRoute, VppRoutePath +from vpp_ip import INVALID_INDEX class TestVxlan6(BridgeDomain, VppTestCase): @@ -85,18 +87,17 @@ class TestVxlan6(BridgeDomain, VppTestCase): # Create 10 ucast vxlan tunnels under bd start = 10 end = start + n_ucast_tunnels - next_hop = cls.pg0.remote_ip6n for dest_ip6 in cls.ip_range(start, end): dest_ip6n = socket.inet_pton(socket.AF_INET6, dest_ip6) # add host route so dest ip will not be resolved - cls.vapi.ip_add_del_route(dst_address=dest_ip6n, - dst_address_length=128, - next_hop_address=next_hop, is_ipv6=1) + rip = VppIpRoute(cls, dest_ip6, 128, + [VppRoutePath(cls.pg0.remote_ip6, INVALID_INDEX)], + register=False) + rip.add_vpp_config() r = cls.vapi.vxlan_add_del_tunnel(src_address=cls.pg0.local_ip6n, dst_address=dest_ip6n, is_ipv6=1, vni=vni) - cls.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=r.sw_if_index, - bd_id=vni) + cls.vapi.sw_interface_set_l2_bridge(r.sw_if_index, bd_id=vni) @classmethod def add_mcast_tunnels_load(cls): @@ -179,11 +180,12 @@ class TestVxlan6(BridgeDomain, VppTestCase): # @param self The object pointer. def tearDown(self): super(TestVxlan6, self).tearDown() - if not self.vpp_dead: - self.logger.info(self.vapi.cli("show bridge-domain 1 detail")) - self.logger.info(self.vapi.cli("show bridge-domain 2 detail")) - self.logger.info(self.vapi.cli("show bridge-domain 3 detail")) - self.logger.info(self.vapi.cli("show vxlan tunnel")) + + def show_commands_at_teardown(self): + self.logger.info(self.vapi.cli("show bridge-domain 1 detail")) + self.logger.info(self.vapi.cli("show bridge-domain 2 detail")) + self.logger.info(self.vapi.cli("show bridge-domain 3 detail")) + self.logger.info(self.vapi.cli("show vxlan tunnel")) if __name__ == '__main__':