From 86fc149c692068c61d40558a2cb4ca8266c950ac Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 17 Aug 2022 05:33:18 +0900 Subject: [PATCH] test: use assertions in sysctl tests --- test/units/testsuite-76.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/units/testsuite-76.sh b/test/units/testsuite-76.sh index 3095b8fc342..2149d725c08 100755 --- a/test/units/testsuite-76.sh +++ b/test/units/testsuite-76.sh @@ -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 -- 2.47.3