summaryrefslogtreecommitdiff
path: root/scripts/cli
diff options
context:
space:
mode:
authorThomas Mangin <thomas.mangin@exa.net.uk>2020-02-19 09:53:33 +0000
committerThomas Mangin <thomas.mangin@exa.net.uk>2020-02-19 10:03:22 +0000
commit30965ed538d6b90e338c25c4c5bfe45cebdc1ce4 (patch)
tree11cc0c2978c30f2b0156e5580209eb24c08a3674 /scripts/cli
parent74888b22f92abf7f10c8b0baddf815fb5d462897 (diff)
downloadvyos-1x-30965ed538d6b90e338c25c4c5bfe45cebdc1ce4.tar.gz
vyos-1x-30965ed538d6b90e338c25c4c5bfe45cebdc1ce4.zip
tunnel: tidying up
move all variable creation within setUp() create the interfaces using a list comprehension
Diffstat (limited to 'scripts/cli')
-rwxr-xr-xscripts/cli/test_interfaces_tunnel.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/cli/test_interfaces_tunnel.py b/scripts/cli/test_interfaces_tunnel.py
index f67bda702..136a33c35 100755
--- a/scripts/cli/test_interfaces_tunnel.py
+++ b/scripts/cli/test_interfaces_tunnel.py
@@ -17,10 +17,8 @@
from base_interfaces_test import *
from vyos.ifconfig import Interface
-class TunnelInterfaceTest(BasicInterfaceTest.BaseTest):
- _base_path = ['interfaces', 'tunnel']
- _interfaces = []
+class TunnelInterfaceTest(BasicInterfaceTest.BaseTest):
# encoding, tunnel endpoint (v4/v6), address (v4/v6)
_valid = [
('gre', 4, 4),
@@ -47,11 +45,13 @@ class TunnelInterfaceTest(BasicInterfaceTest.BaseTest):
}
def setUp(self):
- for number in range(len(self._valid)):
- self._interfaces.append('tun%d' % (number+1))
- self._test_mtu = True
super().setUp()
+ self._base_path = ['interfaces', 'tunnel']
+ self._interfaces = ['tun%d' % (n+1) for n in range(len(self._valid))]
+ self._test_mtu = True
+
+ # creating two dummy interface as to use as local-ip for the tunnels
base_path = ['interfaces', 'dummy']
self.session.set(base_path + ['dum444', 'address', '169.254.0.1/24'])
self.session.set(base_path + ['dum666', 'address', '2002::1/16'])