Renato Botelho do Couto | ead1e53 | 2019-10-31 13:31:07 -0500 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 2 | |
Paul Vinciguerra | 2f15631 | 2020-05-02 22:34:40 -0400 | [diff] [blame] | 3 | from util import ip4_range |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 4 | import unittest |
Dave Wallace | 8800f73 | 2023-08-31 00:47:44 -0400 | [diff] [blame] | 5 | from framework import VppTestCase |
| 6 | from asfframework import VppTestRunner |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 7 | from template_bd import BridgeDomain |
Dmitry Valter | 34fa0ce | 2024-03-11 10:38:46 +0000 | [diff] [blame] | 8 | from config import config |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 9 | |
Ole Troan | 7fc88cf | 2020-06-17 22:57:13 +0200 | [diff] [blame] | 10 | from scapy.layers.l2 import Ether, ARP |
| 11 | from scapy.layers.inet import IP, UDP, ICMP |
snaramre | 5d4b891 | 2019-12-13 23:39:35 +0000 | [diff] [blame] | 12 | from scapy.contrib.geneve import GENEVE |
Paul Vinciguerra | 2f15631 | 2020-05-02 22:34:40 -0400 | [diff] [blame] | 13 | |
| 14 | import util |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 15 | from vpp_ip_route import VppIpRoute, VppRoutePath |
| 16 | from vpp_ip import INVALID_INDEX |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 17 | |
| 18 | |
Dmitry Valter | 34fa0ce | 2024-03-11 10:38:46 +0000 | [diff] [blame] | 19 | @unittest.skipIf("geneve" in config.excluded_plugins, "Exclude GENEVE plugin tests") |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 20 | class TestGeneve(BridgeDomain, VppTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 21 | """GENEVE Test Case""" |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 22 | |
| 23 | def __init__(self, *args): |
| 24 | BridgeDomain.__init__(self) |
| 25 | VppTestCase.__init__(self, *args) |
| 26 | |
| 27 | def encapsulate(self, pkt, vni): |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 28 | """ |
| 29 | Encapsulate the original payload frame by adding GENEVE header with its |
| 30 | UDP, IP and Ethernet fields |
| 31 | """ |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 32 | return ( |
| 33 | Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac) |
| 34 | / IP(src=self.pg0.remote_ip4, dst=self.pg0.local_ip4) |
| 35 | / UDP(sport=self.dport, dport=self.dport, chksum=0) |
| 36 | / GENEVE(vni=vni) |
| 37 | / pkt |
| 38 | ) |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 39 | |
Eyal Bari | cef1e2a | 2018-06-18 13:01:59 +0300 | [diff] [blame] | 40 | def ip_range(self, start, end): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 41 | """range of remote ip's""" |
Eyal Bari | cef1e2a | 2018-06-18 13:01:59 +0300 | [diff] [blame] | 42 | return ip4_range(self.pg0.remote_ip4, start, end) |
| 43 | |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 44 | def encap_mcast(self, pkt, src_ip, src_mac, vni): |
| 45 | """ |
| 46 | Encapsulate the original payload frame by adding GENEVE header with its |
| 47 | UDP, IP and Ethernet fields |
| 48 | """ |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 49 | return ( |
| 50 | Ether(src=src_mac, dst=self.mcast_mac) |
| 51 | / IP(src=src_ip, dst=self.mcast_ip4) |
| 52 | / UDP(sport=self.dport, dport=self.dport, chksum=0) |
| 53 | / GENEVE(vni=vni) |
| 54 | / pkt |
| 55 | ) |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 56 | |
| 57 | def decapsulate(self, pkt): |
| 58 | """ |
| 59 | Decapsulate the original payload frame by removing GENEVE header |
| 60 | """ |
| 61 | # check if is set I flag |
| 62 | # self.assertEqual(pkt[GENEVE].flags, int('0x8', 16)) |
| 63 | return pkt[GENEVE].payload |
| 64 | |
| 65 | # Method for checking GENEVE encapsulation. |
| 66 | # |
| 67 | def check_encapsulation(self, pkt, vni, local_only=False, mcast_pkt=False): |
| 68 | # TODO: add error messages |
| 69 | # Verify source MAC is VPP_MAC and destination MAC is MY_MAC resolved |
| 70 | # by VPP using ARP. |
| 71 | self.assertEqual(pkt[Ether].src, self.pg0.local_mac) |
| 72 | if not local_only: |
| 73 | if not mcast_pkt: |
| 74 | self.assertEqual(pkt[Ether].dst, self.pg0.remote_mac) |
| 75 | else: |
| 76 | self.assertEqual(pkt[Ether].dst, type(self).mcast_mac) |
| 77 | # Verify GENEVE tunnel source IP is VPP_IP and destination IP is MY_IP. |
| 78 | self.assertEqual(pkt[IP].src, self.pg0.local_ip4) |
| 79 | if not local_only: |
| 80 | if not mcast_pkt: |
| 81 | self.assertEqual(pkt[IP].dst, self.pg0.remote_ip4) |
| 82 | else: |
| 83 | self.assertEqual(pkt[IP].dst, type(self).mcast_ip4) |
| 84 | # Verify UDP destination port is GENEVE 4789, source UDP port could be |
| 85 | # arbitrary. |
| 86 | self.assertEqual(pkt[UDP].dport, type(self).dport) |
| 87 | # TODO: checksum check |
| 88 | # Verify VNI |
| 89 | self.assertEqual(pkt[GENEVE].vni, vni) |
| 90 | |
| 91 | @classmethod |
| 92 | def create_geneve_flood_test_bd(cls, vni, n_ucast_tunnels): |
| 93 | # Create 10 ucast geneve tunnels under bd |
| 94 | ip_range_start = 10 |
| 95 | ip_range_end = ip_range_start + n_ucast_tunnels |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 96 | next_hop_address = cls.pg0.remote_ip4 |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 97 | for dest_ip4 in ip4_range(next_hop_address, ip_range_start, ip_range_end): |
Jakub Grajciar | 2d3282e | 2019-10-01 12:04:56 +0200 | [diff] [blame] | 98 | # add host route so dest_ip4 will not be resolved |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 99 | rip = VppIpRoute( |
| 100 | cls, |
| 101 | dest_ip4, |
| 102 | 32, |
| 103 | [VppRoutePath(next_hop_address, INVALID_INDEX)], |
| 104 | register=False, |
| 105 | ) |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 106 | rip.add_vpp_config() |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 107 | r = cls.vapi.geneve_add_del_tunnel( |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 108 | local_address=cls.pg0.local_ip4, remote_address=dest_ip4, vni=vni |
| 109 | ) |
| 110 | cls.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=r.sw_if_index, bd_id=vni) |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 111 | |
| 112 | @classmethod |
| 113 | def add_del_shared_mcast_dst_load(cls, is_add): |
| 114 | """ |
| 115 | add or del tunnels sharing the same mcast dst |
| 116 | to test geneve ref_count mechanism |
| 117 | """ |
Gabriel Ganne | 97cabc9 | 2018-02-08 11:22:33 +0100 | [diff] [blame] | 118 | n_shared_dst_tunnels = 10 |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 119 | vni_start = 10000 |
| 120 | vni_end = vni_start + n_shared_dst_tunnels |
| 121 | for vni in range(vni_start, vni_end): |
| 122 | r = cls.vapi.geneve_add_del_tunnel( |
Jakub Grajciar | 2d3282e | 2019-10-01 12:04:56 +0200 | [diff] [blame] | 123 | local_address=cls.pg0.local_ip4, |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 124 | remote_address=cls.mcast_ip4, |
| 125 | mcast_sw_if_index=1, |
| 126 | is_add=is_add, |
| 127 | vni=vni, |
| 128 | ) |
| 129 | if r.sw_if_index == 0xFFFFFFFF: |
Paul Vinciguerra | c599c6f | 2019-03-12 17:41:27 -0700 | [diff] [blame] | 130 | raise ValueError("bad sw_if_index: ~0") |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 131 | |
| 132 | @classmethod |
| 133 | def add_shared_mcast_dst_load(cls): |
| 134 | cls.add_del_shared_mcast_dst_load(is_add=1) |
| 135 | |
| 136 | @classmethod |
| 137 | def del_shared_mcast_dst_load(cls): |
| 138 | cls.add_del_shared_mcast_dst_load(is_add=0) |
| 139 | |
| 140 | @classmethod |
| 141 | def add_del_mcast_tunnels_load(cls, is_add): |
| 142 | """ |
| 143 | add or del tunnels to test geneve stability |
| 144 | """ |
Gabriel Ganne | 97cabc9 | 2018-02-08 11:22:33 +0100 | [diff] [blame] | 145 | n_distinct_dst_tunnels = 10 |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 146 | ip_range_start = 10 |
| 147 | ip_range_end = ip_range_start + n_distinct_dst_tunnels |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 148 | for dest_ip4 in ip4_range(cls.mcast_ip4, ip_range_start, ip_range_end): |
| 149 | vni = int(dest_ip4.split(".")[3]) |
| 150 | cls.vapi.geneve_add_del_tunnel( |
| 151 | local_address=cls.pg0.local_ip4, |
| 152 | remote_address=dest_ip4, |
| 153 | mcast_sw_if_index=1, |
| 154 | is_add=is_add, |
| 155 | vni=vni, |
| 156 | ) |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 157 | |
| 158 | @classmethod |
| 159 | def add_mcast_tunnels_load(cls): |
| 160 | cls.add_del_mcast_tunnels_load(is_add=1) |
| 161 | |
| 162 | @classmethod |
| 163 | def del_mcast_tunnels_load(cls): |
| 164 | cls.add_del_mcast_tunnels_load(is_add=0) |
| 165 | |
| 166 | # Class method to start the GENEVE test case. |
| 167 | # Overrides setUpClass method in VppTestCase class. |
| 168 | # Python try..except statement is used to ensure that the tear down of |
| 169 | # the class will be executed even if exception is raised. |
| 170 | # @param cls The class pointer. |
| 171 | @classmethod |
| 172 | def setUpClass(cls): |
| 173 | super(TestGeneve, cls).setUpClass() |
| 174 | |
| 175 | try: |
| 176 | cls.dport = 6081 |
| 177 | |
| 178 | # Create 2 pg interfaces. |
| 179 | cls.create_pg_interfaces(range(4)) |
| 180 | for pg in cls.pg_interfaces: |
| 181 | pg.admin_up() |
| 182 | |
| 183 | # Configure IPv4 addresses on VPP pg0. |
| 184 | cls.pg0.config_ip4() |
| 185 | |
| 186 | # Resolve MAC address for VPP's IP address on pg0. |
| 187 | cls.pg0.resolve_arp() |
| 188 | |
| 189 | # Our Multicast address |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 190 | cls.mcast_ip4 = "239.1.1.1" |
Paul Vinciguerra | 2f15631 | 2020-05-02 22:34:40 -0400 | [diff] [blame] | 191 | cls.mcast_mac = util.mcast_ip_to_mac(cls.mcast_ip4) |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 192 | |
| 193 | # Create GENEVE VTEP on VPP pg0, and put geneve_tunnel0 and pg1 |
| 194 | # into BD. |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 195 | cls.single_tunnel_vni = 0xABCDE |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 196 | cls.single_tunnel_bd = 1 |
| 197 | r = cls.vapi.geneve_add_del_tunnel( |
Jakub Grajciar | 2d3282e | 2019-10-01 12:04:56 +0200 | [diff] [blame] | 198 | local_address=cls.pg0.local_ip4, |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 199 | remote_address=cls.pg0.remote_ip4, |
| 200 | vni=cls.single_tunnel_vni, |
| 201 | ) |
Ole Troan | a5b2eec | 2019-03-11 19:23:25 +0100 | [diff] [blame] | 202 | cls.vapi.sw_interface_set_l2_bridge( |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 203 | rx_sw_if_index=r.sw_if_index, bd_id=cls.single_tunnel_bd |
| 204 | ) |
| 205 | cls.vapi.sw_interface_set_l2_bridge( |
| 206 | rx_sw_if_index=cls.pg1.sw_if_index, bd_id=cls.single_tunnel_bd |
| 207 | ) |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 208 | |
| 209 | # Setup vni 2 to test multicast flooding |
| 210 | cls.n_ucast_tunnels = 10 |
| 211 | cls.mcast_flood_bd = 2 |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 212 | cls.create_geneve_flood_test_bd(cls.mcast_flood_bd, cls.n_ucast_tunnels) |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 213 | r = cls.vapi.geneve_add_del_tunnel( |
Jakub Grajciar | 2d3282e | 2019-10-01 12:04:56 +0200 | [diff] [blame] | 214 | local_address=cls.pg0.local_ip4, |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 215 | remote_address=cls.mcast_ip4, |
| 216 | mcast_sw_if_index=1, |
| 217 | vni=cls.mcast_flood_bd, |
| 218 | ) |
Ole Troan | a5b2eec | 2019-03-11 19:23:25 +0100 | [diff] [blame] | 219 | cls.vapi.sw_interface_set_l2_bridge( |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 220 | rx_sw_if_index=r.sw_if_index, bd_id=cls.mcast_flood_bd |
| 221 | ) |
| 222 | cls.vapi.sw_interface_set_l2_bridge( |
| 223 | rx_sw_if_index=cls.pg2.sw_if_index, bd_id=cls.mcast_flood_bd |
| 224 | ) |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 225 | |
| 226 | # Add and delete mcast tunnels to check stability |
| 227 | cls.add_shared_mcast_dst_load() |
| 228 | cls.add_mcast_tunnels_load() |
| 229 | cls.del_shared_mcast_dst_load() |
| 230 | cls.del_mcast_tunnels_load() |
| 231 | |
| 232 | # Setup vni 3 to test unicast flooding |
| 233 | cls.ucast_flood_bd = 3 |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 234 | cls.create_geneve_flood_test_bd(cls.ucast_flood_bd, cls.n_ucast_tunnels) |
Ole Troan | a5b2eec | 2019-03-11 19:23:25 +0100 | [diff] [blame] | 235 | cls.vapi.sw_interface_set_l2_bridge( |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 236 | rx_sw_if_index=cls.pg3.sw_if_index, bd_id=cls.ucast_flood_bd |
| 237 | ) |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 238 | except Exception: |
| 239 | super(TestGeneve, cls).tearDownClass() |
| 240 | raise |
| 241 | |
| 242 | # Method to define VPP actions before tear down of the test case. |
| 243 | # Overrides tearDown method in VppTestCase class. |
| 244 | # @param self The object pointer. |
| 245 | def tearDown(self): |
| 246 | super(TestGeneve, self).tearDown() |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 247 | |
| 248 | def show_commands_at_teardown(self): |
| 249 | self.logger.info(self.vapi.cli("show bridge-domain 1 detail")) |
| 250 | self.logger.info(self.vapi.cli("show bridge-domain 2 detail")) |
| 251 | self.logger.info(self.vapi.cli("show bridge-domain 3 detail")) |
| 252 | self.logger.info(self.vapi.cli("show geneve tunnel")) |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 253 | |
| 254 | |
Dmitry Valter | 34fa0ce | 2024-03-11 10:38:46 +0000 | [diff] [blame] | 255 | @unittest.skipIf("geneve" in config.excluded_plugins, "Exclude GENEVE plugin tests") |
Ole Troan | 7fc88cf | 2020-06-17 22:57:13 +0200 | [diff] [blame] | 256 | class TestGeneveL3(VppTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 257 | """GENEVE L3 Test Case""" |
Ole Troan | 7fc88cf | 2020-06-17 22:57:13 +0200 | [diff] [blame] | 258 | |
| 259 | @classmethod |
| 260 | def setUpClass(cls): |
| 261 | super(TestGeneveL3, cls).setUpClass() |
| 262 | try: |
| 263 | cls.create_pg_interfaces(range(2)) |
| 264 | cls.interfaces = list(cls.pg_interfaces) |
| 265 | |
| 266 | for i in cls.interfaces: |
| 267 | i.admin_up() |
| 268 | i.config_ip4() |
| 269 | i.resolve_arp() |
| 270 | except Exception: |
| 271 | super(TestGeneveL3, cls).tearDownClass() |
| 272 | raise |
| 273 | |
| 274 | @classmethod |
| 275 | def tearDownClass(cls): |
| 276 | super(TestGeneveL3, cls).tearDownClass() |
| 277 | |
| 278 | def tearDown(self): |
| 279 | super(TestGeneveL3, self).tearDown() |
| 280 | |
| 281 | def show_commands_at_teardown(self): |
| 282 | self.logger.info(self.vapi.cli("show geneve tunnel")) |
| 283 | self.logger.info(self.vapi.cli("show ip neighbor")) |
| 284 | |
| 285 | def test_l3_packet(self): |
| 286 | vni = 1234 |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 287 | r = self.vapi.add_node_next( |
| 288 | node_name="geneve4-input", next_name="ethernet-input" |
| 289 | ) |
Ole Troan | 7fc88cf | 2020-06-17 22:57:13 +0200 | [diff] [blame] | 290 | r = self.vapi.geneve_add_del_tunnel2( |
| 291 | is_add=1, |
| 292 | local_address=self.pg0.local_ip4, |
| 293 | remote_address=self.pg0.remote_ip4, |
| 294 | vni=vni, |
| 295 | l3_mode=1, |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 296 | decap_next_index=r.next_index, |
| 297 | ) |
Ole Troan | 7fc88cf | 2020-06-17 22:57:13 +0200 | [diff] [blame] | 298 | |
| 299 | self.vapi.sw_interface_add_del_address( |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 300 | sw_if_index=r.sw_if_index, prefix="10.0.0.1/24" |
| 301 | ) |
Ole Troan | 7fc88cf | 2020-06-17 22:57:13 +0200 | [diff] [blame] | 302 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 303 | pkt = ( |
| 304 | Ether(src=self.pg0.remote_mac, dst="d0:0b:ee:d0:00:00") |
| 305 | / IP(src="10.0.0.2", dst="10.0.0.1") |
| 306 | / ICMP() |
| 307 | ) |
Ole Troan | 7fc88cf | 2020-06-17 22:57:13 +0200 | [diff] [blame] | 308 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 309 | encap = ( |
| 310 | Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac) |
| 311 | / IP(src=self.pg0.remote_ip4, dst=self.pg0.local_ip4) |
| 312 | / UDP(sport=6081, dport=6081, chksum=0) |
| 313 | / GENEVE(vni=vni) |
| 314 | ) |
Ole Troan | 7fc88cf | 2020-06-17 22:57:13 +0200 | [diff] [blame] | 315 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 316 | arp = Ether(src=self.pg0.remote_mac, dst="d0:0b:ee:d0:00:00") / ARP( |
| 317 | op="is-at", |
| 318 | hwsrc=self.pg0.remote_mac, |
| 319 | hwdst="d0:0b:ee:d0:00:00", |
| 320 | psrc="10.0.0.2", |
| 321 | pdst="10.0.0.1", |
| 322 | ) |
Ole Troan | 7fc88cf | 2020-06-17 22:57:13 +0200 | [diff] [blame] | 323 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 324 | rx = self.send_and_expect(self.pg0, encap / pkt * 1, self.pg0) |
| 325 | rx = self.send_and_assert_no_replies(self.pg0, encap / arp * 1, self.pg0) |
| 326 | rx = self.send_and_expect(self.pg0, encap / pkt * 1, self.pg0) |
Ole Troan | 7fc88cf | 2020-06-17 22:57:13 +0200 | [diff] [blame] | 327 | self.assertEqual(rx[0][ICMP].type, 0) # echo reply |
| 328 | |
| 329 | r = self.vapi.geneve_add_del_tunnel2( |
| 330 | is_add=0, |
| 331 | local_address=self.pg0.local_ip4, |
| 332 | remote_address=self.pg0.remote_ip4, |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 333 | vni=vni, |
| 334 | ) |
Ole Troan | 7fc88cf | 2020-06-17 22:57:13 +0200 | [diff] [blame] | 335 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 336 | |
| 337 | if __name__ == "__main__": |
Marco Varlese | b598f1d | 2017-09-19 14:25:28 +0200 | [diff] [blame] | 338 | unittest.main(testRunner=VppTestRunner) |