From 74888b22f92abf7f10c8b0baddf815fb5d462897 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Wed, 19 Feb 2020 08:47:31 +0100 Subject: tunnel: remove duplicated code --- scripts/cli/test_interfaces_tunnel.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/cli/test_interfaces_tunnel.py b/scripts/cli/test_interfaces_tunnel.py index 01d6ff93b..f67bda702 100755 --- a/scripts/cli/test_interfaces_tunnel.py +++ b/scripts/cli/test_interfaces_tunnel.py @@ -15,10 +15,8 @@ # along with this program. If not, see . from base_interfaces_test import * - from vyos.ifconfig import Interface - class TunnelInterfaceTest(BasicInterfaceTest.BaseTest): _base_path = ['interfaces', 'tunnel'] _interfaces = [] @@ -54,10 +52,9 @@ class TunnelInterfaceTest(BasicInterfaceTest.BaseTest): self._test_mtu = True super().setUp() - self.session.set(['interfaces', 'dummy', 'dum444', - 'address', '169.254.0.1/24']) - self.session.set( - ['interfaces', 'dummy', 'dum666', 'address', '2002::1/16']) + 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']) self.session.commit() local = { @@ -77,6 +74,5 @@ class TunnelInterfaceTest(BasicInterfaceTest.BaseTest): self.session.set(self._base_path + [intf, name, tunnel[name]]) number += 1 - if __name__ == '__main__': unittest.main() -- cgit v1.2.3