$@ does not break up quoted arguments which is what we want in all cases
in the bash test-suite. Use it instead of $*. While at it: prevent
globbing with double quotes but allow variable expansion.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Kent Gibson <warthog618@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240528-fix-bash-tests-v3-2-e9b5be2ba8bf@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
MIN_KERNEL_VERSION="5.17.4"
MIN_SHUNIT_VERSION="2.1.8"
-# Run the command in $* and fail the test if the command succeeds.
+# Run the command in $@ and fail the test if the command succeeds.
assert_fail() {
- $* || return 0
+ "$@" || return 0
fail " '$*': command did not fail as expected"
}
mkdir -p $BANKPATH
- for ARG in $*
+ for ARG in "$@"
do
local KEY=$(echo $ARG | cut -d"=" -f1)
local VAL=$(echo $ARG | cut -d"=" -f2)
}
dut_write() {
- echo $* >&${COPROC[1]}
+ echo "$@" >&${COPROC[1]}
}
dut_kill() {
}
request_release_line() {
- $SOURCE_DIR/gpioget -c $* >/dev/null
+ $SOURCE_DIR/gpioget -c "$@" >/dev/null
}
#