From: Yu Watanabe Date: Wed, 18 Sep 2024 23:43:51 +0000 (+0900) Subject: test: create .netdev file at last X-Git-Tag: v257-rc1~400^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2bcc2a89f3b52cb98e81c4ec1af82600919e2d7d;p=thirdparty%2Fsystemd.git test: create .netdev file at last Previously, when the test ran on mkosi, then networkd was not masked, and might be already started. In that case, the interface test2 would be created soon after the .netdev file is created, and the .link file would not be applied to the interface. Hence, the later test case for 'networkctl cat @test2:link' would fail. This make networkd always started at the beginning of the test, and .netdev file created after .link file is created. So, .link file is always applied to the interface created by the .netdev file. --- diff --git a/test/units/TEST-74-AUX-UTILS.networkctl.sh b/test/units/TEST-74-AUX-UTILS.networkctl.sh index 0576d6c0556..3d402a7182f 100755 --- a/test/units/TEST-74-AUX-UTILS.networkctl.sh +++ b/test/units/TEST-74-AUX-UTILS.networkctl.sh @@ -21,6 +21,9 @@ at_exit() { trap at_exit EXIT +systemctl unmask systemd-networkd.service +systemctl start systemd-networkd.service + export NETWORK_NAME="10-networkctl-test-$RANDOM.network" export NETDEV_NAME="10-networkctl-test-$RANDOM.netdev" export LINK_NAME="10-networkctl-test-$RANDOM.link" @@ -75,15 +78,6 @@ cmp "+4" "/etc/systemd/network/${NETWORK_NAME}.d/test.conf" networkctl cat "$NETWORK_NAME" | grep '^# ' | cmp - <(printf '%s\n' "# /etc/systemd/network/$NETWORK_NAME" "# /etc/systemd/network/${NETWORK_NAME}.d/test.conf") -networkctl edit --stdin --runtime "$NETDEV_NAME" <"/usr/lib/systemd/network/$LINK_NAME" <