From 30965ed538d6b90e338c25c4c5bfe45cebdc1ce4 Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Wed, 19 Feb 2020 09:53:33 +0000 Subject: tunnel: tidying up move all variable creation within setUp() create the interfaces using a list comprehension --- scripts/cli/test_interfaces_tunnel.py | 12 ++++++------ 1 file 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']) -- cgit v1.2.3