@@ -78,6 +78,11 @@ teardown() {
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output "https://github.com/heroku/heroku-buildpack-ruby.git"
|
||||
run /bin/bash -c "dokku domains:report great-test-name --domains-app-vhosts"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output "great-test-name.$DOKKU_DOMAIN"
|
||||
run /bin/bash -c "dokku git:report great-test-name --git-deploy-branch"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
@@ -158,23 +163,24 @@ teardown() {
|
||||
run [ -d /home/dokku/great-test-name/tls ]
|
||||
assert_failure
|
||||
run [ -f /home/dokku/great-test-name/VHOST ]
|
||||
assert_failure
|
||||
run /bin/bash -c "curl --silent --write-out '%{http_code}\n' $(dokku url $TEST_APP) | grep 200"
|
||||
assert_success
|
||||
run /bin/bash -c "dokku url great-test-name"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
run /bin/bash -c "curl --silent --write-out '%{http_code}\n' $(dokku url great-test-name) | grep 404"
|
||||
assert_output "http://great-test-name.$DOKKU_DOMAIN"
|
||||
run /bin/bash -c "dokku url $TEST_APP"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_failure
|
||||
assert_success
|
||||
assert_output "http://$TEST_APP.$DOKKU_DOMAIN"
|
||||
assert_http_localhost_response "http" "$TEST_APP.$DOKKU_DOMAIN" "80" "/hello"
|
||||
assert_http_localhost_response "http" "great-test-name.dokku.me" "80" "/hello" "" "404"
|
||||
run /bin/bash -c "dokku --force apps:destroy great-test-name"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
run /bin/bash -c "curl --silent --write-out '%{http_code}\n' $(dokku url $TEST_APP) | grep 200"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_http_localhost_response "http" "$TEST_APP.$DOKKU_DOMAIN" "80" "/hello"
|
||||
}
|
||||
|
||||
@test "(apps) apps:clone --ignore-existing" {
|
||||
|
||||
@@ -41,10 +41,10 @@ teardown() {
|
||||
check_urls "http://${TEST_APP}.${DOKKU_DOMAIN}:3003"
|
||||
check_urls "http://www.test.app.${DOKKU_DOMAIN}:3000"
|
||||
check_urls "http://www.test.app.${DOKKU_DOMAIN}:3003"
|
||||
assert_http_localhost_success "http" "${TEST_APP}.${DOKKU_DOMAIN}" "3000"
|
||||
assert_http_localhost_success "http" "${TEST_APP}.${DOKKU_DOMAIN}" "3003"
|
||||
assert_http_localhost_success "http" "www.test.app.${DOKKU_DOMAIN}" "3000"
|
||||
assert_http_localhost_success "http" "www.test.app.${DOKKU_DOMAIN}" "3003"
|
||||
assert_http_localhost_response "http" "${TEST_APP}.${DOKKU_DOMAIN}" "3000"
|
||||
assert_http_localhost_response "http" "${TEST_APP}.${DOKKU_DOMAIN}" "3003"
|
||||
assert_http_localhost_response "http" "www.test.app.${DOKKU_DOMAIN}" "3000"
|
||||
assert_http_localhost_response "http" "www.test.app.${DOKKU_DOMAIN}" "3003"
|
||||
}
|
||||
|
||||
@test "(nginx-vhosts) proxy:build-config (multiple networks)" {
|
||||
|
||||
@@ -54,7 +54,7 @@ teardown() {
|
||||
assert_success
|
||||
|
||||
assert_nonssl_domain "www.test.app.${DOKKU_DOMAIN}"
|
||||
assert_http_localhost_success "http" "customtemplate.${DOKKU_DOMAIN}"
|
||||
assert_http_localhost_response "http" "customtemplate.${DOKKU_DOMAIN}"
|
||||
|
||||
run /bin/bash -c "dokku nginx:show-config $TEST_APP"
|
||||
echo "output: $output"
|
||||
|
||||
@@ -43,7 +43,7 @@ teardown() {
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
assert_http_localhost_success "http" "$TEST_APP.dokku.me" "80" "" "python/http.server"
|
||||
assert_http_localhost_response "http" "$TEST_APP.dokku.me" "80" "" "python/http.server"
|
||||
}
|
||||
|
||||
@test "(openresty) multiple domains" {
|
||||
@@ -67,8 +67,8 @@ teardown() {
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
assert_http_localhost_success "http" "$TEST_APP.dokku.me" "80" "" "python/http.server"
|
||||
assert_http_localhost_success "http" "$TEST_APP-2.dokku.me" "80" "" "python/http.server"
|
||||
assert_http_localhost_response "http" "$TEST_APP.dokku.me" "80" "" "python/http.server"
|
||||
assert_http_localhost_response "http" "$TEST_APP-2.dokku.me" "80" "" "python/http.server"
|
||||
}
|
||||
|
||||
@test "(openresty) ssl" {
|
||||
@@ -86,7 +86,7 @@ teardown() {
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_http_localhost_success "http" "$TEST_APP.dokku.me" "80" "" "python/http.server"
|
||||
assert_http_localhost_response "http" "$TEST_APP.dokku.me" "80" "" "python/http.server"
|
||||
|
||||
run /bin/bash -c "dokku ports:report $TEST_APP --ports-map-detected"
|
||||
echo "output: $output"
|
||||
|
||||
@@ -222,13 +222,13 @@ assert_http_success() {
|
||||
assert_output "200"
|
||||
}
|
||||
|
||||
assert_http_localhost_success() {
|
||||
local scheme="$1" domain="$2" port="${3:-80}" path="${4:-}" content="${5:-}"
|
||||
assert_http_localhost_response() {
|
||||
local scheme="$1" domain="$2" port="${3:-80}" path="${4:-}" content="${5:-}" status_code="${6:-200}"
|
||||
run curl --connect-to "$domain:$port:localhost:$port" -kSso /dev/null -w "%{http_code}" "$scheme://$domain:$port$path"
|
||||
echo "curl: curl --connect-to $domain:$port:localhost:$port -kSso /dev/null -w %{http_code} $scheme://$domain:$port$path"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output "200"
|
||||
assert_output "$status_code"
|
||||
|
||||
if [[ -n "$content" ]]; then
|
||||
run curl --connect-to "$domain:$port:localhost:$port" -kSs "$scheme://$domain:$port$path"
|
||||
|
||||
Reference in New Issue
Block a user