feat: add ability to change or disable the access/error log path

Closes #3911
This commit is contained in:
Jose Diaz-Gonzalez committed 2020-04-01 12:21:52 -04:00
1 parent 75a9b2a4d2
commit 62caa85423
7 files changed
+135 -29

No files matched your search

+64 -2
View File
@@ -26,8 +26,70 @@ teardown() {
@test "(nginx-vhosts) logging" {
deploy_app
assert_access_log ${TEST_APP}
assert_error_log ${TEST_APP}
run [ -a "/var/log/nginx/$TEST_APP-access.log" ]
echo "output: $output"
echo "status: $status"
assert_success
run [ -a "/var/log/nginx/$TEST_APP-error.log" ]
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku nginx:access-logs $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku nginx:error-logs $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
}
@test "(nginx-vhosts) log-path" {
deploy_app
run /bin/bash -c "dokku nginx:set $TEST_APP access-log-path off"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku nginx:show-config $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_output_contains "off;"
run /bin/bash -c "dokku nginx:set $TEST_APP access-log-path"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku nginx:show-config $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_output_contains "off;" 0
run /bin/bash -c "dokku nginx:set $TEST_APP error-log-path off"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku nginx:show-config $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_output_contains "off;"
run /bin/bash -c "dokku nginx:set $TEST_APP error-log-path"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku nginx:show-config $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_output_contains "off;" 0
}
@test "(nginx-vhosts) nginx:build-config (with SSL and unrelated domain)" {