summaryrefslogtreecommitdiffstats
path: root/test/test-network
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-08-21 21:16:09 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-08-21 21:16:12 +0200
commit462be8c957197fc1e776543ac32c18dd72efd536 (patch)
tree65ae13042be123fcda406f0c1864861402a8de1e /test/test-network
parentnetwork/routing-policy-rule: use address family of existing rule when judging... (diff)
downloadsystemd-462be8c957197fc1e776543ac32c18dd72efd536.tar.xz
systemd-462be8c957197fc1e776543ac32c18dd72efd536.zip
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.
Diffstat (limited to 'test/test-network')
-rwxr-xr-xtest/test-network/systemd-networkd-tests.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py
index fae7b58fcc..42af0145b3 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')