mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
test-network: add tests for RoutingPolicyRule.Family=ipv6 and both
This commit is contained in:
parent
f6c6ff97f5
commit
65c24cd087
@ -8,3 +8,15 @@ From= 192.168.100.18
|
||||
Priority=111
|
||||
IncomingInterface=test1
|
||||
OutgoingInterface=test1
|
||||
|
||||
[RoutingPolicyRule]
|
||||
IncomingInterface=test1
|
||||
Table=8
|
||||
Priority=100
|
||||
Family=ipv6
|
||||
|
||||
[RoutingPolicyRule]
|
||||
IncomingInterface=test1
|
||||
Table=9
|
||||
Priority=101
|
||||
Family=both
|
||||
|
@ -1439,7 +1439,7 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
|
||||
'routing-policy-rule-dummy98.network',
|
||||
'routing-policy-rule-test1.network']
|
||||
|
||||
routing_policy_rule_tables = ['7', '8']
|
||||
routing_policy_rule_tables = ['7', '8', '9']
|
||||
routes = [['blackhole', '202.54.1.2'], ['unreachable', '202.54.1.3'], ['prohibit', '202.54.1.4']]
|
||||
|
||||
def setUp(self):
|
||||
@ -1520,15 +1520,36 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
|
||||
start_networkd()
|
||||
self.wait_online(['test1:degraded'])
|
||||
|
||||
output = check_output('ip rule')
|
||||
output = check_output('ip rule list iif test1 priority 111')
|
||||
print(output)
|
||||
self.assertRegex(output, '111')
|
||||
self.assertRegex(output, '111:')
|
||||
self.assertRegex(output, 'from 192.168.100.18')
|
||||
self.assertRegex(output, r'tos (?:0x08|throughput)\s')
|
||||
self.assertRegex(output, 'iif test1')
|
||||
self.assertRegex(output, 'oif test1')
|
||||
self.assertRegex(output, 'lookup 7')
|
||||
|
||||
output = check_output('ip rule list iif test1 priority 101')
|
||||
print(output)
|
||||
self.assertRegex(output, '101:')
|
||||
self.assertRegex(output, 'from all')
|
||||
self.assertRegex(output, 'iif test1')
|
||||
self.assertRegex(output, 'lookup 9')
|
||||
|
||||
output = check_output('ip -6 rule list iif test1 priority 100')
|
||||
print(output)
|
||||
self.assertRegex(output, '100:')
|
||||
self.assertRegex(output, 'from all')
|
||||
self.assertRegex(output, 'iif test1')
|
||||
self.assertRegex(output, 'lookup 8')
|
||||
|
||||
output = check_output('ip -6 rule list iif test1 priority 101')
|
||||
print(output)
|
||||
self.assertRegex(output, '101:')
|
||||
self.assertRegex(output, 'from all')
|
||||
self.assertRegex(output, 'iif test1')
|
||||
self.assertRegex(output, 'lookup 9')
|
||||
|
||||
def test_routing_policy_rule_issue_11280(self):
|
||||
copy_unit_to_networkd_unit_path('routing-policy-rule-test1.network', '11-dummy.netdev',
|
||||
'routing-policy-rule-dummy98.network', '12-dummy.netdev')
|
||||
|
Loading…
Reference in New Issue
Block a user