1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

test-network: add test for Property= in [Match] section

This commit is contained in:
Yu Watanabe 2019-06-30 02:28:42 +09:00
parent f706340979
commit 6b9518a0e8
3 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,6 @@
[Match]
Name=dummy98
Property=INTERFACE=hoge
[Network]
IPv6AcceptRA=false

View File

@ -0,0 +1,7 @@
[Match]
Name=dummy98
Property=INTERFACE=dummy98
[Network]
IPv6AcceptRA=false
Address=10.1.2.3/16

View File

@ -463,6 +463,8 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
'11-dummy.netdev',
'11-dummy.network',
'12-dummy.netdev',
'13-not-match-udev-property.network',
'14-match-udev-property.network',
'15-name-conflict-test.netdev',
'21-macvlan.netdev',
'21-macvtap.netdev',
@ -578,6 +580,15 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
print(output)
self.assertRegex(output, '00:50:56:c0:00:28')
def test_match_udev_property(self):
copy_unit_to_networkd_unit_path('12-dummy.netdev', '13-not-match-udev-property.network', '14-match-udev-property.network')
start_networkd()
wait_online(['dummy98:routable'])
output = check_output('networkctl status dummy98')
print(output)
self.assertRegex(output, 'Network File: /run/systemd/network/14-match-udev-property')
def test_wait_online_any(self):
copy_unit_to_networkd_unit_path('25-bridge.netdev', '25-bridge.network', '11-dummy.netdev', '11-dummy.network')
start_networkd()