summaryrefslogtreecommitdiffstats
path: root/test/vpp_ipsec_tun_interface.py
diff options
context:
space:
mode:
authorKingwel Xie <kingwel.xie@ericsson.com>2019-03-20 07:21:58 -0400
committerNeale Ranns <nranns@cisco.com>2019-03-21 07:42:09 +0000
commit1ba5bc8d888d0164dd6e38857cbed09ab7ce1d8b (patch)
treeea87c57b0db7f981878e2cdb66f7f650cbc71447 /test/vpp_ipsec_tun_interface.py
parenta5efca30f569ff93cfb85ed1bc7742cee824426d (diff)
ipsec: add ipv6 support for ipsec tunnel interface
Change-Id: I6a76907dc7bed2a81282b63669bea2219d6903c9 Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com> Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'test/vpp_ipsec_tun_interface.py')
-rw-r--r--test/vpp_ipsec_tun_interface.py25
1 files changed, 16 insertions, 9 deletions
diff --git a/test/vpp_ipsec_tun_interface.py b/test/vpp_ipsec_tun_interface.py
index bd635417f02..5c014ea282b 100644
--- a/test/vpp_ipsec_tun_interface.py
+++ b/test/vpp_ipsec_tun_interface.py
@@ -8,7 +8,7 @@ class VppIpsecTunInterface(VppTunnelInterface):
def __init__(self, test, parent_if, local_spi,
remote_spi, crypto_alg, local_crypto_key, remote_crypto_key,
- integ_alg, local_integ_key, remote_integ_key):
+ integ_alg, local_integ_key, remote_integ_key, is_ip6=False):
super(VppIpsecTunInterface, self).__init__(test, parent_if)
self.local_spi = local_spi
self.remote_spi = remote_spi
@@ -18,23 +18,30 @@ class VppIpsecTunInterface(VppTunnelInterface):
self.integ_alg = integ_alg
self.local_integ_key = local_integ_key
self.remote_integ_key = remote_integ_key
+ if is_ip6:
+ self.local_ip = self.parent_if.local_ip6
+ self.remote_ip = self.parent_if.remote_ip6
+ else:
+ self.local_ip = self.parent_if.local_ip4
+ self.remote_ip = self.parent_if.remote_ip4
def add_vpp_config(self):
r = self.test.vapi.ipsec_tunnel_if_add_del(
- self.parent_if.local_ip4n, self.parent_if.remote_ip4n,
- self.remote_spi, self.local_spi, self.crypto_alg,
- self.local_crypto_key, self.remote_crypto_key, self.integ_alg,
- self.local_integ_key, self.remote_integ_key)
+ self.local_ip, self.remote_ip,
+ self.remote_spi, self.local_spi,
+ self.crypto_alg, self.local_crypto_key, self.remote_crypto_key,
+ self.integ_alg, self.local_integ_key, self.remote_integ_key)
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_tunnel_if_add_del(
- self.parent_if.local_ip4n, self.parent_if.remote_ip4n,
- self.remote_spi, self.local_spi, self.crypto_alg,
- self.local_crypto_key, self.remote_crypto_key, self.integ_alg,
- self.local_integ_key, self.remote_integ_key, is_add=0)
+ self.local_ip, self.remote_ip,
+ self.remote_spi, self.local_spi,
+ self.crypto_alg, self.local_crypto_key, self.remote_crypto_key,
+ self.integ_alg, self.local_integ_key, self.remote_integ_key,
+ is_add=0)
def __str__(self):
return self.object_id()