1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

test-network: add test for NetDev.Name= conflict

This commit is contained in:
Yu Watanabe 2019-04-01 01:06:22 +09:00
parent 4b4a6c9b41
commit 753e0a2446
2 changed files with 8 additions and 1 deletions

View File

@ -0,0 +1,4 @@
[NetDev]
Name=dropin-test
Kind=dummy
MACAddress=00:50:56:c0:00:38

View File

@ -245,6 +245,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
'10-dropin-test.netdev',
'11-dummy.netdev',
'12-dummy.netdev',
'15-name-conflict-test.netdev',
'21-macvlan.netdev',
'21-macvtap.netdev',
'21-vlan-test1.network',
@ -322,11 +323,13 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
self.remove_unit_from_networkd_path(self.units)
def test_dropin(self):
self.copy_unit_to_networkd_unit_path('10-dropin-test.netdev')
self.copy_unit_to_networkd_unit_path('10-dropin-test.netdev', '15-name-conflict-test.netdev')
self.start_networkd()
self.assertTrue(self.link_exits('dropin-test'))
# This also tests NetDev.Name= conflict and basic networkctl functionalities
output = subprocess.check_output(['ip', 'link', 'show', 'dropin-test']).rstrip().decode('utf-8')
print(output)
self.assertRegex(output, '00:50:56:c0:00:28')