]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1574] fixes in src/bin/shell/tests
authorAndrei Pavel <andrei@isc.org>
Fri, 11 Dec 2020 16:49:43 +0000 (18:49 +0200)
committerAndrei Pavel <andrei@isc.org>
Mon, 14 Dec 2020 10:08:39 +0000 (12:08 +0200)
src/bin/shell/tests/basic_auth_tests.sh.in
src/bin/shell/tests/shell_process_tests.sh.in
src/lib/testutils/dhcp_test_lib.sh.in

index 2588ac064c34d3c1c3776b2bd00edf540cb8bb6c..138951e2c295acba4ca17cbf0d63b21258bab5e3 100644 (file)
 # 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
 
index 5bc8e6cbd71efa296a947af05387e53533ea1550..cc1955045ed09945be5a41c50f5164243a985d4f 100644 (file)
 # 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.
index 6cdb484afd2c0282f113aee119b4e575360476a9..673924291da5d1b0fa2ac143b93fe2b1a6b8c45e 100644 (file)
@@ -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 ###