]> git.saurik.com Git - apt.git/blobdiff - test/integration/framework
do not hardcode /dev/null in changetowebserver so it can be changed
[apt.git] / test / integration / framework
index 2d6ada117c73abae12d28d28090a512e5c529d79..965f984cab5b1f9d93237fd07d3a88142a591661 100644 (file)
@@ -688,20 +688,30 @@ signreleasefiles() {
 }
 
 changetowebserver() {
 }
 
 changetowebserver() {
-       if which weborf > /dev/null; then
-               weborf -xb aptarchive/ 2>&1 > /dev/null &
+       if [ -n "$1" ] && ! test -x ${BUILDDIRECTORY}/aptwebserver; then
+               msgdie 'Need the aptwebserver when passing arguments'
+       fi
+
+       local LOG='/dev/null'
+       if test -x ${BUILDDIRECTORY}/aptwebserver; then
+               cd aptarchive
+               LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/aptwebserver $@ 2> $LOG > $LOG &
+               addtrap "kill $!;"
+               cd - > /dev/null
+       elif which weborf > /dev/null; then
+               weborf -xb aptarchive/ 2> $LOG > $LOG &
                addtrap "kill $!;"
        elif which gatling > /dev/null; then
                cd aptarchive
                addtrap "kill $!;"
        elif which gatling > /dev/null; then
                cd aptarchive
-               gatling -p 8080 -F -S 2>&1 > /dev/null &
+               gatling -p 8080 -F -S 2> $LOG > $LOG &
                addtrap "kill $!;"
                cd - > /dev/null
        elif which lighttpd > /dev/null; then
                echo "server.document-root = \"$(readlink -f ./aptarchive)\"
 server.port = 8080
 server.stat-cache-engine = \"disable\"" > lighttpd.conf
                addtrap "kill $!;"
                cd - > /dev/null
        elif which lighttpd > /dev/null; then
                echo "server.document-root = \"$(readlink -f ./aptarchive)\"
 server.port = 8080
 server.stat-cache-engine = \"disable\"" > lighttpd.conf
-               lighttpd -t -f lighttpd.conf >/dev/null || msgdie 'Can not change to webserver: our lighttpd config is invalid'
-               lighttpd -D -f lighttpd.conf 2>/dev/null >/dev/null &
+               lighttpd -t -f lighttpd.conf 2> $LOG > $LOG || msgdie 'Can not change to webserver: our lighttpd config is invalid'
+               lighttpd -D -f lighttpd.conf 2> $LOG > $LOG &
                addtrap "kill $!;"
        else
                msgdie 'You have to install weborf or lighttpd first'
                addtrap "kill $!;"
        else
                msgdie 'You have to install weborf or lighttpd first'