From 910711b21c5fe4f26ad20a4d86e1acfb2a0afbdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 4 May 2022 08:24:06 +0200 Subject: [PATCH] tree-wide: drop manually-crafted message for missing variables Bash will generate a very nice message for us: /tmp/ff.sh: line 1: SOMEVAR: parameter null or not set Let's save some keystrokes by not replacing this with our own inferior messages. (cherry picked from commit d7ff52403902900b61f644f87b5222822fd4a69b) Related: #2087652 --- test/TEST-36-NUMAPOLICY/test.sh | 2 +- test/hwdb-test.sh | 2 +- test/test-rpm-macros.sh | 2 +- test/units/testsuite-15.sh | 4 ++-- test/units/testsuite-36.sh | 14 +++++++------- test/units/testsuite-46.sh | 2 +- tools/check-directives.sh | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/TEST-36-NUMAPOLICY/test.sh b/test/TEST-36-NUMAPOLICY/test.sh index 0eaaee9608..5f38bf1009 100755 --- a/test/TEST-36-NUMAPOLICY/test.sh +++ b/test/TEST-36-NUMAPOLICY/test.sh @@ -9,7 +9,7 @@ TEST_NO_NSPAWN=1 . "${TEST_BASE_DIR:?}/test-functions" if qemu_min_version "5.2.0"; then - QEMU_OPTIONS="-object memory-backend-ram,id=mem0,size=${QEMU_MEM:?QEMU_MEM is unset} -numa node,memdev=mem0,nodeid=0" + QEMU_OPTIONS="-object memory-backend-ram,id=mem0,size=${QEMU_MEM:?} -numa node,memdev=mem0,nodeid=0" else QEMU_OPTIONS="-numa node,nodeid=0" fi diff --git a/test/hwdb-test.sh b/test/hwdb-test.sh index 0551f26a2d..29183e6829 100755 --- a/test/hwdb-test.sh +++ b/test/hwdb-test.sh @@ -11,7 +11,7 @@ set -e export SYSTEMD_LOG_LEVEL=info ROOTDIR="$(dirname "$(dirname "$(readlink -f "$0")")")" -SYSTEMD_HWDB="${1:?missing argument}" +SYSTEMD_HWDB="${1:?}" if [ ! -x "$SYSTEMD_HWDB" ]; then echo "$SYSTEMD_HWDB is not executable" >&2 diff --git a/test/test-rpm-macros.sh b/test/test-rpm-macros.sh index 5843b72346..c7107dec3e 100755 --- a/test/test-rpm-macros.sh +++ b/test/test-rpm-macros.sh @@ -6,7 +6,7 @@ # rpmspec utility is required (so this test will work with RPM 4 but won't work with RPM 5). set -eu -BUILD_DIR="${1:?Missing argument: build directory}" +BUILD_DIR="${1:?}" RPM_MACROS_FILE="${BUILD_DIR:?}/src/rpm/macros.systemd" if ! command -v rpm >/dev/null || ! command -v rpmspec >/dev/null; then diff --git a/test/units/testsuite-15.sh b/test/units/testsuite-15.sh index 0446e71c38..f847adac74 100755 --- a/test/units/testsuite-15.sh +++ b/test/units/testsuite-15.sh @@ -4,7 +4,7 @@ set -eux set -o pipefail _clear_service () { - local SERVICE_NAME="${1:?_clear_service: missing argument}" + local SERVICE_NAME="${1:?}" systemctl stop "$SERVICE_NAME.service" 2>/dev/null || : rm -f /{etc,run,usr/lib}/systemd/system/"$SERVICE_NAME".service rm -fr /{etc,run,usr/lib}/systemd/system/"$SERVICE_NAME".service.d @@ -25,7 +25,7 @@ clear_services () { } create_service () { - local SERVICE_NAME="${1:?create_service: missing argument}" + local SERVICE_NAME="${1:?}" clear_services "$SERVICE_NAME" cat >/etc/systemd/system/"$SERVICE_NAME".service <"$confDir/numa.conf" <"$testUnitNUMAConf" </dev/null || exit 77