From: Yu Watanabe Date: Sun, 31 Mar 2019 16:06:22 +0000 (+0900) Subject: test-network: add test for NetDev.Name= conflict X-Git-Tag: v242-rc1~34^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12157%2Fhead;p=thirdparty%2Fsystemd.git test-network: add test for NetDev.Name= conflict --- 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 00000000000..c9d18d76b62 --- /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 fb5c033cd95..d43301ae333 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')