diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-11-26 14:05:48 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-11-26 14:48:27 +0100 |
commit | d80734f7cd884ef1261ace989549cad28de010f2 (patch) | |
tree | 88be19e04555cb9f304970bc47974e0591e77419 /test/test-network/systemd-networkd-tests.py | |
parent | test-network: add tests for dropin .conf files (diff) | |
download | systemd-d80734f7cd884ef1261ace989549cad28de010f2.tar.xz systemd-d80734f7cd884ef1261ace989549cad28de010f2.zip |
test-network: add one more test for netdev dropin .conf files
For netdev, config files are loaded twice, and the first time,
only Match and NetDev setions are read. So, the test given by
the previous commit covers only the second loading.
This adds another test that also covers the first loading.
Diffstat (limited to '')
-rwxr-xr-x | test/test-network/systemd-networkd-tests.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 11b4aa1273..2525a35f76 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -153,7 +153,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): links =['bridge99', 'bond99', 'bond99', 'vlan99', 'test1', 'macvtap99', 'macvlan99', 'ipvlan99', 'vxlan99', 'veth99', 'vrf99', 'tun99', 'tap99', 'vcan99', 'geneve99', 'dummy98', 'ipiptun99', 'sittun99', '6rdtun99', - 'gretap99', 'vtitun99', 'vti6tun99','ip6tnl99', 'gretun99', 'ip6gretap99', 'wg99'] + 'gretap99', 'vtitun99', 'vti6tun99','ip6tnl99', 'gretun99', 'ip6gretap99', 'wg99', 'dropin-test'] units = ['25-bridge.netdev', '25-bond.netdev', '21-vlan.netdev', '11-dummy.netdev', '21-vlan.network', '21-macvtap.netdev', 'macvtap.network', '21-macvlan.netdev', 'macvlan.network', 'vxlan.network', @@ -163,7 +163,7 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): '25-gre-tunnel.netdev', '25-gretap-tunnel.netdev', '25-vti-tunnel.netdev', '25-vti6-tunnel.netdev', '12-dummy.netdev', 'gre.network', 'ipip.network', 'ip6gretap.network', 'gretun.network', 'ip6tnl.network', '25-tap.netdev', 'vti6.network', 'vti.network', 'gretap.network', 'sit.network', - '25-ipip-tunnel-independent.netdev', '25-wireguard.netdev', '6rd.network'] + '25-ipip-tunnel-independent.netdev', '25-wireguard.netdev', '6rd.network', '10-dropin-test.netdev'] def setUp(self): self.link_remove(self.links) @@ -172,6 +172,17 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): self.link_remove(self.links) self.remove_unit_from_networkd_path(self.units) + def test_dropin(self): + self.copy_unit_to_networkd_unit_path('10-dropin-test.netdev') + + self.start_networkd() + + self.assertTrue(self.link_exits('dropin-test')) + + output = subprocess.check_output(['ip', 'link', 'show', 'dropin-test']).rstrip().decode('utf-8') + print(output) + self.assertRegex(output, '00:50:56:c0:00:28') + def test_bridge(self): self.copy_unit_to_networkd_unit_path('25-bridge.netdev') self.start_networkd() |