fix actions & config_panel tests

This commit is contained in:
Kay0u 2020-12-22 11:50:16 +01:00
parent 26108c454d
commit 896dea99dd
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D
2 changed files with 9 additions and 10 deletions

View file

@ -631,7 +631,6 @@ ACTIONS_CONFIG_PANEL () {
log_error "No actions.toml found !" log_error "No actions.toml found !"
return 1 return 1
fi fi
elif [ "$test_type" == "config_panel" ] elif [ "$test_type" == "config_panel" ]
then then
start_test "Config-panel" start_test "Config-panel"
@ -657,7 +656,7 @@ ACTIONS_CONFIG_PANEL () {
# List first, then execute # List first, then execute
local ret=0 local ret=0
local i=0 local i=0
for i in `seq 1 2` for i in $(seq 1 2)
do do
# Do a test if the installation succeed # Do a test if the installation succeed
if [ $ret -ne 0 ] if [ $ret -ne 0 ]
@ -779,7 +778,7 @@ ACTIONS_CONFIG_PANEL () {
add_arg="${line//\"/}" add_arg="${line//\"/}"
# Then add this argument and follow it by : # Then add this argument and follow it by :
check_process_arguments="${check_process_arguments}${add_arg}:" 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" ] elif [ "$test_type" == "actions" ]
then then
local check_process_arguments="" local check_process_arguments=""
@ -789,7 +788,7 @@ ACTIONS_CONFIG_PANEL () {
add_arg="${line//\"/}" add_arg="${line//\"/}"
# Then add this argument and follow it by : # Then add this argument and follow it by :
check_process_arguments="${check_process_arguments}${add_arg}:" 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 fi
# Look for arguments into the check_process # Look for arguments into the check_process
if echo "$check_process_arguments" | grep --quiet "$action_config_argument_name" 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. # Loop on the number of values into the check_process.
# Or loop once for the default value # 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 do
local action_config_argument_built="" local action_config_argument_built=""
if [ $action_config_has_arguments -eq 1 ] if [ $action_config_has_arguments -eq 1 ]
@ -826,12 +825,12 @@ ACTIONS_CONFIG_PANEL () {
then then
# Build the argument from a value from the check_process # Build the argument from a value from the check_process
local action_config_actual_argument="$(echo "$actions_config_arguments_specifics" | cut -d'|' -f $j)" 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" ] elif [ -n "$action_config_argument_default" ]
then then
# Build the argument from the default value # Build the argument from the default value
local action_config_actual_argument="$action_config_argument_default" 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 else
log_warning "> No argument into the check_process to use or default argument for \"$action_config_name\"..." log_warning "> No argument into the check_process to use or default argument for \"$action_config_name\"..."
action_config_actual_argument="" action_config_actual_argument=""

View file

@ -116,7 +116,7 @@ parse_check_process() {
elif [[ "$test_type" == "ACTIONS_CONFIG_PANEL" ]] && [[ "$test_arg" == "actions" ]] elif [[ "$test_type" == "ACTIONS_CONFIG_PANEL" ]] && [[ "$test_arg" == "actions" ]]
then then
extra="$(jq -n --arg actions "$action_infos" '{ $actions }')" 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 then
extra="$(jq -n --arg configpanel "$configpanel_infos" '{ $configpanel }')" extra="$(jq -n --arg configpanel "$configpanel_infos" '{ $configpanel }')"
fi fi
@ -171,8 +171,8 @@ parse_check_process() {
# "Advanced" features # "Advanced" features
is_test_enabled change_url && add_test "TEST_CHANGE_URL" is_test_enabled change_url && add_test "TEST_CHANGE_URL"
#is_test_enabled actions && add_test "ACTIONS_CONFIG_PANEL" "actions" 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 config_panel && add_test "ACTIONS_CONFIG_PANEL" "config_panel"
# Port already used ... do we really need this ... # Port already used ... do we really need this ...