test/coredump: fix shellcheck errors

ShellCheck reports the following problems:

SC2086: Double quote to prevent globbing and word splitting.
SC2035: Use ./*glob* or -- *glob* so names with dashes won't become options.
SC1091: Not following: ../env.sh was not specified as input (see shellcheck -x).

Signed-off-by: Radostin Stoyanov <radostin@redhat.com>
This commit is contained in:
Radostin Stoyanov 2021-09-06 00:20:58 +01:00 committed by Andrei Vagin
parent 0b3cf5c9e5
commit 8aa7694558

View file

@ -1,4 +1,8 @@
source ../env.sh
#!/bin/bash
set -x
# shellcheck disable=SC1091
source ../env.sh || exit 1
function gen_imgs {
PID=$(../loop)
@ -9,7 +13,7 @@ function gen_imgs {
exit 1
fi
images_list=$(ls -1 *.img)
images_list=$(ls -1 ./*.img)
if [ -z "$images_list" ]; then
echo "Failed to generate images"
exit 1
@ -32,7 +36,7 @@ function run_test {
for x in $cores
do
echo "=== try readelf $x"
readelf -a $x || exit $?
readelf -a "$x" || exit $?
echo "=== done"
done