2003-08-31 16:46:20 +02:00
|
|
|
#! /bin/sh
|
|
|
|
|
2003-09-28 18:24:14 +02:00
|
|
|
if [ -d root-tests ]
|
|
|
|
then
|
|
|
|
echo "Deleting old test environment..."
|
|
|
|
rm -rf root-tests
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Installing test environment in root-tests/"
|
|
|
|
rm -rf root-tests && mkdir root-tests 2> /dev/null
|
2003-10-14 23:53:23 +02:00
|
|
|
rm -f config && make config config-tests install \
|
2003-09-28 18:24:14 +02:00
|
|
|
GLASNOST=glasnost-tests PORT=8500 \
|
|
|
|
PREFIX=`pwd`/root-tests/usr/local \
|
|
|
|
VARPREFIX=`pwd`/root-tests/var/lib/ \
|
|
|
|
ETC_DIR=`pwd`/root-tests/etc/glasnost-tests \
|
|
|
|
LOGPREFIX=`pwd`/root-tests/var/log \
|
|
|
|
SERVER_USER=`id -u` SERVER_GROUP=`id -u` \
|
|
|
|
WEB_USER=`id -u` WEB_GROUP=`id -u` &> /dev/null
|
|
|
|
|
2003-10-14 10:38:37 +02:00
|
|
|
mkdir -p root-tests/etc/apache
|
|
|
|
mkdir -p root-tests/var/lock
|
|
|
|
mkdir -p root-tests/var/run
|
|
|
|
mkdir -p root-tests/var/log/apache
|
|
|
|
PREFIX=`pwd`/root-tests \
|
|
|
|
python -c "import os, sys; \
|
|
|
|
print sys.stdin.read().replace( \
|
|
|
|
'PREFIX', os.environ['PREFIX'])" < tests/httpd.conf \
|
|
|
|
> root-tests/etc/apache/httpd.conf
|
|
|
|
|
2003-10-05 12:30:42 +02:00
|
|
|
SERVERS="Dispatcher ArticlesServer AtomsServer AuthenticationServer \
|
|
|
|
AuthenticationLoginPasswordServer CardsServer DataflowsServer \
|
|
|
|
GroupsServer PeopleServer VirtualHostsServer"
|
|
|
|
echo "Starting Glasnost servers..."
|
|
|
|
for SERVER in $SERVERS
|
|
|
|
do
|
|
|
|
root-tests/usr/local/sbin/glasnost-tests-ctl start-one $SERVER
|
|
|
|
done
|
|
|
|
|
2003-10-14 10:38:37 +02:00
|
|
|
echo "Starting Apache server..."
|
2003-10-15 00:04:41 +02:00
|
|
|
if [ -e /usr/sbin/apache ]
|
|
|
|
then
|
|
|
|
/usr/sbin/apache -f `pwd`/root-tests/etc/apache/httpd.conf
|
|
|
|
elif [ -e /usr/sbin/apache-ssl ]
|
|
|
|
/usr/sbin/apache-ssl -f `pwd`/root-tests/etc/apache/httpd.conf
|
|
|
|
fi
|
2003-10-14 10:38:37 +02:00
|
|
|
|
2003-10-05 12:30:42 +02:00
|
|
|
(cd tmp-tests && python ./tests.py)
|
2003-09-28 18:24:14 +02:00
|
|
|
root-tests/usr/local/sbin/glasnost-tests-ctl stop
|
2003-10-15 00:04:41 +02:00
|
|
|
kill `cat root-tests/var/run/apache.pid` || /bin/true
|
2003-08-31 16:46:20 +02:00
|
|
|
|