]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: do not use sysctl.d to store test conf
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 16 Aug 2022 20:20:27 +0000 (05:20 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 17 Aug 2022 05:30:20 +0000 (14:30 +0900)
Otherwise, late invocations of systemd-sysctl, especially through udev
rules may fail.

test/units/testsuite-76.sh

index 6ebdbc6a54901097eb2d30bad3a234c211905f5f..3095b8fc342da4b972bfe4b068310a53c7dc0c0e 100755 (executable)
@@ -5,12 +5,12 @@ set -o pipefail
 
 export SYSTEMD_LOG_LEVEL=debug
 
-echo "foo.bar=42" > /etc/sysctl.d/foo.conf
-[[ $(/usr/lib/systemd/systemd-sysctl /etc/sysctl.d/foo.conf)$? -eq 0 ]]
-[[ $(/usr/lib/systemd/systemd-sysctl --strict /etc/sysctl.d/foo.conf)$? -ne 0 ]]
+echo "foo.bar=42" > /tmp/foo.conf
+[[ $(/usr/lib/systemd/systemd-sysctl /tmp/foo.conf)$? -eq 0 ]]
+[[ $(/usr/lib/systemd/systemd-sysctl --strict /tmp/foo.conf)$? -ne 0 ]]
 
-echo "-foo.foo=42" > /etc/sysctl.d/foo.conf
-[[ $(/usr/lib/systemd/systemd-sysctl /etc/sysctl.d/foo.conf)$? -eq 0 ]]
-[[ $(/usr/lib/systemd/systemd-sysctl --strict /etc/sysctl.d/foo.conf)$? -eq 0 ]]
+echo "-foo.foo=42" > /tmp/foo.conf
+[[ $(/usr/lib/systemd/systemd-sysctl /tmp/foo.conf)$? -eq 0 ]]
+[[ $(/usr/lib/systemd/systemd-sysctl --strict /tmp/foo.conf)$? -eq 0 ]]
 
 touch /testok