diff --git a/tests/functional/launch_tests_on_instance.sh b/tests/functional/launch_tests_on_instance.sh index 0bbc35467..d71c5eb54 100755 --- a/tests/functional/launch_tests_on_instance.sh +++ b/tests/functional/launch_tests_on_instance.sh @@ -165,7 +165,8 @@ fi mytmpdir=$(mktemp -d -t bastiontest.XXXXXX) tmp_a=$(mktemp -t bastiontest.XXXXXX) tmp_b=$(mktemp -t bastiontest.XXXXXX) - trap 'echo CLEANING UP ; rm -rf "$mytmpdir" ; rm -f "$tmp_a" "$tmp_b" ; exit 255' EXIT + source_stderr=$(mktemp -t bastiontest.XXXXXX) + trap 'echo CLEANING UP ; rm -rf "$mytmpdir" ; rm -f "$tmp_a" "$tmp_b" "$source_stderr"; exit 255' EXIT account0key1file="$mytmpdir/account0key1file" account1key1file="$mytmpdir/account1key1file" account1key2file="$mytmpdir/account1key2file" @@ -701,12 +702,24 @@ runtests() dump_vars_and_funcs > "$tmp_a" module_ret=0 - # as this is a loop, we do the shellcheck in a reversed way, see any included module for more info: - # shellcheck disable=SC1090 - if source "$module"; then - module_ret=0 + if [ "$COUNTONLY" = 0 ]; then + # as this is a loop, we do the shellcheck in a reversed way, see any included module for more info: + # shellcheck disable=SC1090 + source "$module" || module_ret=$? else - module_ret=$? + # take the opportunity to ensure there's nothing in stderr, or there might be + # errors in the module we're sourcing by capturing 2> + # shellcheck disable=SC1090 + source "$module" 2>"$source_stderr" || module_ret=$? + if [ -s "$source_stderr" ]; then + echo + echo "DEFINITION ERROR in module $module, aborting:" + echo "-----" + cat "$source_stderr" + echo "-----" + echo + exit 1 + fi fi dump_vars_and_funcs > "$tmp_b" success module_postrun test "$module_ret" = 0 diff --git a/tests/functional/tests.d/350-groups.sh b/tests/functional/tests.d/350-groups.sh index eba2b532a..92ce132d6 100644 --- a/tests/functional/tests.d/350-groups.sh +++ b/tests/functional/tests.d/350-groups.sh @@ -145,7 +145,7 @@ EOS json .error_code ERR_INCOMPATIBLE_PARAMETERS success a1_add_access_force_key_g1 $a1 --osh groupAddServer --host 127.1.2.3 --user 'ar@base' --port-any --force --force-key "$key1fp" --group $group1 - .value.user 'ar@base' + json .value.user 'ar@base' success a1_list_servers_check_force_key_g1 $a1 --osh groupListServers --group $group1 json '.value|.[]|select(.ip=="127.1.2.3")|.forceKey' "$key1fp" diff --git a/tests/functional/tests.d/380-config-options.sh b/tests/functional/tests.d/380-config-options.sh index 710743a49..31011a9d8 100644 --- a/tests/functional/tests.d/380-config-options.sh +++ b/tests/functional/tests.d/380-config-options.sh @@ -10,7 +10,7 @@ testsuite_config_options() configchg 's=^\\\\x22dnsSupportLevel\\\\x22.+=\\\\x22dnsSupportLevel\\\\x22:0,=' run a1_connect_nodns $a0 localhost - retvalmustbe 102 + retvalshouldbe 102 json .error_code KO_HOST_NOT_FOUND contain 'DNS resolving is disabled' }