do not require unused partial dirs in 'source' (Closes: #633510)
[ntk/apt.git] / test / integration / framework
index b0ea7a5..96cdb5f 100644 (file)
@@ -145,6 +145,7 @@ setupenvironment() {
        echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf
        echo 'quiet::NoUpdate "true";' >> aptconfig.conf
        export LC_ALL=C
+       export PATH="${PATH}:/usr/local/sbin:/usr/sbin:/sbin"
        msgdone "info"
 }
 
@@ -572,13 +573,22 @@ changetowebserver() {
        if which weborf > /dev/null; then
                weborf -xb aptarchive/ 2>&1 > /dev/null &
                addtrap "kill $!;"
-               local APTARCHIVE="file://$(readlink -f ./aptarchive)"
-               for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do
-                       sed -i $LIST -e "s#$APTARCHIVE#http://localhost:8080/#"
-               done
-               return 0
+       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 &
+               addtrap "kill $!;"
+       else
+               msgdie 'You have to install weborf or lighttpd first'
+               return 1
        fi
-       return 1
+       local APTARCHIVE="file://$(readlink -f ./aptarchive)"
+       for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do
+               sed -i $LIST -e "s#$APTARCHIVE#http://localhost:8080/#"
+       done
+       return 0
 }
 
 checkdiff() {
@@ -694,7 +704,13 @@ testmarkedauto() {
                while [ -n "$1" ]; do echo "$1"; shift; done | sort > $COMPAREFILE
        else
                msgtest 'Test for correctly marked as auto-installed' 'no package'
-               echo > $COMPAREFILE
+               echo -n > $COMPAREFILE
        fi
        aptmark showauto 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail
 }
+
+pause() {
+       echo "STOPPED execution. Press enter to continue"
+       local IGNORE
+       read IGNORE
+}