]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/units/testsuite-76.sh
test: drop whitespace after shell redirection operators
[thirdparty/systemd.git] / test / units / testsuite-76.sh
1 #!/usr/bin/env bash
2 # SPDX-License-Identifier: LGPL-2.1-or-later
3 set -eux
4 set -o pipefail
5
6 # shellcheck source=test/units/assert.sh
7 . "$(dirname "$0")"/assert.sh
8
9 export SYSTEMD_LOG_LEVEL=debug
10
11 echo "foo.bar=42" >/tmp/foo.conf
12 assert_rc 0 /usr/lib/systemd/systemd-sysctl /tmp/foo.conf
13 assert_rc 1 /usr/lib/systemd/systemd-sysctl --strict /tmp/foo.conf
14
15 echo "-foo.foo=42" >/tmp/foo.conf
16 assert_rc 0 /usr/lib/systemd/systemd-sysctl /tmp/foo.conf
17 assert_rc 0 /usr/lib/systemd/systemd-sysctl --strict /tmp/foo.conf
18
19 if ! systemd-detect-virt --quiet --container; then
20 ip link add hoge type dummy
21 udevadm wait /sys/class/net/hoge
22
23 cat >/tmp/foo.conf <<EOF
24 net.ipv4.conf.*.drop_gratuitous_arp=1
25 net.ipv4.*.*.bootp_relay=1
26 net.ipv4.aaa.*.disable_policy=1
27 EOF
28
29 echo 0 >/proc/sys/net/ipv4/conf/hoge/drop_gratuitous_arp
30 echo 0 >/proc/sys/net/ipv4/conf/hoge/bootp_relay
31 echo 0 >/proc/sys/net/ipv4/conf/hoge/disable_policy
32
33 assert_rc 0 /usr/lib/systemd/systemd-sysctl --prefix=/net/ipv4/conf/hoge /tmp/foo.conf
34 assert_eq "$(cat /proc/sys/net/ipv4/conf/hoge/drop_gratuitous_arp)" "1"
35 assert_eq "$(cat /proc/sys/net/ipv4/conf/hoge/bootp_relay)" "1"
36 assert_eq "$(cat /proc/sys/net/ipv4/conf/hoge/disable_policy)" "0"
37 fi
38
39 touch /testok