Skip to content

Commit

Permalink
tree-wide: drop manually-crafted message for missing variables
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
keszybz authored and yuwata committed May 4, 2022
1 parent 080b8c2 commit d7ff524
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion test/TEST-36-NUMAPOLICY/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/hwdb-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/test-rpm-macros.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/units/testsuite-15.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <<EOF
Expand Down
14 changes: 7 additions & 7 deletions test/units/testsuite-36.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ checkNUMA() {
writePID1NUMAPolicy() {
cat >"$confDir/numa.conf" <<EOF
[Manager]
NUMAPolicy=${1:?missing argument: NUMAPolicy}
NUMAPolicy=${1:?}
NUMAMask=${2:-""}
EOF
}
Expand All @@ -85,7 +85,7 @@ writeTestUnit() {
writeTestUnitNUMAPolicy() {
cat >"$testUnitNUMAConf" <<EOF
[Service]
NUMAPolicy=${1:?missing argument: NUMAPolicy}
NUMAPolicy=${1:?}
NUMAMask=${2:-""}
EOF
systemctl daemon-reload
Expand All @@ -106,25 +106,25 @@ pid1ReloadWithJournal() {

pid1StartUnitWithStrace() {
startStrace '-f'
systemctl start "${1:?missing unit name}"
systemctl start "${1:?}"
sleep $sleepAfterStart
stopStrace
}

pid1StartUnitWithJournal() {
startJournalctl
systemctl start "${1:?missing unit name}"
systemctl start "${1:?}"
sleep $sleepAfterStart
stopJournalctl
}

pid1StopUnit() {
systemctl stop "${1:?missing unit name}"
systemctl stop "${1:?}"
}

systemctlCheckNUMAProperties() {
local UNIT_NAME="${1:?missing unit name}"
local NUMA_POLICY="${2:?missing NUMAPolicy}"
local UNIT_NAME="${1:?}"
local NUMA_POLICY="${2:?}"
local NUMA_MASK="${3:-""}"
local LOGFILE

Expand Down
2 changes: 1 addition & 1 deletion test/units/testsuite-46.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inspect() {
# avoid unexpected fails. To see the full outputs of both homectl &
# userdbctl (for debugging purposes) drop the fields just before the
# comparison.
local USERNAME="${1:?missing argument}"
local USERNAME="${1:?}"
homectl inspect "$USERNAME" | tee /tmp/a
userdbctl user "$USERNAME" | tee /tmp/b

Expand Down
4 changes: 2 additions & 2 deletions tools/check-directives.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -eu
set -o pipefail

SOURCE_ROOT="${1:?Missing argument: project source root}"
BUILD_ROOT="${2:?Missing argument: project build root}"
SOURCE_ROOT="${1:?}"
BUILD_ROOT="${2:?}"

command -v gawk &>/dev/null || exit 77

Expand Down

0 comments on commit d7ff524

Please sign in to comment.