]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: add tests for dropin .conf files
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 26 Nov 2018 06:01:01 +0000 (15:01 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 26 Nov 2018 06:01:01 +0000 (15:01 +0900)
test/test-network/conf/21-vlan.netdev
test/test-network/conf/21-vlan.netdev.d/override.conf [new file with mode: 0644]
test/test-network/conf/21-vlan.network
test/test-network/conf/21-vlan.network.d/override.conf [new file with mode: 0644]
test/test-network/systemd-networkd-tests.py

index fe9801c8a2654c04d9b18f258f537eea68f14415..af39404b5f2d070c6d5812017c8a062b282a4b7e 100644 (file)
@@ -1,10 +1,3 @@
 [NetDev]
 Name=vlan99
 Kind=vlan
-
-[VLAN]
-Id=99
-GVRP=true
-MVRP=true
-LooseBinding=true
-ReorderHeader=true
diff --git a/test/test-network/conf/21-vlan.netdev.d/override.conf b/test/test-network/conf/21-vlan.netdev.d/override.conf
new file mode 100644 (file)
index 0000000..cd61be5
--- /dev/null
@@ -0,0 +1,6 @@
+[VLAN]
+Id=99
+GVRP=true
+MVRP=true
+LooseBinding=true
+ReorderHeader=true
index a4fa1decde7a12a50a9fbf7a47acf5f9579a3367..afe1debe081b766c2f79663e3816bc13e6893fe7 100644 (file)
@@ -1,5 +1,2 @@
 [Match]
 Name=test1
-
-[Network]
-VLAN=vlan99
diff --git a/test/test-network/conf/21-vlan.network.d/override.conf b/test/test-network/conf/21-vlan.network.d/override.conf
new file mode 100644 (file)
index 0000000..363fc90
--- /dev/null
@@ -0,0 +1,2 @@
+[Network]
+VLAN=vlan99
index e1ff2dad2375027cc5579187653c5bfb8327ab9f..11b4aa12734d052a7aa496a2e9e3f321a20beeec 100755 (executable)
@@ -74,11 +74,15 @@ class Utilities():
     def copy_unit_to_networkd_unit_path(self, *units):
         for unit in units:
             shutil.copy(os.path.join(networkd_ci_path, unit), network_unit_file_path)
+            if (os.path.exists(os.path.join(networkd_ci_path, unit + '.d'))):
+                copytree(os.path.join(networkd_ci_path, unit + '.d'), os.path.join(network_unit_file_path, unit + '.d'))
 
     def remove_unit_from_networkd_path(self, units):
         for unit in units:
             if (os.path.exists(os.path.join(network_unit_file_path, unit))):
                 os.remove(os.path.join(network_unit_file_path, unit))
+                if (os.path.exists(os.path.join(network_unit_file_path, unit + '.d'))):
+                    shutil.rmtree(os.path.join(network_unit_file_path, unit + '.d'))
 
     def start_dnsmasq(self):
         subprocess.check_call('dnsmasq -8 /var/run/networkd-ci/test-dnsmasq-log-file --log-queries=extra --log-dhcp --pid-file=/var/run/networkd-ci/test-test-dnsmasq.pid --conf-file=/dev/null --interface=veth-peer --enable-ra --dhcp-range=2600::10,2600::20 --dhcp-range=192.168.5.10,192.168.5.200 -R --dhcp-leasefile=/var/run/networkd-ci/lease --dhcp-option=26,1492 --dhcp-option=option:router,192.168.5.1 --dhcp-option=33,192.168.5.4,192.168.5.5', shell=True)