From 462be8c957197fc1e776543ac32c18dd72efd536 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 22 Aug 2024 04:16:09 +0900 Subject: [PATCH] test-network: find routing policy rule by priority We usually configure a test rule with a unique priority. Hence, finding rule by priority reduces the lines of output, and we can debug easily. Also print short comments on check. That's helpful when the check is called several times. --- test/test-network/systemd-networkd-tests.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index fae7b58fccb..42af0145b3a 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -3211,6 +3211,8 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): self.assertRegex(output, routable_map[carrier]) def check_routing_policy_rule_test1(self): + print('### Checking routing policy rules requested by test1') + output = check_output('ip rule list iif test1 priority 111') print(output) self.assertRegex(output, r'111: from 192.168.100.18 tos (0x08|throughput) iif test1 oif test1 lookup 7') @@ -3236,7 +3238,9 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities): self.assertIn('104: from 10.1.0.0/16 iif test1 lookup 12 nop', output) def check_routing_policy_rule_dummy98(self): - output = check_output('ip rule list table 8') + print('### Checking routing policy rules requested by dummy98') + + output = check_output('ip rule list priority 112') print(output) self.assertRegex(output, r'112: from 192.168.101.18 tos (0x08|throughput) iif dummy98 oif dummy98 lookup 8') -- 2.47.3