Skip to content

Commit

Permalink
Fix DocumentRoot in httpd.conf + regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindhagberg committed Nov 13, 2024
1 parent db450d8 commit a4ee8f2
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ jobs:
- client_timing.sh
- clones.sh
- powershell.sh
- homepage.sh
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions server/httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ ServerSignature On
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/localhost/htdocs"
<Directory "/var/www/localhost/htdocs">
DocumentRoot "/var/www/html"
<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
Expand Down
30 changes: 30 additions & 0 deletions tests/test_homepage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Dependencies/assumptions:
# - It is safe and OK to make changes to the Postgres database
# - The Nivlheim system service is running
# - The API is served at localhost:4040
# - The web server is running and serving content at localhost:443/80
# - Docker/Podman has a container image with the nivlheim client

echo "------------- Testing homepage ------------"
set -e
cd `dirname $0` # cd to the dir where the test script is
PSQL=../ci/docker/psql.sh

# tempdir
tempdir=$(mktemp -d -t tmp.XXXXXXXXXX)
function finish {
rm -rf "$tempdir"
}
trap finish EXIT

curl -ksS https://localhost:443/ > $tempdir/homepage.html
if ! diff ../server/website/index.html $tempdir/homepage.html; then
echo "============================================================================"
echo "ERROR: The html that is served is different from the contents of index.html."
echo "============================================================================"
exit 1
fi

echo "Test result: OK"

0 comments on commit a4ee8f2

Please sign in to comment.