]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
fix some shellcheck-identified issues in scripts
authora1346054 <36859588+a1346054@users.noreply.github.com>
Wed, 18 Aug 2021 18:21:06 +0000 (18:21 +0000)
committera1346054 <36859588+a1346054@users.noreply.github.com>
Wed, 18 Aug 2021 18:21:06 +0000 (18:21 +0000)
tests/run_all
tests/run_all.coverage
tests/run_some

index 2b5114077934d8a751b4ecd619e86316842769f5..09a3c3ccc6f8e5a6b06901e688974490bf3cd42c 100755 (executable)
@@ -51,10 +51,10 @@ echo "-: test failed"
 # Empty the complete log.
 > testsuite.log
 
-find ${build_path} -name "*.gcda" -delete
+find "${build_path}" -name "*.gcda" -delete
 run_test ./su/01/su_root.test
 run_test ./su/01/su_user.test
-find ${build_path} -name "*.gcda" -exec chmod a+rw {} \;
+find "${build_path}" -name "*.gcda" -exec chmod a+rw {} \;
 run_test ./su/02/env_FOO-options_--login
 run_test ./su/02/env_FOO-options_--login_bash
 run_test ./su/02/env_FOO-options_--preserve-environment
@@ -121,7 +121,7 @@ run_test ./su/11_su_sulog_failure/su.test
 run_test ./su/12_su_child_failure/su.test
 run_test ./su/13_su_child_success/su.test
 run_test ./chage/01/run
-find ${build_path} -name "*.gcda" -exec chmod a+rw {} \;
+find "${build_path}" -name "*.gcda" -exec chmod a+rw {} \;
 run_test ./chage/02/run
 run_test ./chage/03_chsh_usage/chage.test
 run_test ./chage/04_chsh_usage_invalid_option/chage.test
@@ -1221,7 +1221,7 @@ run_test ./passwd/22_passwd_usage/passwd.test
 run_test ./login/01_login_prompt/login.test
 run_test ./login/02_login_user/login.test
 run_test ./login/03_login_check_tty/login.test
-find ${build_path} -name "*.gcda" -exec chmod a+rw {} \;
+find "${build_path}" -name "*.gcda" -exec chmod a+rw {} \;
 run_test ./subids/01_useradd_no_subids/useradd.test
 run_test ./subids/02_useradd_with_subids/useradd.test
 run_test ./subids/03_useradd_no_subgid/useradd.test
@@ -1301,9 +1301,8 @@ echo
 echo "$succeeded test(s) passed"
 echo "$failed test(s) failed"
 echo "log written in 'testsuite.log'"
-if [ "$failed" != "0" ]
+if [ "$failed" != 0 ]
 then
        echo "the following tests failed:"
-       echo $failed_tests
+       echo "$failed_tests"
 fi
-
index 92d0c4a3c8027319097890f88636a49b4fd71016..0eed77dd2cc714d95702e3e86bfc9ffc4a8f5521 100755 (executable)
@@ -16,8 +16,8 @@ failed_tests=""
 
 run_test()
 {
-       find $build_path -name "*.gcda" -delete
-       find $build_path -name "*.gcno" | while read f
+       find "$build_path" -name "*.gcda" -delete
+       find "$build_path" -name "*.gcno" | while read f
        do
                g=${f%gcno}gcda
                touch $g
@@ -1320,9 +1320,8 @@ echo
 echo "$succeeded test(s) passed"
 echo "$failed test(s) failed"
 echo "log written in 'testsuite.log'"
-if [ "$failed" != "0" ]
+if [ "$failed" != 0 ]
 then
        echo "the following tests failed:"
-       echo $failed_tests
+       echo "$failed_tests"
 fi
-
index e6f6eb5ae1cbb41ee738799fd47620bd6bdf8604..2f8e584631614e31605b9d7d274eacbbdaa15429 100755 (executable)
@@ -51,10 +51,10 @@ echo "-: test failed"
 # Empty the complete log.
 > testsuite.log
 
-find ${build_path} -name "*.gcda" -delete
+find "${build_path}" -name "*.gcda" -delete
 run_test ./su/01/su_root.test
 run_test ./su/01/su_user.test
-find ${build_path} -name "*.gcda" -exec chmod a+rw {} \;
+find "${build_path}" -name "*.gcda" -exec chmod a+rw {} \;
 run_test ./su/02/env_FOO-options_--login
 run_test ./su/02/env_FOO-options_--login_bash
 run_test ./su/02/env_FOO-options_--preserve-environment
@@ -133,9 +133,8 @@ echo
 echo "$succeeded test(s) passed"
 echo "$failed test(s) failed"
 echo "log written in 'testsuite.log'"
-if [ "$failed" != "0" ]
+if [ "$failed" != 0 ]
 then
        echo "the following tests failed:"
-       echo $failed_tests
+       echo "$failed_tests"
 fi
-