diff options
author | Andrei Pavel <andrei@isc.org> | 2020-12-11 18:47:09 +0100 |
---|---|---|
committer | Andrei Pavel <andrei@isc.org> | 2020-12-14 11:08:39 +0100 |
commit | 382f58abfc67251c97a96533ad22cc685830dacb (patch) | |
tree | 3ff05fc67f1bc86b2b55d042f080e407c249008b /src | |
parent | [#1574] add 15 char limit for pgrep as comment (diff) | |
download | kea-382f58abfc67251c97a96533ad22cc685830dacb.tar.xz kea-382f58abfc67251c97a96533ad22cc685830dacb.zip |
[#1574] shellcheck fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/admin/tests/memfile_tests.sh.in | 10 | ||||
-rw-r--r-- | src/bin/keactrl/tests/keactrl_tests.sh.in | 5 | ||||
-rw-r--r-- | src/lib/testutils/dhcp_test_lib.sh.in | 2 |
3 files changed, 15 insertions, 2 deletions
diff --git a/src/bin/admin/tests/memfile_tests.sh.in b/src/bin/admin/tests/memfile_tests.sh.in index 712a3a23b2..2347d61f5b 100644 --- a/src/bin/admin/tests/memfile_tests.sh.in +++ b/src/bin/admin/tests/memfile_tests.sh.in @@ -9,6 +9,9 @@ # shellcheck disable=SC1091 # SC1091: Not following: ... was not specified as input (see shellcheck -x). +# shellcheck disable=SC2039 +# SC2039: In POSIX sh, 'local' is undefined. + # Exit with error if commands exit with non-zero and if undefined variables are # used. set -eu @@ -90,7 +93,7 @@ memfile_init_test() { fi export KEA_PIDFILE_DIR="@abs_top_builddir@/src/bin/admin/tests/pid_dir_${v}" mkdir -p "${KEA_PIDFILE_DIR}" - "$(kea_dhcp "${v}")" -c "${config_file}" &> /dev/null & + "$(kea_dhcp "${v}")" -c "${config_file}" > /dev/null 2>&1 & pid=${!} # This assumes that the CSV creation + writing to CSV is atomic. Not # sure if it is, but if this ever fails on the comparison further below, @@ -153,9 +156,14 @@ memfile_upgrade_test() { test_finish 0 } +# shellcheck disable=SC2034 +# SC2034: ... appears unused. Verify use (or export if used externally). +# reason: bin and bin_path are used in version_test +{ bin=$(basename "${kea_admin}") bin_path=$(dirname "${kea_admin}") version_test 'memfile.version' 'long_version_too_please' +} memfile_init_test memfile_upgrade_test diff --git a/src/bin/keactrl/tests/keactrl_tests.sh.in b/src/bin/keactrl/tests/keactrl_tests.sh.in index 1e1006c74d..aa0fac8ad5 100644 --- a/src/bin/keactrl/tests/keactrl_tests.sh.in +++ b/src/bin/keactrl/tests/keactrl_tests.sh.in @@ -1454,9 +1454,14 @@ version_command_test() { test_finish 0 } +# shellcheck disable=SC2034 +# SC2034: ... appears unused. Verify use (or export if used externally). +# reason: bin and bin_path are used in version_test +{ bin=$(basename "${keactrl}") bin_path=$(dirname "${keactrl}") version_test 'keactrl.version' 'long_version_too_please' +} version_command_test start_all_servers_no_verbose_test diff --git a/src/lib/testutils/dhcp_test_lib.sh.in b/src/lib/testutils/dhcp_test_lib.sh.in index 31c3c7a934..19ae0d5ca5 100644 --- a/src/lib/testutils/dhcp_test_lib.sh.in +++ b/src/lib/testutils/dhcp_test_lib.sh.in @@ -408,7 +408,7 @@ wait_for_file() { local file=${1} timeout='4 seconds' deadline=$(date +%s -d "${timeout}") - while ! test -f "${file}" >/dev/null; do + while ! test -f "${file}"; do if test "${deadline}" -lt "$(date +%s)"; then # Time is up. printf 'ERROR: file "%s" was not created in time.\n' "${file}" >&2 |