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

Commit 77c059d

Browse files
committed
#250: Adds test case for Apache DirectoryIndex default.
1 parent 5ccdd83 commit 77c059d

File tree

4 files changed

+62
-0
lines changed

4 files changed

+62
-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: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,48 @@ ${other_required_apache_modules}
670670
end
671671
end
672672

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

0 commit comments

Comments
 (0)