]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: add test for Property= in [Match] section 12888/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 29 Jun 2019 17:28:42 +0000 (02:28 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 30 Jun 2019 21:53:35 +0000 (06:53 +0900)
test/test-network/conf/13-not-match-udev-property.network [new file with mode: 0644]
test/test-network/conf/14-match-udev-property.network [new file with mode: 0644]
test/test-network/systemd-networkd-tests.py

diff --git a/test/test-network/conf/13-not-match-udev-property.network b/test/test-network/conf/13-not-match-udev-property.network
new file mode 100644 (file)
index 0000000..f0a530e
--- /dev/null
@@ -0,0 +1,6 @@
+[Match]
+Name=dummy98
+Property=INTERFACE=hoge
+
+[Network]
+IPv6AcceptRA=false
diff --git a/test/test-network/conf/14-match-udev-property.network b/test/test-network/conf/14-match-udev-property.network
new file mode 100644 (file)
index 0000000..b632af1
--- /dev/null
@@ -0,0 +1,7 @@
+[Match]
+Name=dummy98
+Property=INTERFACE=dummy98
+
+[Network]
+IPv6AcceptRA=false
+Address=10.1.2.3/16
index 9c274c128deb3124704ed3316f65068df4f69591..75863c391057e8f6811450a986d146f5a9f3fff2 100755 (executable)
@@ -463,6 +463,8 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
         '11-dummy.netdev',
         '11-dummy.network',
         '12-dummy.netdev',
+        '13-not-match-udev-property.network',
+        '14-match-udev-property.network',
         '15-name-conflict-test.netdev',
         '21-macvlan.netdev',
         '21-macvtap.netdev',
@@ -578,6 +580,15 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
         print(output)
         self.assertRegex(output, '00:50:56:c0:00:28')
 
+    def test_match_udev_property(self):
+        copy_unit_to_networkd_unit_path('12-dummy.netdev', '13-not-match-udev-property.network', '14-match-udev-property.network')
+        start_networkd()
+        wait_online(['dummy98:routable'])
+
+        output = check_output('networkctl status dummy98')
+        print(output)
+        self.assertRegex(output, 'Network File: /run/systemd/network/14-match-udev-property')
+
     def test_wait_online_any(self):
         copy_unit_to_networkd_unit_path('25-bridge.netdev', '25-bridge.network', '11-dummy.netdev', '11-dummy.network')
         start_networkd()