mirror of
https://github.com/systemd/systemd
synced 2024-07-21 18:24:38 +00:00
test: use assertions in sysctl tests
This commit is contained in:
parent
3f75892dd2
commit
86fc149c69
|
@ -3,14 +3,17 @@
|
|||
set -eux
|
||||
set -o pipefail
|
||||
|
||||
# shellcheck source=test/units/assert.sh
|
||||
. "$(dirname "$0")"/assert.sh
|
||||
|
||||
export SYSTEMD_LOG_LEVEL=debug
|
||||
|
||||
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 ]]
|
||||
assert_rc 0 /usr/lib/systemd/systemd-sysctl /tmp/foo.conf
|
||||
assert_rc 1 /usr/lib/systemd/systemd-sysctl --strict /tmp/foo.conf
|
||||
|
||||
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 ]]
|
||||
assert_rc 0 /usr/lib/systemd/systemd-sysctl /tmp/foo.conf
|
||||
assert_rc 0 /usr/lib/systemd/systemd-sysctl --strict /tmp/foo.conf
|
||||
|
||||
touch /testok
|
||||
|
|
Loading…
Reference in a new issue