]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: remove all routing policy rules in specified table
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 17 Jun 2019 10:57:54 +0000 (19:57 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 18 Jun 2019 02:35:12 +0000 (11:35 +0900)
test/test-network/systemd-networkd-tests.py

index 5e948623677cee2b4dbcd2da4eba68a6df3ed279..a5056029269e268c5672f5c563dfa8a4913ec3f4 100755 (executable)
@@ -188,7 +188,9 @@ 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: