diff --git a/bitnami/apache/test.sh b/bitnami/apache/test.sh index e269b2ebeaa4..55043f0f832c 100644 --- a/bitnami/apache/test.sh +++ b/bitnami/apache/test.sh @@ -9,7 +9,7 @@ load tests/docker_helper # Cleans up all running/stopped containers and host mounted volumes cleanup_environment() { - container_remove default + container_remove_full default } # Teardown called at the end of each test @@ -84,3 +84,36 @@ EOF" run curl_client default -i http://$APP_NAME:81 [[ "$output" =~ "405 Method Not Allowed" ]] } + +@test "Configuration changes are preserved after restart" { + container_create_with_host_volumes default -d + + # modify httpd.conf + container_exec default sed -i 's|[#]*LogLevel .*|LogLevel debug|' $VOL_PREFIX/conf/httpd.conf + container_exec default sed -i 's|[#]*ServerSignature .*|ServerSignature On|' $VOL_PREFIX/conf/httpd.conf + container_exec default sed -i 's|[#]*EnableSendfile .*|EnableSendfile Off|' $VOL_PREFIX/conf/httpd.conf + + # add vhost + container_exec default sh -c "cat > $VOL_PREFIX/conf/vhosts/test.conf < + ServerName default + Redirect 405 / + +EOF" + + # stop and remove container + container_remove default + + # relaunch container with host volumes + container_create_with_host_volumes default -d + + run container_exec default cat $VOL_PREFIX/conf/httpd.conf + [[ "$output" =~ "LogLevel debug" ]] + [[ "$output" =~ "ServerSignature On" ]] + [[ "$output" =~ "EnableSendfile Off" ]] + + run container_exec default cat $VOL_PREFIX/conf/vhosts/test.conf + [[ "$output" =~ "ServerName default" ]] + [[ "$output" =~ "Redirect 405 /" ]] +}