X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_ipsec_nat.py;h=b7ccb2befdc379832493d814efc46555fe701557;hb=c26cc72edf195a3f57c734b5161bd37995002107;hp=e364f5ffe965062cd0e1481eca80d5fdf05b331c;hpb=a7427ec6f86cbeba7594f98e41fecab291d66b73;p=vpp.git diff --git a/test/test_ipsec_nat.py b/test/test_ipsec_nat.py old mode 100644 new mode 100755 index e364f5ffe96..b7ccb2befdc --- a/test/test_ipsec_nat.py +++ b/test/test_ipsec_nat.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import socket @@ -18,17 +18,18 @@ from vpp_papi import VppEnum class IPSecNATTestCase(TemplateIpsec): """ IPSec/NAT - TUNNEL MODE: + TUNNEL MODE:: - public network | private network - --- encrypt --- plain --- - |pg0| <------- |VPP| <------ |pg1| - --- --- --- + public network | private network + --- encrypt --- plain --- + |pg0| <------- |VPP| <------ |pg1| + --- --- --- + + --- decrypt --- plain --- + |pg0| -------> |VPP| ------> |pg1| + --- --- --- - --- decrypt --- plain --- - |pg0| -------> |VPP| ------> |pg1| - --- --- --- """ tcp_port_in = 6303 @@ -38,6 +39,14 @@ class IPSecNATTestCase(TemplateIpsec): icmp_id_in = 6305 icmp_id_out = 6305 + @classmethod + def setUpClass(cls): + super(IPSecNATTestCase, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + super(IPSecNATTestCase, cls).tearDownClass() + def setUp(self): super(IPSecNATTestCase, self).setUp() self.tun_if = self.pg0 @@ -49,14 +58,13 @@ class IPSecNATTestCase(TemplateIpsec): p = self.ipv4_params self.config_esp_tun(p) - self.logger.info(self.vapi.ppcli("show ipsec")) + self.logger.info(self.vapi.ppcli("show ipsec all")) d = DpoProto.DPO_PROTO_IP6 if p.is_ipv6 else DpoProto.DPO_PROTO_IP4 VppIpRoute(self, p.remote_tun_if_host, p.addr_len, [VppRoutePath(self.tun_if.remote_addr[p.addr_type], 0xffffffff, - proto=d)], - is_ip6=p.is_ipv6).add_vpp_config() + proto=d)]).add_vpp_config() def tearDown(self): super(IPSecNATTestCase, self).tearDown()