mirror of
https://github.com/systemd/systemd
synced 2024-10-15 04:24:19 +00:00
test: use assertions in sysctl tests
This commit is contained in:
parent
3f75892dd2
commit
86fc149c69
|
@ -3,14 +3,17 @@
|
||||||
set -eux
|
set -eux
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
# shellcheck source=test/units/assert.sh
|
||||||
|
. "$(dirname "$0")"/assert.sh
|
||||||
|
|
||||||
export SYSTEMD_LOG_LEVEL=debug
|
export SYSTEMD_LOG_LEVEL=debug
|
||||||
|
|
||||||
echo "foo.bar=42" > /tmp/foo.conf
|
echo "foo.bar=42" > /tmp/foo.conf
|
||||||
[[ $(/usr/lib/systemd/systemd-sysctl /tmp/foo.conf)$? -eq 0 ]]
|
assert_rc 0 /usr/lib/systemd/systemd-sysctl /tmp/foo.conf
|
||||||
[[ $(/usr/lib/systemd/systemd-sysctl --strict /tmp/foo.conf)$? -ne 0 ]]
|
assert_rc 1 /usr/lib/systemd/systemd-sysctl --strict /tmp/foo.conf
|
||||||
|
|
||||||
echo "-foo.foo=42" > /tmp/foo.conf
|
echo "-foo.foo=42" > /tmp/foo.conf
|
||||||
[[ $(/usr/lib/systemd/systemd-sysctl /tmp/foo.conf)$? -eq 0 ]]
|
assert_rc 0 /usr/lib/systemd/systemd-sysctl /tmp/foo.conf
|
||||||
[[ $(/usr/lib/systemd/systemd-sysctl --strict /tmp/foo.conf)$? -eq 0 ]]
|
assert_rc 0 /usr/lib/systemd/systemd-sysctl --strict /tmp/foo.conf
|
||||||
|
|
||||||
touch /testok
|
touch /testok
|
||||||
|
|
Loading…
Reference in a new issue