Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Resolve vppapigen DeprecationWarning.
[vpp.git]
/
test
/
test_ipsec_tun_if_esp.py
diff --git
a/test/test_ipsec_tun_if_esp.py
b/test/test_ipsec_tun_if_esp.py
index
e10e2a3
..
2734908
100644
(file)
--- a/
test/test_ipsec_tun_if_esp.py
+++ b/
test/test_ipsec_tun_if_esp.py
@@
-4,6
+4,7
@@
from scapy.layers.ipsec import ESP
from framework import VppTestRunner
from template_ipsec import TemplateIpsec, IpsecTun4Tests, IpsecTcpTests
from vpp_ipsec_tun_interface import VppIpsecTunInterface
from framework import VppTestRunner
from template_ipsec import TemplateIpsec, IpsecTun4Tests, IpsecTcpTests
from vpp_ipsec_tun_interface import VppIpsecTunInterface
+from vpp_ip_route import VppIpRoute, VppRoutePath
class TemplateIpsecTunIfEsp(TemplateIpsec):
class TemplateIpsecTunIfEsp(TemplateIpsec):
@@
-11,12
+12,11
@@
class TemplateIpsecTunIfEsp(TemplateIpsec):
encryption_type = ESP
encryption_type = ESP
- @classmethod
- def setUpClass(cls):
- super(TemplateIpsecTunIfEsp, cls).setUpClass()
- cls.tun_if = cls.pg0
-
def setUp(self):
def setUp(self):
+ super(TemplateIpsecTunIfEsp, self).setUp()
+
+ self.tun_if = self.pg0
+
p = self.ipv4_params
tun_if = VppIpsecTunInterface(self, self.pg0, p.vpp_tun_spi,
p.scapy_tun_spi, p.crypt_algo_vpp_id,
p = self.ipv4_params
tun_if = VppIpsecTunInterface(self, self.pg0, p.vpp_tun_spi,
p.scapy_tun_spi, p.crypt_algo_vpp_id,
@@
-26,8
+26,10
@@
class TemplateIpsecTunIfEsp(TemplateIpsec):
tun_if.add_vpp_config()
tun_if.admin_up()
tun_if.config_ip4()
tun_if.add_vpp_config()
tun_if.admin_up()
tun_if.config_ip4()
- src4 = socket.inet_pton(socket.AF_INET, p.remote_tun_if_host)
- self.vapi.ip_add_del_route(src4, 32, tun_if.remote_ip4n)
+
+ VppIpRoute(self, p.remote_tun_if_host, 32,
+ [VppRoutePath(tun_if.remote_ip4,
+ 0xffffffff)]).add_vpp_config()
def tearDown(self):
if not self.vpp_dead:
def tearDown(self):
if not self.vpp_dead: