tests: add a test for the error message

This commit is contained in:
Jose Diaz-Gonzalez
2022-11-23 17:46:33 -05:00
parent f3b04032a8
commit 47f5af44c5
2 changed files with 19 additions and 1 deletions

View File

@@ -25,7 +25,7 @@ trigger-domains-core-post-deploy() {
fi
if [[ "$domain" =~ $RE_IPV6 ]]; then
dokku_log_warn "Detected IPv4 domain name with nginx proxy enabled."
dokku_log_warn "Detected IPv6 domain name with nginx proxy enabled."
dokku_log_warn "Ensure the default nginx site is removed before continuing."
break
fi

View File

@@ -355,3 +355,21 @@ teardown() {
echo "status: $status"
assert_success
}
@test "(domains) verify warning on ipv4/ipv6 domain name" {
touch /etc/nginx/sites-enabled/default
rm "$DOKKU_ROOT/VHOST"
echo "127.0.0.1" >"$DOKKU_ROOT/VHOST"
run deploy_app
echo "output: $output"
echo "status: $status"
assert_success
assert_output_contains "Detected IPv4 domain name with nginx proxy enabled."
rm -f /etc/nginx/sites-enabled/default
run /bin/bash -c "dokku ps:rebuild $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
assert_output_contains "Detected IPv4 domain name with nginx proxy enabled." 0
}