]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: add test for NetDev.Name= conflict 12157/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 31 Mar 2019 16:06:22 +0000 (01:06 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 1 Apr 2019 01:30:31 +0000 (10:30 +0900)
test/test-network/conf/15-name-conflict-test.netdev [new file with mode: 0644]
test/test-network/systemd-networkd-tests.py

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 (file)
index 0000000..c9d18d7
--- /dev/null
@@ -0,0 +1,4 @@
+[NetDev]
+Name=dropin-test
+Kind=dummy
+MACAddress=00:50:56:c0:00:38
index fb5c033cd951332f49884b4ea528d78204f0f3a8..d43301ae333e5e38b5fe0959282cbadd30c730b8 100755 (executable)
@@ -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')