diff --git a/test/test-network/conf/15-name-conflict-test.netdev b/test/test-network/conf/15-name-conflict-test.netdev new file mode 100644 index 0000000000..c9d18d76b6 --- /dev/null +++ b/test/test-network/conf/15-name-conflict-test.netdev @@ -0,0 +1,4 @@ +[NetDev] +Name=dropin-test +Kind=dummy +MACAddress=00:50:56:c0:00:38 diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index fb5c033cd9..d43301ae33 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -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')