summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-04-01 01:06:22 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-04-01 10:30:31 +0900
commit753e0a24463125c9954d077c2d2b59d57e08b61c (patch)
tree405f401cedbfe37d52c002d002662c42ae7412ff /test
parent4b4a6c9b415aef902edfc75eb2de330398f7f05a (diff)
downloadsystemd-753e0a24463125c9954d077c2d2b59d57e08b61c.tar.gz
test-network: add test for NetDev.Name= conflict
Diffstat (limited to 'test')
-rw-r--r--test/test-network/conf/15-name-conflict-test.netdev4
-rwxr-xr-xtest/test-network/systemd-networkd-tests.py5
2 files changed, 8 insertions, 1 deletions
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')