Renato Botelho do Couto | ead1e53 | 2019-10-31 13:31:07 -0500 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 2 | |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 3 | import socket |
Ole Troan | 7f99183 | 2018-12-06 17:35:12 +0100 | [diff] [blame] | 4 | from util import ip4n_range, ip4_range, reassemble4 |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 5 | import unittest |
| 6 | from framework import VppTestCase, VppTestRunner |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 7 | from template_bd import BridgeDomain |
| 8 | |
snaramre | 5d4b891 | 2019-12-13 23:39:35 +0000 | [diff] [blame] | 9 | from scapy.layers.l2 import Ether |
| 10 | from scapy.packet import Raw |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 11 | from scapy.layers.inet import IP, UDP |
Matej Klotton | deb6984 | 2016-12-09 15:05:46 +0100 | [diff] [blame] | 12 | from scapy.layers.vxlan import VXLAN |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 13 | from scapy.utils import atol |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 14 | from vpp_ip_route import VppIpRoute, VppRoutePath |
| 15 | from vpp_ip import INVALID_INDEX |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 16 | |
| 17 | |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 18 | class TestVxlan(BridgeDomain, VppTestCase): |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 19 | """ VXLAN Test Case """ |
| 20 | |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 21 | def __init__(self, *args): |
| 22 | BridgeDomain.__init__(self) |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 23 | VppTestCase.__init__(self, *args) |
| 24 | |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 25 | def encapsulate(self, pkt, vni): |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 26 | """ |
| 27 | Encapsulate the original payload frame by adding VXLAN header with its |
| 28 | UDP, IP and Ethernet fields |
| 29 | """ |
| 30 | return (Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac) / |
| 31 | IP(src=self.pg0.remote_ip4, dst=self.pg0.local_ip4) / |
| 32 | UDP(sport=self.dport, dport=self.dport, chksum=0) / |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 33 | VXLAN(vni=vni, flags=self.flags) / |
| 34 | pkt) |
| 35 | |
Eyal Bari | cef1e2a | 2018-06-18 13:01:59 +0300 | [diff] [blame] | 36 | def ip_range(self, start, end): |
| 37 | """ range of remote ip's """ |
| 38 | return ip4_range(self.pg0.remote_ip4, start, end) |
| 39 | |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 40 | def encap_mcast(self, pkt, src_ip, src_mac, vni): |
| 41 | """ |
| 42 | Encapsulate the original payload frame by adding VXLAN header with its |
| 43 | UDP, IP and Ethernet fields |
| 44 | """ |
Eyal Bari | d81da8c | 2017-01-11 13:39:54 +0200 | [diff] [blame] | 45 | return (Ether(src=src_mac, dst=self.mcast_mac) / |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 46 | IP(src=src_ip, dst=self.mcast_ip4) / |
| 47 | UDP(sport=self.dport, dport=self.dport, chksum=0) / |
| 48 | VXLAN(vni=vni, flags=self.flags) / |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 49 | pkt) |
| 50 | |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 51 | def decapsulate(self, pkt): |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 52 | """ |
| 53 | Decapsulate the original payload frame by removing VXLAN header |
| 54 | """ |
Matej Klotton | deb6984 | 2016-12-09 15:05:46 +0100 | [diff] [blame] | 55 | # check if is set I flag |
| 56 | self.assertEqual(pkt[VXLAN].flags, int('0x8', 16)) |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 57 | return pkt[VXLAN].payload |
| 58 | |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 59 | # Method for checking VXLAN encapsulation. |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 60 | # |
Eyal Bari | 6ae5ee7 | 2017-03-23 09:53:51 +0200 | [diff] [blame] | 61 | def check_encapsulation(self, pkt, vni, local_only=False, mcast_pkt=False): |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 62 | # TODO: add error messages |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 63 | # Verify source MAC is VPP_MAC and destination MAC is MY_MAC resolved |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 64 | # by VPP using ARP. |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 65 | self.assertEqual(pkt[Ether].src, self.pg0.local_mac) |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 66 | if not local_only: |
Eyal Bari | 6ae5ee7 | 2017-03-23 09:53:51 +0200 | [diff] [blame] | 67 | if not mcast_pkt: |
| 68 | self.assertEqual(pkt[Ether].dst, self.pg0.remote_mac) |
| 69 | else: |
| 70 | self.assertEqual(pkt[Ether].dst, type(self).mcast_mac) |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 71 | # Verify VXLAN tunnel source IP is VPP_IP and destination IP is MY_IP. |
| 72 | self.assertEqual(pkt[IP].src, self.pg0.local_ip4) |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 73 | if not local_only: |
Eyal Bari | 6ae5ee7 | 2017-03-23 09:53:51 +0200 | [diff] [blame] | 74 | if not mcast_pkt: |
| 75 | self.assertEqual(pkt[IP].dst, self.pg0.remote_ip4) |
| 76 | else: |
| 77 | self.assertEqual(pkt[IP].dst, type(self).mcast_ip4) |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 78 | # Verify UDP destination port is VXLAN 4789, source UDP port could be |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 79 | # arbitrary. |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 80 | self.assertEqual(pkt[UDP].dport, type(self).dport) |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 81 | # TODO: checksum check |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 82 | # Verify VNI |
| 83 | self.assertEqual(pkt[VXLAN].vni, vni) |
| 84 | |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 85 | @classmethod |
Eyal Bari | d81da8c | 2017-01-11 13:39:54 +0200 | [diff] [blame] | 86 | def create_vxlan_flood_test_bd(cls, vni, n_ucast_tunnels): |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 87 | # Create 10 ucast vxlan tunnels under bd |
| 88 | ip_range_start = 10 |
Eyal Bari | d81da8c | 2017-01-11 13:39:54 +0200 | [diff] [blame] | 89 | ip_range_end = ip_range_start + n_ucast_tunnels |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 90 | next_hop_address = cls.pg0.remote_ip4 |
| 91 | for dest_ip4 in ip4_range(next_hop_address, ip_range_start, |
| 92 | ip_range_end): |
Eyal Bari | d81da8c | 2017-01-11 13:39:54 +0200 | [diff] [blame] | 93 | # add host route so dest_ip4n will not be resolved |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 94 | rip = VppIpRoute(cls, dest_ip4, 32, |
| 95 | [VppRoutePath(next_hop_address, |
| 96 | INVALID_INDEX)], |
| 97 | register=False) |
| 98 | rip.add_vpp_config() |
| 99 | dest_ip4n = socket.inet_pton(socket.AF_INET, dest_ip4) |
| 100 | |
Ole Troan | a5b2eec | 2019-03-11 19:23:25 +0100 | [diff] [blame] | 101 | r = cls.vapi.vxlan_add_del_tunnel(src_address=cls.pg0.local_ip4n, |
| 102 | dst_address=dest_ip4n, vni=vni) |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 103 | cls.vapi.sw_interface_set_l2_bridge(r.sw_if_index, bd_id=vni) |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 104 | |
| 105 | @classmethod |
Eyal Bari | 4bce290 | 2017-01-16 12:02:46 +0200 | [diff] [blame] | 106 | def add_del_shared_mcast_dst_load(cls, is_add): |
| 107 | """ |
| 108 | add or del tunnels sharing the same mcast dst |
| 109 | to test vxlan ref_count mechanism |
| 110 | """ |
Gabriel Ganne | 7e665d6 | 2017-11-17 09:18:53 +0100 | [diff] [blame] | 111 | n_shared_dst_tunnels = 20 |
Eyal Bari | 4bce290 | 2017-01-16 12:02:46 +0200 | [diff] [blame] | 112 | vni_start = 10000 |
| 113 | vni_end = vni_start + n_shared_dst_tunnels |
| 114 | for vni in range(vni_start, vni_end): |
Ole Troan | a5b2eec | 2019-03-11 19:23:25 +0100 | [diff] [blame] | 115 | r = cls.vapi.vxlan_add_del_tunnel(src_address=cls.pg0.local_ip4n, |
| 116 | dst_address=cls.mcast_ip4n, |
| 117 | mcast_sw_if_index=1, |
| 118 | is_add=is_add, vni=vni) |
Eyal Bari | d927834 | 2017-04-06 03:31:00 +0300 | [diff] [blame] | 119 | if r.sw_if_index == 0xffffffff: |
Paul Vinciguerra | c599c6f | 2019-03-12 17:41:27 -0700 | [diff] [blame] | 120 | raise ValueError("bad sw_if_index: ~0") |
Eyal Bari | 4bce290 | 2017-01-16 12:02:46 +0200 | [diff] [blame] | 121 | |
| 122 | @classmethod |
| 123 | def add_shared_mcast_dst_load(cls): |
| 124 | cls.add_del_shared_mcast_dst_load(is_add=1) |
| 125 | |
| 126 | @classmethod |
| 127 | def del_shared_mcast_dst_load(cls): |
| 128 | cls.add_del_shared_mcast_dst_load(is_add=0) |
| 129 | |
| 130 | @classmethod |
| 131 | def add_del_mcast_tunnels_load(cls, is_add): |
| 132 | """ |
| 133 | add or del tunnels to test vxlan stability |
| 134 | """ |
| 135 | n_distinct_dst_tunnels = 200 |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 136 | ip_range_start = 10 |
Eyal Bari | 4bce290 | 2017-01-16 12:02:46 +0200 | [diff] [blame] | 137 | ip_range_end = ip_range_start + n_distinct_dst_tunnels |
Eyal Bari | d81da8c | 2017-01-11 13:39:54 +0200 | [diff] [blame] | 138 | for dest_ip4n in ip4n_range(cls.mcast_ip4n, ip_range_start, |
| 139 | ip_range_end): |
| 140 | vni = bytearray(dest_ip4n)[3] |
Ole Troan | a5b2eec | 2019-03-11 19:23:25 +0100 | [diff] [blame] | 141 | cls.vapi.vxlan_add_del_tunnel(src_address=cls.pg0.local_ip4n, |
| 142 | dst_address=dest_ip4n, |
| 143 | mcast_sw_if_index=1, is_add=is_add, |
| 144 | vni=vni) |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 145 | |
| 146 | @classmethod |
Eyal Bari | 4bce290 | 2017-01-16 12:02:46 +0200 | [diff] [blame] | 147 | def add_mcast_tunnels_load(cls): |
| 148 | cls.add_del_mcast_tunnels_load(is_add=1) |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 149 | |
| 150 | @classmethod |
Eyal Bari | 4bce290 | 2017-01-16 12:02:46 +0200 | [diff] [blame] | 151 | def del_mcast_tunnels_load(cls): |
| 152 | cls.add_del_mcast_tunnels_load(is_add=0) |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 153 | |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 154 | # Class method to start the VXLAN test case. |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 155 | # Overrides setUpClass method in VppTestCase class. |
| 156 | # Python try..except statement is used to ensure that the tear down of |
| 157 | # the class will be executed even if exception is raised. |
| 158 | # @param cls The class pointer. |
| 159 | @classmethod |
| 160 | def setUpClass(cls): |
| 161 | super(TestVxlan, cls).setUpClass() |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 162 | |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 163 | try: |
| 164 | cls.dport = 4789 |
Matej Klotton | deb6984 | 2016-12-09 15:05:46 +0100 | [diff] [blame] | 165 | cls.flags = 0x8 |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 166 | |
| 167 | # Create 2 pg interfaces. |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 168 | cls.create_pg_interfaces(range(4)) |
| 169 | for pg in cls.pg_interfaces: |
| 170 | pg.admin_up() |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 171 | |
| 172 | # Configure IPv4 addresses on VPP pg0. |
| 173 | cls.pg0.config_ip4() |
| 174 | |
| 175 | # Resolve MAC address for VPP's IP address on pg0. |
| 176 | cls.pg0.resolve_arp() |
| 177 | |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 178 | # Our Multicast address |
| 179 | cls.mcast_ip4 = '239.1.1.1' |
| 180 | cls.mcast_ip4n = socket.inet_pton(socket.AF_INET, cls.mcast_ip4) |
| 181 | iplong = atol(cls.mcast_ip4) |
Eyal Bari | d81da8c | 2017-01-11 13:39:54 +0200 | [diff] [blame] | 182 | cls.mcast_mac = "01:00:5e:%02x:%02x:%02x" % ( |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 183 | (iplong >> 16) & 0x7F, (iplong >> 8) & 0xFF, iplong & 0xFF) |
| 184 | |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 185 | # Create VXLAN VTEP on VPP pg0, and put vxlan_tunnel0 and pg1 |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 186 | # into BD. |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 187 | cls.single_tunnel_bd = 1 |
Ole Troan | a5b2eec | 2019-03-11 19:23:25 +0100 | [diff] [blame] | 188 | r = cls.vapi.vxlan_add_del_tunnel(src_address=cls.pg0.local_ip4n, |
| 189 | dst_address=cls.pg0.remote_ip4n, |
| 190 | vni=cls.single_tunnel_bd) |
| 191 | cls.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=r.sw_if_index, |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 192 | bd_id=cls.single_tunnel_bd) |
Ole Troan | a5b2eec | 2019-03-11 19:23:25 +0100 | [diff] [blame] | 193 | cls.vapi.sw_interface_set_l2_bridge( |
| 194 | rx_sw_if_index=cls.pg1.sw_if_index, bd_id=cls.single_tunnel_bd) |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 195 | |
| 196 | # Setup vni 2 to test multicast flooding |
Eyal Bari | d81da8c | 2017-01-11 13:39:54 +0200 | [diff] [blame] | 197 | cls.n_ucast_tunnels = 10 |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 198 | cls.mcast_flood_bd = 2 |
Eyal Bari | d81da8c | 2017-01-11 13:39:54 +0200 | [diff] [blame] | 199 | cls.create_vxlan_flood_test_bd(cls.mcast_flood_bd, |
| 200 | cls.n_ucast_tunnels) |
Ole Troan | a5b2eec | 2019-03-11 19:23:25 +0100 | [diff] [blame] | 201 | r = cls.vapi.vxlan_add_del_tunnel(src_address=cls.pg0.local_ip4n, |
| 202 | dst_address=cls.mcast_ip4n, |
| 203 | mcast_sw_if_index=1, |
| 204 | vni=cls.mcast_flood_bd) |
| 205 | cls.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=r.sw_if_index, |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 206 | bd_id=cls.mcast_flood_bd) |
Ole Troan | a5b2eec | 2019-03-11 19:23:25 +0100 | [diff] [blame] | 207 | cls.vapi.sw_interface_set_l2_bridge( |
| 208 | rx_sw_if_index=cls.pg2.sw_if_index, bd_id=cls.mcast_flood_bd) |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 209 | |
| 210 | # Add and delete mcast tunnels to check stability |
Eyal Bari | 4bce290 | 2017-01-16 12:02:46 +0200 | [diff] [blame] | 211 | cls.add_shared_mcast_dst_load() |
| 212 | cls.add_mcast_tunnels_load() |
| 213 | cls.del_shared_mcast_dst_load() |
| 214 | cls.del_mcast_tunnels_load() |
Eyal Bari | c4aaee1 | 2016-12-20 18:36:46 +0200 | [diff] [blame] | 215 | |
| 216 | # Setup vni 3 to test unicast flooding |
| 217 | cls.ucast_flood_bd = 3 |
Eyal Bari | d81da8c | 2017-01-11 13:39:54 +0200 | [diff] [blame] | 218 | cls.create_vxlan_flood_test_bd(cls.ucast_flood_bd, |
| 219 | cls.n_ucast_tunnels) |
Ole Troan | a5b2eec | 2019-03-11 19:23:25 +0100 | [diff] [blame] | 220 | cls.vapi.sw_interface_set_l2_bridge( |
| 221 | rx_sw_if_index=cls.pg3.sw_if_index, bd_id=cls.ucast_flood_bd) |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 222 | except Exception: |
| 223 | super(TestVxlan, cls).tearDownClass() |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 224 | raise |
| 225 | |
Paul Vinciguerra | 7f9b7f9 | 2019-03-12 19:23:27 -0700 | [diff] [blame] | 226 | @classmethod |
| 227 | def tearDownClass(cls): |
| 228 | super(TestVxlan, cls).tearDownClass() |
| 229 | |
Ole Troan | b3655e5 | 2018-08-16 22:08:49 +0200 | [diff] [blame] | 230 | def test_encap_big_packet(self): |
| 231 | """ Encapsulation test send big frame from pg1 |
| 232 | Verify receipt of encapsulated frames on pg0 |
| 233 | """ |
| 234 | |
| 235 | self.vapi.sw_interface_set_mtu(self.pg0.sw_if_index, [1500, 0, 0, 0]) |
| 236 | |
| 237 | frame = (Ether(src='00:00:00:00:00:02', dst='00:00:00:00:00:01') / |
| 238 | IP(src='4.3.2.1', dst='1.2.3.4') / |
| 239 | UDP(sport=20000, dport=10000) / |
Ole Troan | 770a0de | 2019-11-07 13:52:21 +0100 | [diff] [blame] | 240 | Raw(b'\xa5' * 1450)) |
Ole Troan | b3655e5 | 2018-08-16 22:08:49 +0200 | [diff] [blame] | 241 | |
| 242 | self.pg1.add_stream([frame]) |
| 243 | |
| 244 | self.pg0.enable_capture() |
| 245 | |
| 246 | self.pg_start() |
| 247 | |
| 248 | # Pick first received frame and check if it's correctly encapsulated. |
| 249 | out = self.pg0.get_capture(2) |
| 250 | ether = out[0] |
Ole Troan | 7f99183 | 2018-12-06 17:35:12 +0100 | [diff] [blame] | 251 | pkt = reassemble4(out) |
Ole Troan | b3655e5 | 2018-08-16 22:08:49 +0200 | [diff] [blame] | 252 | pkt = ether / pkt |
| 253 | self.check_encapsulation(pkt, self.single_tunnel_bd) |
| 254 | |
| 255 | payload = self.decapsulate(pkt) |
| 256 | # TODO: Scapy bug? |
| 257 | # self.assert_eq_pkts(payload, frame) |
| 258 | |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 259 | # Method to define VPP actions before tear down of the test case. |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 260 | # Overrides tearDown method in VppTestCase class. |
| 261 | # @param self The object pointer. |
| 262 | def tearDown(self): |
| 263 | super(TestVxlan, self).tearDown() |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 264 | |
| 265 | def show_commands_at_teardown(self): |
| 266 | self.logger.info(self.vapi.cli("show bridge-domain 1 detail")) |
| 267 | self.logger.info(self.vapi.cli("show bridge-domain 2 detail")) |
| 268 | self.logger.info(self.vapi.cli("show bridge-domain 3 detail")) |
| 269 | self.logger.info(self.vapi.cli("show vxlan tunnel")) |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 270 | |
Matej Klotton | deb6984 | 2016-12-09 15:05:46 +0100 | [diff] [blame] | 271 | |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 272 | if __name__ == '__main__': |
| 273 | unittest.main(testRunner=VppTestRunner) |