diff --git a/lib/lxc.sh b/lib/lxc.sh index 26915c6..5932959 100644 --- a/lib/lxc.sh +++ b/lib/lxc.sh @@ -91,7 +91,7 @@ LXC_EXEC () { start_timer # Execute the command given in argument in the container and log its results. - lxc exec $LXC_NAME --env PACKAGE_CHECK_EXEC=1 -t -- $cmd | tee -a "$complete_log" $current_test_log + lxc exec $LXC_NAME --env PACKAGE_CHECK_EXEC=1 -t -- /bin/bash -c "$cmd" | tee -a "$complete_log" $current_test_log # Store the return code of the command local returncode=${PIPESTATUS[0]} diff --git a/lib/tests.sh b/lib/tests.sh index e7494e0..9c58d19 100644 --- a/lib/tests.sh +++ b/lib/tests.sh @@ -80,8 +80,8 @@ _INSTALL_APP () { done # Install the application in a LXC container - log_info "Running: yunohost app install --force /app_folder -a $install_args" - _RUN_YUNOHOST_CMD "app install --force /app_folder -a $install_args" + log_info "Running: yunohost app install --force /app_folder -a \"$install_args\"" + _RUN_YUNOHOST_CMD "app install --force /app_folder -a \"$install_args\"" local ret=$? [ $ret -eq 0 ] && log_debug "Installation successful." || log_error "Installation failed." @@ -886,12 +886,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 ebe0905..5582b1d 100644 --- a/lib/tests_coordination.sh +++ b/lib/tests_coordination.sh @@ -108,10 +108,14 @@ parse_check_process() { # Upgrades with a specific commit if [[ "$test_type" == "TEST_UPGRADE" ]] && [[ -n "$test_arg" ]] then - local specific_upgrade_install_args="$(grep "^manifest_arg=" "$TEST_CONTEXT/upgrades/$test_arg" | cut -d'=' -f2-)" - [[ -n "$specific_upgrade_install_args" ]] && _install_args="$specific_upgrade_install_args" + if [ -f "$TEST_CONTEXT/upgrades/$test_arg" ]; then + local specific_upgrade_install_args="$(grep "^manifest_arg=" "$TEST_CONTEXT/upgrades/$test_arg" | cut -d'=' -f2-)" + [[ -n "$specific_upgrade_install_args" ]] && _install_args="$specific_upgrade_install_args" - local upgrade_name="$(grep "^name=" "$TEST_CONTEXT/upgrades/$test_arg" | cut -d'=' -f2)" + local upgrade_name="$(grep "^name=" "$TEST_CONTEXT/upgrades/$test_arg" | cut -d'=' -f2)" + else + local upgrade_name="$test_arg" + fi extra="$(jq -n --arg upgrade_name "$upgrade_name" '{ $upgrade_name }')" elif [[ "$test_type" == "ACTIONS_CONFIG_PANEL" ]] && [[ "$test_arg" == "actions" ]] then