Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit dea257c

Browse files
authored
Merge pull request #262 from jdeathe/issue/250
CLOSES #250: Adds test case for Apache DirectoryIndex default.
2 parents 5ccdd83 + 33f5eb4 commit dea257c

File tree

4 files changed

+63
-0
lines changed

4 files changed

+63
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Summary of release changes.
2020
- Adds improved test workflow; added `test-setup` target to Makefile.
2121
- Adds Makefile target `logsdef` to handle deferred logs output within a target chain.
2222
- Adds `/docs` directory for supplementary documentation and simplify README.
23+
- Adds test case for Apache `DirectoryIndex` default.
2324
- Fixes validation failure of 0 second --timeout value in `test/health_status`.
2425
- Removes PHP-FPM status handler configuration from the Apache server-status drop-in.
2526

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>{{TITLE}}</title>
5+
</head>
6+
<body>
7+
{{BODY}}
8+
</body>
9+
</html>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>{{TITLE}}</title>
5+
<meta name="php_version" content="<?php echo PHP_VERSION ?>">
6+
</head>
7+
<body>
8+
{{BODY}}
9+
</body>
10+
</html>

test/shpec/operation_shpec.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ function test_basic_operations ()
186186
- status_module
187187
- unixd_module
188188
- version_module"
189+
local -r content_index_html="$(< test/fixture/apache/var/www/public_html/index.html)"
189190
local -r required_apache_modules="
190191
authz_core_module
191192
authz_user_module
@@ -670,6 +671,48 @@ ${other_required_apache_modules}
670671
end
671672
end
672673

674+
describe "Apache DirectoryIndex"
675+
it "Defaults to index.html"
676+
__terminate_container \
677+
apache-php.1 \
678+
&> /dev/null
679+
680+
docker run \
681+
--detach \
682+
--no-healthcheck \
683+
--name apache-php.1 \
684+
--publish ${DOCKER_PORT_MAP_TCP_80}:80 \
685+
--volume ${PWD}/test/fixture/apache/var/www/public_html:/opt/app/public_html:ro \
686+
jdeathe/centos-ssh-apache-php-fcgi:latest \
687+
&> /dev/null
688+
689+
if ! __is_container_ready \
690+
apache-php.1 \
691+
${STARTUP_TIME} \
692+
"/usr/sbin/httpd(\.worker|\.event)? " \
693+
"[[ 000 != \$(curl -sI -o /dev/null -w %{http_code} localhost/) ]]"
694+
then
695+
exit 1
696+
fi
697+
698+
container_hostname="$(
699+
docker exec \
700+
apache-php.1 \
701+
hostname
702+
)"
703+
704+
curl_get_request="$(
705+
curl -s \
706+
--header "Host: ${container_hostname}" \
707+
http://127.0.0.1:${container_port_80}/
708+
)"
709+
710+
assert equal \
711+
"${curl_get_request}" \
712+
"${content_index_html}"
713+
end
714+
end
715+
673716
__terminate_container \
674717
apache-php.1 \
675718
&> /dev/null

0 commit comments

Comments
 (0)