From: Andrei Pavel Date: Fri, 11 Dec 2020 16:49:43 +0000 (+0200) Subject: [#1574] fixes in src/bin/shell/tests X-Git-Tag: Kea-1.9.3~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54420c18fd3903ccc3e21fbb4ae102aa46b2f549;p=thirdparty%2Fkea.git [#1574] fixes in src/bin/shell/tests --- diff --git a/src/bin/shell/tests/basic_auth_tests.sh.in b/src/bin/shell/tests/basic_auth_tests.sh.in index 2588ac064c..138951e2c2 100644 --- a/src/bin/shell/tests/basic_auth_tests.sh.in +++ b/src/bin/shell/tests/basic_auth_tests.sh.in @@ -13,6 +13,12 @@ # used. set -eu +# Path to the temporary configuration file. +# shellcheck disable=SC2034 +# SC2034: ... appears unused. Verify use (or export if used externally). +# reason: used in dhcp_test_lib.sh.in +CFG_FILE="@abs_top_builddir@/src/bin/shell/tests/test_config.json" + # Path to the Control Agent log file. LOG_FILE="@abs_top_builddir@/src/bin/shell/tests/test.log" @@ -119,8 +125,13 @@ shell_command_test() { echo "Executing kea-shell ($tmp)" set +e + # shellcheck disable=SC2086 + # SC2086: Double quote to prevent globbing and word splitting. + # reason: ${auth} can be empty here, if we quote, it will be interpreted as + # an empty string which is not desired as it will result in unrecognized + # argument from kea-shell. echo | ${shell_bin_path}/${shell_bin} --host 127.0.0.1 \ - --port 8081 "${auth}" "${cmd}" > ${tmpfile_path}/shell-stdout.txt + --port 8081 ${auth} "${cmd}" > ${tmpfile_path}/shell-stdout.txt shell_exit_code=$? set -e diff --git a/src/bin/shell/tests/shell_process_tests.sh.in b/src/bin/shell/tests/shell_process_tests.sh.in index 5bc8e6cbd7..cc1955045e 100644 --- a/src/bin/shell/tests/shell_process_tests.sh.in +++ b/src/bin/shell/tests/shell_process_tests.sh.in @@ -13,10 +13,14 @@ # used. set -eu +# Path to the temporary configuration file. +# shellcheck disable=SC2034 +# SC2034: ... appears unused. Verify use (or export if used externally). +# reason: used in dhcp_test_lib.sh.in +CFG_FILE="@abs_top_builddir@/src/bin/shell/tests/test_config.json" + # Path to the Control Agent log file. LOG_FILE="@abs_top_builddir@/src/bin/shell/tests/test.log" -# Expected version -EXPECTED_VERSION="@PACKAGE_VERSION@" # Control Agent configuration to be stored in the configuration file. # todo: use actual configuration once we support it. diff --git a/src/lib/testutils/dhcp_test_lib.sh.in b/src/lib/testutils/dhcp_test_lib.sh.in index 6cdb484afd..673924291d 100644 --- a/src/lib/testutils/dhcp_test_lib.sh.in +++ b/src/lib/testutils/dhcp_test_lib.sh.in @@ -24,13 +24,11 @@ set -eu prefix="@prefix@" -# A list of Kea processes, mainly used by the cleanup functions. -KEA_PROCS="kea-dhcp4 kea-dhcp6 kea-dhcp-ddns kea-ctrl-agent" # Expected version EXPECTED_VERSION="@PACKAGE_VERSION@" -# Expected version -EXPECTED_VERSION="@PACKAGE_VERSION@" +# A list of Kea processes, mainly used by the cleanup functions. +KEA_PROCS="kea-dhcp4 kea-dhcp6 kea-dhcp-ddns kea-ctrl-agent" ### Logging functions ###