From 529fb591de9376a365b454f4373ff78d91bec5cf Mon Sep 17 00:00:00 2001 From: Kay0u Date: Mon, 22 Mar 2021 14:27:39 +0100 Subject: [PATCH] fix double quotes around lxc exec --- lib/lxc.sh | 2 +- lib/tests.sh | 4 ++-- lib/tests_coordination.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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 a0a9c23..9d087d6 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." diff --git a/lib/tests_coordination.sh b/lib/tests_coordination.sh index d643bbd..d8a6fe6 100644 --- a/lib/tests_coordination.sh +++ b/lib/tests_coordination.sh @@ -78,7 +78,7 @@ parse_check_process() { # Looking like domain=foo.com&path=/bar&password=stuff # "Standard" arguments like domain/path will later be overwritten # during tests - local install_args=$( extract_check_process_section "^; Manifest" "^; " $test_serie_rawconf | awk '{print $1}' | tr -d '"' | tr '\n' '&') + local install_args=$( extract_check_process_section "^; Manifest" "^; " $test_serie_rawconf | tr '\n' '&') local preinstall_template=$(extract_check_process_section "^; pre-install" "^; " $test_serie_rawconf) local action_infos=$( extract_check_process_section "^; Actions" "^; " $test_serie_rawconf) local configpanel_infos=$( extract_check_process_section "^; Config_panel" "^; " $test_serie_rawconf)