diff --git a/docker/Dockerfile b/docker/Dockerfile index 462924f..51c133d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -62,6 +62,7 @@ RUN curl -# -L -o phpldapadmin.tar.gz ${DIST_URL} && \ rm phpldapadmin.tar.gz && \ wget https://sources.debian.org/data/main/p/phpldapadmin/1.2.6.6-2/debian/patches/Fix-dynamic-property-PHP-8.2.patch && \ patch -p 1 -f < ./Fix-dynamic-property-PHP-8.2.patch && \ + printf "RELEASE-${VERSION}" > ./VERSION && \ rm -vr ./doc/ ./.gitignore ./*.md COPY <<-EOT /usr/local/share/sbom/phpldapadmin.spdx.json diff --git a/test.sh b/test.sh index 5c58384..a33dfc4 100755 --- a/test.sh +++ b/test.sh @@ -30,17 +30,27 @@ checkUrl() { echo "Running tests..." +echo "Checking /" checkUrl "http://${TEST_ADDR}/" -I +echo "Checking nginx status" checkUrl "http://${TEST_ADDR}/.nginx/status" -I +echo "Checking phpfpm status" checkUrl "http://${TEST_ADDR}/.phpfpm/status" -I +echo "Checking index" checkUrl "http://${TEST_ADDR}/index.php" -I +echo "Checking robots.txt" checkUrl "http://${TEST_ADDR}/robots.txt" -I +echo "Checking logo small" checkUrl "http://${TEST_ADDR}/images/default/logo-small.png" -I | grep -F "Cache-Control: max-age=315360000" +echo "Checking version" checkUrl "http://${TEST_ADDR}/index.php" | grep -q -F "1.2.6.7" + +echo "Checking login" checkUrl "http://${TEST_ADDR}/cmd.php" "form" "cmd=login&server_id=1&nodecode%5Blogin_pass%5D=1&login=cn%3Dadmin%2Cdc%3Dexample%2Cdc%3Dorg&login_pass=ldapadminpass&submit=Authenticate" | grep -q -F "Successfully logged into server." if [ $DID_FAIL -gt 0 ]; then echo "Some URLs failed" exit 1 fi +echo "All tests PASS"