summaryrefslogtreecommitdiffstats
path: root/httpd/httpd_basic_auth.sh
diff options
context:
space:
mode:
authorAthmane Madjoudj <athmane@fedoraproject.org>2011-07-02 11:59:25 +0100
committerAthmane Madjoudj <athmane@fedoraproject.org>2011-07-02 11:59:25 +0100
commit188948efd084f587225c4faf6224501300e4fd7d (patch)
treed5e98227b64d0d1d97a6dd309668f09c29e911f1 /httpd/httpd_basic_auth.sh
downloadtestcases-scripts-188948efd084f587225c4faf6224501300e4fd7d.tar.gz
testcases-scripts-188948efd084f587225c4faf6224501300e4fd7d.tar.xz
testcases-scripts-188948efd084f587225c4faf6224501300e4fd7d.zip
- Initial commit
Diffstat (limited to 'httpd/httpd_basic_auth.sh')
-rwxr-xr-xhttpd/httpd_basic_auth.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/httpd/httpd_basic_auth.sh b/httpd/httpd_basic_auth.sh
new file mode 100755
index 0000000..4e0090f
--- /dev/null
+++ b/httpd/httpd_basic_auth.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+# A small Apache HTTPd test suite
+# Author: Athmane Madjoudj <athmane@fedoraproject.org>
+
+echo "Running $0 - httpd basic authentication test."
+
+cat > /etc/httpd/conf.d/dir-test-basic-auth.conf <<EOF
+Alias /basic_auth_test /var/www/html/basic_auth_test
+<Directory "/var/www/html/basic_auth_test">
+ AuthType Basic
+ AuthName "Test"
+ AuthUserFile /etc/httpd/htpasswd
+ require user test
+</Directory>
+EOF
+
+htpasswd -c -b /etc/httpd/htpasswd test test
+mkdir -p /var/www/html/basic_auth_test
+echo "Basic authentication Test Page" > /var/www/html/basic_auth_test/index.html
+service httpd reload
+curl -s -u test:test http://localhost/basic_auth_test/ | grep 'Basic authentication Test Page' > /dev/null 2>&1
+