summaryrefslogtreecommitdiffstats
path: root/tests/config.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/config.sh')
-rwxr-xr-xtests/config.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/config.sh b/tests/config.sh
index 2d8323a56..a6bc6ad2d 100755
--- a/tests/config.sh
+++ b/tests/config.sh
@@ -451,9 +451,13 @@ declare -A ctrl_tests=(
["routes"]="test_routes"
)
+function ctrl_test_exists() {
+ [[ "${!ctrl_tests[*]}" =~ ${1} ]] && return 0 || return 1
+}
+
function ctrl() {
type=$1
- if [[ ! -v "ctrl_tests[${type}]" ]]; then
+ if ! ctrl_test_exists "${type}"; then
error "Error: hicn-light-contrl test does not exist."
exit 1
fi