From 07c27296c2c940cb119386304ebffb4ab41f0fb9 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Wed, 26 Feb 2014 16:37:51 -0500 Subject: Add some basic functional tests. This tests in an in-tree Apache instance using the local libmodnss.so shared library, so no pre-installation is necessary. The tests use python-nose and a hacked python-requests library. It is hacked so I can obtain the negotiated cipher and protocol as well as pass a few other things into it. Tests right now are limited to GET requests. A new user certificate for 'beta' was added to gencert to do pass/fail access control testing. The basic process of the tests are: - run setup.sh which sets up a new instance with createinstance.sh and does some variable substitution. - nosetests -v I picture multiple test "suites" of different configurations. Right now there is only one. A template file is provided for each suite. Tested only on Fedora 20 right now. --- test/createinstance.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 test/createinstance.sh (limited to 'test/createinstance.sh') diff --git a/test/createinstance.sh b/test/createinstance.sh new file mode 100755 index 0000000..1eaa644 --- /dev/null +++ b/test/createinstance.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# +# Make a temporary Apache instance for testing. + +if [ " $#" -eq 0 ]; then + echo "Usage: $0 /path/to/instance" + exit 1 +fi +target=$1 + +echo "Creating instance in $target" +mkdir -p $target + +cd $target +mkdir alias +mkdir conf +mkdir conf.d +mkdir logs +mkdir run +mkdir content +mkdir cgi-bin +mkdir lib + +# Create the content +mkdir content/rc4_cipher +mkdir content/acl + +cat > content/index.html << EOF + +Basic index page + conf/htpasswd << EOF +/${dn}:xxj31ZMTZzkVA +EOF + +# Create start/stop scripts + +cat << EOF > start +#!/bin/sh +HTTPD=/usr/sbin/httpd +\$HTTPD -k start -d . -f ./conf/httpd.conf +EOF + +cat << EOF > stop +#!/bin/sh +HTTPD=/usr/sbin/httpd +\$HTTPD -k stop -d . -f ./conf/httpd.conf +EOF + +chmod 0755 start stop -- cgit