diff options
author | Neale Ranns <nranns@cisco.com> | 2019-03-29 20:23:58 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-04-02 14:10:28 +0000 |
commit | f05e732e4af604d37de5b665436594e8e2eee45d (patch) | |
tree | 015c62c1c60c22e6dcd8edc8ccf0bdca75cd2ac9 /test/vpp_ipsec_tun_interface.py | |
parent | 2b5ba9501c3dda3645bf01eb53b2821471f2a946 (diff) |
IPSEC-GRE; tests
failing test disabled on ARM
Change-Id: I6b7535cd8f51fdaf9786ba77f9f61a7d8d049bbd
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'test/vpp_ipsec_tun_interface.py')
-rw-r--r-- | test/vpp_ipsec_tun_interface.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/vpp_ipsec_tun_interface.py b/test/vpp_ipsec_tun_interface.py index c427936fa08..1a41244a0c5 100644 --- a/test/vpp_ipsec_tun_interface.py +++ b/test/vpp_ipsec_tun_interface.py @@ -45,3 +45,48 @@ class VppIpsecTunInterface(VppTunnelInterface): def object_id(self): return "ipsec-tun-if-%d" % self._sw_if_index + + +class VppIpsecGRETunInterface(VppTunnelInterface): + """ + VPP IPsec GRE Tunnel interface + this creates headers + IP / ESP / IP / GRE / payload + i.e. it's GRE over IPSEC, rather than IPSEC over GRE. + """ + + def __init__(self, test, parent_if, sa_out, sa_in): + super(VppIpsecGRETunInterface, self).__init__(test, parent_if) + self.sa_in = sa_in + self.sa_out = sa_out + + def add_vpp_config(self): + r = self.test.vapi.ipsec_gre_tunnel_add_del( + self.parent_if.local_ip4n, + self.parent_if.remote_ip4n, + self.sa_out, + self.sa_in) + self.set_sw_if_index(r.sw_if_index) + self.generate_remote_hosts() + self.test.registry.register(self, self.test.logger) + + def remove_vpp_config(self): + self.test.vapi.ipsec_gre_tunnel_add_del( + self.parent_if.local_ip4n, + self.parent_if.remote_ip4n, + self.sa_out, + self.sa_in, + is_add=0) + + def query_vpp_config(self): + ts = self.test.vapi.ipsec_gre_tunnel_dump(sw_if_index=0xffffffff) + for t in ts: + if t.tunnel.sw_if_index == self._sw_if_index: + return True + return False + + def __str__(self): + return self.object_id() + + def object_id(self): + return "ipsec-gre-tun-if-%d" % self._sw_if_index |