mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Trying to re-add some display of the curl output
This commit is contained in:
parent
b158fa5f65
commit
d9a3b0ee39
1 changed files with 20 additions and 17 deletions
37
lib/tests.sh
37
lib/tests.sh
|
@ -217,22 +217,17 @@ _VALIDATE_THAT_APP_CAN_BE_ACCESSED () {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log_debug "Test url: $check_domain$curl_check_path"
|
cat << EOF > $TEST_CONTEXT/curl_result
|
||||||
log_debug "Real url: $(cat "./curl_print" | cut --delimiter=';' --fields=2)"
|
\nTest url: $check_domain$curl_check_path"
|
||||||
log_debug "HTTP code: $http_code"
|
Real url: $(cat "./curl_print" | cut --delimiter=';' --fields=2)"
|
||||||
log_debug "$test_url_details"
|
HTTP code: $http_code"
|
||||||
log_debug "Page title: $page_title"
|
Page title: $page_title"
|
||||||
log_debug "Page extract:\n$page_extract"
|
Page extract:\n$page_extract"
|
||||||
|
EOF
|
||||||
|
|
||||||
if [[ $curl_error -ne 0 ]]
|
[[ $curl_error -eq 0 ]] \
|
||||||
then
|
&& log_debug "$(cat $TEST_CONTEXT/curl_result)"
|
||||||
log_warning "Test url: $check_domain$curl_check_path"
|
|| log_warning "$(cat $TEST_CONTEXT/curl_result)"
|
||||||
log_warning "Real url: $(cat "./curl_print" | cut --delimiter=';' --fields=2)"
|
|
||||||
log_warning "HTTP code: $http_code"
|
|
||||||
log_warning "$test_url_details"
|
|
||||||
log_warning "Page title: $page_title"
|
|
||||||
log_warning "Page extract:\n$page_extract"
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Detect the issue alias_traversal, https://github.com/yandex/gixy/blob/master/docs/en/plugins/aliastraversal.md
|
# Detect the issue alias_traversal, https://github.com/yandex/gixy/blob/master/docs/en/plugins/aliastraversal.md
|
||||||
|
@ -295,6 +290,7 @@ TEST_INSTALL () {
|
||||||
# Install the application in a LXC container
|
# Install the application in a LXC container
|
||||||
_INSTALL_APP "path=$check_path" "is_public=$is_public" \
|
_INSTALL_APP "path=$check_path" "is_public=$is_public" \
|
||||||
&& _VALIDATE_THAT_APP_CAN_BE_ACCESSED $SUBDOMAIN $check_path $install_type
|
&& _VALIDATE_THAT_APP_CAN_BE_ACCESSED $SUBDOMAIN $check_path $install_type
|
||||||
|
&& log_info "$($TEST_CONTEXT/curl_result)"
|
||||||
|
|
||||||
local install=$?
|
local install=$?
|
||||||
|
|
||||||
|
@ -371,9 +367,15 @@ TEST_UPGRADE () {
|
||||||
LOAD_LXC_SNAPSHOT snap0
|
LOAD_LXC_SNAPSHOT snap0
|
||||||
|
|
||||||
# Install the application
|
# Install the application
|
||||||
_INSTALL_APP "path=$check_path"
|
_INSTALL_APP "path=$check_path"
|
||||||
|
|
||||||
local ret=$?
|
local ret=$?
|
||||||
|
|
||||||
|
# Test if the app can be accessed (though we don't want to report an
|
||||||
|
# error if it's not, in that context)
|
||||||
|
_VALIDATE_THAT_APP_CAN_BE_ACCESSED "$SUBDOMAIN" "$check_path" \
|
||||||
|
&& log_info "$($TEST_CONTEXT/curl_result)"
|
||||||
|
|
||||||
# Then replace the backup
|
# Then replace the backup
|
||||||
rm -rf "$package_path"
|
rm -rf "$package_path"
|
||||||
mv "${package_path}_back" "$package_path"
|
mv "${package_path}_back" "$package_path"
|
||||||
|
@ -386,7 +388,8 @@ TEST_UPGRADE () {
|
||||||
|
|
||||||
# Upgrade the application in a LXC container
|
# Upgrade the application in a LXC container
|
||||||
_RUN_YUNOHOST_CMD "app upgrade $app_id -f /app_folder" \
|
_RUN_YUNOHOST_CMD "app upgrade $app_id -f /app_folder" \
|
||||||
&& _VALIDATE_THAT_APP_CAN_BE_ACCESSED $SUBDOMAIN $check_path
|
&& _VALIDATE_THAT_APP_CAN_BE_ACCESSED $SUBDOMAIN $check_path \
|
||||||
|
&& log_info "$($TEST_CONTEXT/curl_result)"
|
||||||
|
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue