From 896dea99ddd624b8c0d5d48358252d50248f4334 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 22 Dec 2020 11:50:16 +0100 Subject: [PATCH] fix actions & config_panel tests --- lib/tests.sh | 13 ++++++------- lib/tests_coordination.sh | 6 +++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/tests.sh b/lib/tests.sh index 4e62d8a..3f6927c 100644 --- a/lib/tests.sh +++ b/lib/tests.sh @@ -631,7 +631,6 @@ ACTIONS_CONFIG_PANEL () { log_error "No actions.toml found !" return 1 fi - elif [ "$test_type" == "config_panel" ] then start_test "Config-panel" @@ -657,7 +656,7 @@ ACTIONS_CONFIG_PANEL () { # List first, then execute local ret=0 local i=0 - for i in `seq 1 2` + for i in $(seq 1 2) do # Do a test if the installation succeed if [ $ret -ne 0 ] @@ -779,7 +778,7 @@ ACTIONS_CONFIG_PANEL () { add_arg="${line//\"/}" # Then add this argument and follow it by : check_process_arguments="${check_process_arguments}${add_arg}:" - done < $test_serie_dir/check_process.configpanel_infos #FIXME + done < <(jq -r '.extra.configpanel' $current_test_infos) elif [ "$test_type" == "actions" ] then local check_process_arguments="" @@ -789,7 +788,7 @@ ACTIONS_CONFIG_PANEL () { add_arg="${line//\"/}" # Then add this argument and follow it by : check_process_arguments="${check_process_arguments}${add_arg}:" - done < $test_serie_dir/check_process.actions_infos #FIXME + done < <(jq -r '.extra.actions' $current_test_infos) fi # Look for arguments into the check_process if echo "$check_process_arguments" | grep --quiet "$action_config_argument_name" @@ -816,7 +815,7 @@ ACTIONS_CONFIG_PANEL () { # Loop on the number of values into the check_process. # Or loop once for the default value - for j in `seq 1 $nb_actions_config_arguments_specifics` + for j in $(seq 1 $nb_actions_config_arguments_specifics) do local action_config_argument_built="" if [ $action_config_has_arguments -eq 1 ] @@ -826,12 +825,12 @@ ACTIONS_CONFIG_PANEL () { then # Build the argument from a value from the check_process local action_config_actual_argument="$(echo "$actions_config_arguments_specifics" | cut -d'|' -f $j)" - action_config_argument_built="--args $action_config_argument_name=\"$action_config_actual_argument\"" + action_config_argument_built="--args $action_config_argument_name=$action_config_actual_argument" elif [ -n "$action_config_argument_default" ] then # Build the argument from the default value local action_config_actual_argument="$action_config_argument_default" - action_config_argument_built="--args $action_config_argument_name=\"$action_config_actual_argument\"" + action_config_argument_built="--args $action_config_argument_name=$action_config_actual_argument" else log_warning "> No argument into the check_process to use or default argument for \"$action_config_name\"..." action_config_actual_argument="" diff --git a/lib/tests_coordination.sh b/lib/tests_coordination.sh index d430fbf..76c702d 100644 --- a/lib/tests_coordination.sh +++ b/lib/tests_coordination.sh @@ -116,7 +116,7 @@ parse_check_process() { elif [[ "$test_type" == "ACTIONS_CONFIG_PANEL" ]] && [[ "$test_arg" == "actions" ]] then extra="$(jq -n --arg actions "$action_infos" '{ $actions }')" - elif [[ "$test_type" == "ACTIONS_CONFIG_PANEL" ]] && [[ "$test_arg" == "actions" ]] + elif [[ "$test_type" == "ACTIONS_CONFIG_PANEL" ]] && [[ "$test_arg" == "config_panel" ]] then extra="$(jq -n --arg configpanel "$configpanel_infos" '{ $configpanel }')" fi @@ -171,8 +171,8 @@ parse_check_process() { # "Advanced" features is_test_enabled change_url && add_test "TEST_CHANGE_URL" - #is_test_enabled actions && add_test "ACTIONS_CONFIG_PANEL" "actions" - #is_test_enabled config_panel && add_test "ACTIONS_CONFIG_PANEL" "config_panel" + is_test_enabled actions && add_test "ACTIONS_CONFIG_PANEL" "actions" + is_test_enabled config_panel && add_test "ACTIONS_CONFIG_PANEL" "config_panel" # Port already used ... do we really need this ...