diff options
Diffstat (limited to 'test/test_ipsec_tun_if_esp.py')
-rw-r--r-- | test/test_ipsec_tun_if_esp.py | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/test/test_ipsec_tun_if_esp.py b/test/test_ipsec_tun_if_esp.py index a722ce77bb1..9d01b93114e 100644 --- a/test/test_ipsec_tun_if_esp.py +++ b/test/test_ipsec_tun_if_esp.py @@ -21,6 +21,7 @@ from vpp_sub_interface import L2_VTR_OP, VppDot1QSubint from vpp_teib import VppTeib from util import ppp from vpp_papi import VppEnum +from vpp_papi_provider import CliFailedCommandError from vpp_acl import AclRule, VppAcl, VppAclInterface @@ -2512,8 +2513,8 @@ class TemplateIpsecItf4(object): [p.tun_sa_in]) p.tun_protect.add_vpp_config() - def config_network(self, p): - p.tun_if = VppIpsecInterface(self) + def config_network(self, p, instance=0xffffffff): + p.tun_if = VppIpsecInterface(self, instance=instance) p.tun_if.add_vpp_config() p.tun_if.admin_up() @@ -2555,6 +2556,18 @@ class TestIpsecItf4(TemplateIpsec, def tearDown(self): super(TestIpsecItf4, self).tearDown() + def test_tun_instance_44(self): + p = self.ipv4_params + self.config_network(p, instance=3) + + with self.assertRaises(CliFailedCommandError): + self.vapi.cli("show interface ipsec0") + + output = self.vapi.cli("show interface ipsec3") + self.assertTrue("unknown" not in output) + + self.unconfig_network(p) + def test_tun_44(self): """IPSEC interface IPv4""" @@ -2644,6 +2657,11 @@ class TestIpsecItf4(TemplateIpsec, self.verify_tun_44(p, count=n_pkts) + # teardown + self.unconfig_protect(p) + self.unconfig_sa(p) + self.unconfig_network(p) + class TemplateIpsecItf6(object): """ IPsec Interface IPv6 """ |