Adress shellcheck complaints in crash autopkgtest

$ shellcheck debian/tests/crash

In debian/tests/crash line 5:
	echo "makedumpfile: ERROR: crash test: $@"
                                               ^-- SC2145 (error): Argument mixes string and array. Use * or separate argument.

In debian/tests/crash line 11:
	echo "makedumpfile: crash test: $@"
                                        ^-- SC2145 (error): Argument mixes string and array. Use * or separate argument.

In debian/tests/crash line 16:
	echo "makedumpfile: SKIP: crash test: $@"
                                              ^-- SC2145 (error): Argument mixes string and array. Use * or separate argument.

In debian/tests/crash line 54:
	crksize=`get_crash_kernel_size`
                ^---------------------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.

Did you mean:
	crksize=$(get_crash_kernel_size)

In debian/tests/crash line 55:
	if [ $crksize -eq 0 ]; then
             ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
	if [ "$crksize" -eq 0 ]; then

In debian/tests/crash line 79:
	for i in `find /var/crash/ -name dump.*`; do
                 ^-----------------------------^ SC2044 (warning): For loops over find output are fragile. Use find -exec or a while read loop.
                 ^-----------------------------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
                                         ^----^ SC2061 (warning): Quote the parameter to -name so the shell won't interpret it.

Did you mean:
	for i in $(find /var/crash/ -name dump.*); do

In debian/tests/crash line 80:
		if file $i | grep -i 'kdump compressed dump' > /dev/null; then
                        ^-- SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
		if file "$i" | grep -i 'kdump compressed dump' > /dev/null; then

Extend the shellcheck to files in debian/tests.

Signed-off-by: Benjamin Drung benjamin.drung@canonical.com

Merge request reports

Loading