GRE tunnel loop Tests
(self)
| 1166 | route_tun2_dst.add_vpp_config() |
| 1167 | |
| 1168 | def test_gre_loop(self): |
| 1169 | """GRE tunnel loop Tests""" |
| 1170 | |
| 1171 | # |
| 1172 | # Create an L3 GRE tunnel. |
| 1173 | # - set it admin up |
| 1174 | # - assign an IP Addres |
| 1175 | # |
| 1176 | gre_if = VppGreInterface(self, self.pg0.local_ip4, "1.1.1.2") |
| 1177 | gre_if.add_vpp_config() |
| 1178 | gre_if.admin_up() |
| 1179 | gre_if.config_ip4() |
| 1180 | |
| 1181 | # |
| 1182 | # add a route to the tunnel's destination that points |
| 1183 | # through the tunnel, hence forming a loop in the forwarding |
| 1184 | # graph |
| 1185 | # |
| 1186 | route_dst = VppIpRoute( |
| 1187 | self, "1.1.1.2", 32, [VppRoutePath("0.0.0.0", gre_if.sw_if_index)] |
| 1188 | ) |
| 1189 | route_dst.add_vpp_config() |
| 1190 | |
| 1191 | # |
| 1192 | # packets to the tunnels destination should be dropped |
| 1193 | # |
| 1194 | tx = self.create_stream_ip4(self.pg0, "1.1.1.1", "1.1.1.2") |
| 1195 | self.send_and_assert_no_replies(self.pg2, tx) |
| 1196 | |
| 1197 | self.logger.info(self.vapi.ppcli("sh adj 7")) |
| 1198 | |
| 1199 | # |
| 1200 | # break the loop |
| 1201 | # |
| 1202 | route_dst.modify([VppRoutePath(self.pg1.remote_ip4, self.pg1.sw_if_index)]) |
| 1203 | route_dst.add_vpp_config() |
| 1204 | |
| 1205 | rx = self.send_and_expect(self.pg0, tx, self.pg1) |
| 1206 | |
| 1207 | # |
| 1208 | # a good route throught the tunnel to check it restacked |
| 1209 | # |
| 1210 | route_via_tun_2 = VppIpRoute( |
| 1211 | self, "2.2.2.2", 32, [VppRoutePath("0.0.0.0", gre_if.sw_if_index)] |
| 1212 | ) |
| 1213 | route_via_tun_2.add_vpp_config() |
| 1214 | |
| 1215 | tx = self.create_stream_ip4(self.pg0, "2.2.2.3", "2.2.2.2") |
| 1216 | rx = self.send_and_expect(self.pg0, tx, self.pg1) |
| 1217 | self.verify_tunneled_4o4(self.pg1, rx, tx, self.pg0.local_ip4, "1.1.1.2") |
| 1218 | |
| 1219 | # |
| 1220 | # cleanup |
| 1221 | # |
| 1222 | route_via_tun_2.remove_vpp_config() |
| 1223 | gre_if.remove_vpp_config() |
| 1224 | |
| 1225 | def test_mgre(self): |
nothing calls this directly
no test coverage detected