diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-03-01 04:09:00 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-03-11 17:57:16 +0100 |
commit | c84a5f5eaf6a929505a76acfebfe63cdd6152de8 (patch) | |
tree | 5ce63786aed4279b09b873ed0326ff625c13e56f /test/networkd-test.py | |
parent | networkctl: introduce "persistent-storage" command (diff) | |
download | systemd-c84a5f5eaf6a929505a76acfebfe63cdd6152de8.tar.xz systemd-c84a5f5eaf6a929505a76acfebfe63cdd6152de8.zip |
test-network: add support for systemd-networkd-persistent-storage.service
Diffstat (limited to 'test/networkd-test.py')
-rwxr-xr-x | test/networkd-test.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/networkd-test.py b/test/networkd-test.py index 512137cacc..ab30928c27 100755 --- a/test/networkd-test.py +++ b/test/networkd-test.py @@ -888,8 +888,10 @@ class NetworkdClientTest(ClientTestBase, unittest.TestCase): set -eu mkdir -p /run/systemd/network mkdir -p /run/systemd/netif +mkdir -p /var/lib/systemd/network mount -t tmpfs none /run/systemd/network mount -t tmpfs none /run/systemd/netif +mount -t tmpfs none /var/lib/systemd/network [ ! -e /run/dbus ] || mount -t tmpfs none /run/dbus # create router/client veth pair cat <<EOF >/run/systemd/network/50-test.netdev @@ -917,6 +919,10 @@ DNS=192.168.5.1 {dhopts} EOF +# For the networkd instance invoked below cannot support varlink connection. +# Hence, 'networkctl persistent-storage yes' cannot be used. +touch /run/systemd/netif/persistent-storage-ready + # run networkd as in systemd-networkd.service exec $(systemctl cat systemd-networkd.service | sed -n '/^ExecStart=/ {{ s/^.*=//; s/^[@+-]//; s/^!*//; p}}') '''.format(ifr=self.if_router, @@ -930,6 +936,7 @@ exec $(systemctl cat systemd-networkd.service | sed -n '/^ExecStart=/ {{ s/^.*=/ '-p', 'InaccessibleDirectories=-/etc/systemd/network', '-p', 'InaccessibleDirectories=-/run/systemd/network', '-p', 'InaccessibleDirectories=-/run/systemd/netif', + '-p', 'InaccessibleDirectories=-/var/lib/systemd/network', '--service-type=notify', script]) # wait until devices got created |