diff options
author | Neale Ranns <nranns@cisco.com> | 2019-12-17 00:14:26 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-12-17 17:52:28 +0000 |
commit | e11dce20c99775884877ad6dcf879e8995c78ebf (patch) | |
tree | db56dc5538c276e62be33179815557a3db297632 /test/test_gre.py | |
parent | 70ef0faea9f706004c068fb843797a7cb08a9e68 (diff) |
nhrp: mGREv6
Type: test
Change-Id: I7d0496c37e06d3b6eee325a262e5398860282b63
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'test/test_gre.py')
-rw-r--r-- | test/test_gre.py | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/test/test_gre.py b/test/test_gre.py index c28c04b988c..96fe3042b4e 100644 --- a/test/test_gre.py +++ b/test/test_gre.py @@ -1050,6 +1050,84 @@ class TestGRE(VppTestCase): gre_if.admin_down() gre_if.unconfig_ip4() + def test_mgre6(self): + """ mGRE IPv6 tunnel Tests """ + + self.pg0.ip6_enable() + + for itf in self.pg_interfaces[3:]: + # + # one underlay nh for each overlay/tunnel peer + # + itf.config_ip6() + itf.generate_remote_hosts(4) + itf.configure_ipv6_neighbors() + + # + # Create an L3 GRE tunnel. + # - set it admin up + # - assign an IP Addres + # - Add a route via the tunnel + # + gre_if = VppGreInterface(self, + itf.local_ip6, + "::", + mode=(VppEnum.vl_api_gre_tunnel_mode_t. + GRE_API_TUNNEL_MODE_MP)) + gre_if.add_vpp_config() + gre_if.admin_up() + gre_if.config_ip6() + gre_if.generate_remote_hosts(4) + + # + # for-each peer + # + for ii in range(1, 4): + route_addr = "4::%d" % ii + + # + # route traffic via the peer + # + route_via_tun = VppIpRoute( + self, route_addr, 128, + [VppRoutePath(gre_if._remote_hosts[ii].ip6, + gre_if.sw_if_index)]) + route_via_tun.add_vpp_config() + + # + # Add a NHRP entry resolves the peer + # + nhrp = VppNhrp(self, gre_if, + gre_if._remote_hosts[ii].ip6, + itf._remote_hosts[ii].ip6) + nhrp.add_vpp_config() + + # + # Send a packet stream that is routed into the tunnel + # - packets are GRE encapped + # + tx = self.create_stream_ip6(self.pg0, "5::5", route_addr) + rx = self.send_and_expect(self.pg0, tx, itf) + self.verify_tunneled_6o6(self.pg0, rx, tx, + itf.local_ip6, + gre_if._remote_hosts[ii].ip6) + + # + # delete and re-add the NHRP + # + nhrp.remove_vpp_config() + self.send_and_assert_no_replies(self.pg0, tx) + + nhrp.add_vpp_config() + rx = self.send_and_expect(self.pg0, tx, itf) + self.verify_tunneled_6o6(self.pg0, rx, tx, + itf.local_ip6, + gre_if._remote_hosts[ii].ip6) + gre_if.admin_down() + gre_if.unconfig_ip4() + itf.unconfig_ip6() + self.pg0.ip6_disable() + if __name__ == '__main__': unittest.main(testRunner=VppTestRunner) |