diff options
author | Neale Ranns <nranns@cisco.com> | 2019-12-16 00:53:11 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-02-21 09:54:19 +0000 |
commit | 282872127bbeee6ae59ab3f885c09bad601ee0cc (patch) | |
tree | 4f1ef8243b194ca8bf6f1acd62ba4a7d688d371e /test/vpp_ipsec.py | |
parent | d057625d499525625d60d2207665eaeb755e380e (diff) |
ipsec: IPSec protection for multi-point tunnel interfaces
Type: feature
Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: Iaba2ab11bfaa1c8db4023434e3043ac39500f938
Diffstat (limited to 'test/vpp_ipsec.py')
-rw-r--r-- | test/vpp_ipsec.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/test/vpp_ipsec.py b/test/vpp_ipsec.py index 8144ea27c8f..268fe687876 100644 --- a/test/vpp_ipsec.py +++ b/test/vpp_ipsec.py @@ -272,13 +272,16 @@ class VppIpsecTunProtect(VppObject): VPP IPSEC tunnel protection """ - def __init__(self, test, itf, sa_out, sas_in): + def __init__(self, test, itf, sa_out, sas_in, nh=None): self.test = test self.itf = itf self.sas_in = [] for sa in sas_in: self.sas_in.append(sa.id) self.sa_out = sa_out.id + self.nh = nh + if not self.nh: + self.nh = "0.0.0.0" def update_vpp_config(self, sa_out, sas_in): self.sas_in = [] @@ -290,10 +293,11 @@ class VppIpsecTunProtect(VppObject): 'sw_if_index': self.itf._sw_if_index, 'n_sa_in': len(self.sas_in), 'sa_out': self.sa_out, - 'sa_in': self.sas_in}) + 'sa_in': self.sas_in, + 'nh': self.nh}) def object_id(self): - return "ipsec-tun-protect-%s" % self.itf + return "ipsec-tun-protect-%s-%s" % (self.itf, self.nh) def add_vpp_config(self): self.test.vapi.ipsec_tunnel_protect_update( @@ -301,17 +305,20 @@ class VppIpsecTunProtect(VppObject): 'sw_if_index': self.itf._sw_if_index, 'n_sa_in': len(self.sas_in), 'sa_out': self.sa_out, - 'sa_in': self.sas_in}) + 'sa_in': self.sas_in, + 'nh': self.nh}) self.test.registry.register(self, self.test.logger) def remove_vpp_config(self): self.test.vapi.ipsec_tunnel_protect_del( - sw_if_index=self.itf.sw_if_index) + sw_if_index=self.itf.sw_if_index, + nh=self.nh) def query_vpp_config(self): bs = self.test.vapi.ipsec_tunnel_protect_dump( sw_if_index=self.itf.sw_if_index) for b in bs: - if b.tun.sw_if_index == self.itf.sw_if_index: + if b.tun.sw_if_index == self.itf.sw_if_index and \ + self.nh == str(b.tun.nh): return True return False |