]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - test/test-network/systemd-networkd-tests.py
test-network: rename l2tp_tunnel_remove -> remove_l2tp_tunnels
[thirdparty/systemd.git] / test / test-network / systemd-networkd-tests.py
index 5e948623677cee2b4dbcd2da4eba68a6df3ed279..97a75fba372dd5f494f4352417eedfffb6c309c1 100755 (executable)
@@ -188,13 +188,15 @@ def remove_fou_ports(ports):
 
 def remove_routing_policy_rule_tables(tables):
     for table in tables:
-        call('ip rule del table', table, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
+        rc = 0
+        while rc == 0:
+            rc = call('ip rule del table', table, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
 
 def remove_routes(routes):
     for route_type, addr in routes:
         call('ip route del', route_type, addr, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
 
-def l2tp_tunnel_remove(tunnel_ids):
+def remove_l2tp_tunnels(tunnel_ids):
     output = check_output('ip l2tp show tunnel')
     for tid in tunnel_ids:
         words='Tunnel ' + tid + ', encap'
@@ -1165,11 +1167,11 @@ class NetworkdL2TPTests(unittest.TestCase, Utilities):
     l2tp_tunnel_ids = [ '10' ]
 
     def setUp(self):
-        l2tp_tunnel_remove(self.l2tp_tunnel_ids)
+        remove_l2tp_tunnels(self.l2tp_tunnel_ids)
         remove_links(self.links)
 
     def tearDown(self):
-        l2tp_tunnel_remove(self.l2tp_tunnel_ids)
+        remove_l2tp_tunnels(self.l2tp_tunnel_ids)
         remove_links(self.links)
         remove_unit_from_networkd_path(self.units)