mirror of
https://github.com/bitnami/containers.git
synced 2026-03-09 15:40:15 +08:00
Merge branch 'bats-eol'
This commit is contained in:
3
bitnami/apache/.gitmodules
vendored
3
bitnami/apache/.gitmodules
vendored
@@ -1,3 +0,0 @@
|
||||
[submodule "tests"]
|
||||
path = tests
|
||||
url = https://github.com/bitnami/bitnami-docker-tests.git
|
||||
@@ -1,75 +0,0 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
# source the helper script
|
||||
APP_NAME=apache
|
||||
VOLUMES=/bitnami/$APP_NAME
|
||||
SLEEP_TIME=20
|
||||
load tests/docker_helper
|
||||
|
||||
# Cleans up all running/stopped containers and host mounted volumes
|
||||
cleanup_environment() {
|
||||
container_remove default
|
||||
}
|
||||
|
||||
# Teardown called at the end of each test
|
||||
teardown() {
|
||||
cleanup_environment
|
||||
}
|
||||
|
||||
# cleanup the environment before starting the tests
|
||||
cleanup_environment
|
||||
|
||||
@test "We can connect to the port 80 and 443" {
|
||||
container_create default -d
|
||||
|
||||
# http connection
|
||||
run curl_client default -i http://$APP_NAME:80
|
||||
[[ "$output" =~ "200 OK" ]]
|
||||
|
||||
# https connection
|
||||
run curl_client default -i -k https://$APP_NAME:443
|
||||
[[ "$output" =~ "200 OK" ]]
|
||||
}
|
||||
|
||||
@test "Returns default page" {
|
||||
container_create default -d
|
||||
|
||||
# http connection
|
||||
run curl_client default -i http://$APP_NAME:80
|
||||
[[ "$output" =~ "It works!" ]]
|
||||
|
||||
# https connections
|
||||
run curl_client default -i -k https://$APP_NAME:443
|
||||
[[ "$output" =~ "It works!" ]]
|
||||
}
|
||||
|
||||
@test "Logs to stdout" {
|
||||
container_create default -d
|
||||
|
||||
# make sample request
|
||||
curl_client default -i http://$APP_NAME:80
|
||||
|
||||
# check if our request is logged in the container logs
|
||||
run container_logs default
|
||||
[[ "$output" =~ "GET / HTTP/1.1" ]]
|
||||
}
|
||||
|
||||
@test "Vhosts directory is imported" {
|
||||
# create container and exposing TCP port 81
|
||||
container_create default -d --expose 81
|
||||
|
||||
# create a vhost config for accepting connections on TCP port 81
|
||||
container_exec default sh -c "cat > $VOL_PREFIX/conf/vhosts/test.conf <<EOF
|
||||
Listen 81
|
||||
<VirtualHost *:81>
|
||||
ServerName default
|
||||
Redirect 405 /
|
||||
</VirtualHost>"
|
||||
|
||||
# restart the container for the vhost config to take effect
|
||||
container_restart default
|
||||
|
||||
# check http connections on port 81
|
||||
run curl_client default -i http://$APP_NAME:81
|
||||
[[ "$output" =~ "405 Method Not Allowed" ]]
|
||||
}
|
||||
Submodule bitnami/apache/tests deleted from 6e9148c2ea
Reference in New Issue
Block a user