summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-09-09 12:27:57 +0200
committerGitHub <noreply@github.com>2023-09-09 12:27:57 +0200
commit795fcb74b6461d5ef4276a97b63c472461dda0a1 (patch)
tree03af122a5cac8676e46848996538a8e1d5bceb19
parentf494325bfde2ba9ff708fa00a7582a5fb6182486 (diff)
parent849499f44f6e50c591e250cf40b5ab0115839b53 (diff)
downloadvyos-1x-795fcb74b6461d5ef4276a97b63c472461dda0a1.tar.gz
vyos-1x-795fcb74b6461d5ef4276a97b63c472461dda0a1.zip
Merge pull request #2230 from sever-sever/T5562
T5562: Cleanup netns for smoketest load-balancing wan
-rwxr-xr-xsmoketest/scripts/cli/test_load_balancing_wan.py7
-rwxr-xr-xsrc/op_mode/otp.py2
2 files changed, 6 insertions, 3 deletions
diff --git a/smoketest/scripts/cli/test_load_balancing_wan.py b/smoketest/scripts/cli/test_load_balancing_wan.py
index 9b2cb0fac..47ca19b27 100755
--- a/smoketest/scripts/cli/test_load_balancing_wan.py
+++ b/smoketest/scripts/cli/test_load_balancing_wan.py
@@ -124,11 +124,12 @@ class TestLoadBalancingWan(VyOSUnitTestSHIM.TestCase):
self.assertEqual(tmp, original)
# Delete veth interfaces and netns
- for iface in [iface1, iface2, iface3, container_iface1, container_iface2, container_iface3]:
+ for iface in [iface1, iface2, iface3]:
call(f'sudo ip link del dev {iface}')
delete_netns(ns1)
delete_netns(ns2)
+ delete_netns(ns3)
def test_check_chains(self):
@@ -246,11 +247,13 @@ class TestLoadBalancingWan(VyOSUnitTestSHIM.TestCase):
self.assertEqual(tmp, nat_vyos_pre_snat_hook)
# Delete veth interfaces and netns
- for iface in [iface1, iface2, iface3, container_iface1, container_iface2, container_iface3]:
+ for iface in [iface1, iface2, iface3]:
call(f'sudo ip link del dev {iface}')
delete_netns(ns1)
delete_netns(ns2)
+ delete_netns(ns3)
+
if __name__ == '__main__':
unittest.main(verbosity=2)
diff --git a/src/op_mode/otp.py b/src/op_mode/otp.py
index c472a1ed3..6d4298894 100755
--- a/src/op_mode/otp.py
+++ b/src/op_mode/otp.py
@@ -23,7 +23,7 @@ from jinja2 import Template
from vyos.configquery import ConfigTreeQuery
from vyos.xml import defaults
from vyos.configdict import dict_merge
-from vyos.util import popen
+from vyos.utils.process import popen
users_otp_template = Template("""