]> git.saurik.com Git - apt.git/blobdiff - test/integration/framework
fix test/integration/test-apt-key-net-update
[apt.git] / test / integration / framework
index 0f57d0259fc119b9fad5675153a16b9664847317..89b5bb0e4231ec99040ed9cddc2a77983d85174a 100644 (file)
@@ -116,7 +116,7 @@ aptitude() {
 }
 gdb() {
        echo "gdb: run »$*«"
-       APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} $(which gdb) ${BUILDDIRECTORY}/$1
+       APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} $(which gdb) ${BUILDDIRECTORY}/$1 --args $*
 }
 http() {
        LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/methods/http
@@ -192,6 +192,7 @@ setupenvironment() {
        fi
        echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf
        echo 'quiet::NoUpdate "true";' >> aptconfig.conf
+       echo "Acquire::https::CaInfo \"${TESTDIR}/apt.pem\";" > rootdir/etc/apt/apt.conf.d/99https
        export LC_ALL=C
        export PATH="${PATH}:/usr/local/sbin:/usr/sbin:/sbin"
        configcompression '.' 'gz' #'bz2' 'lzma' 'xz'
@@ -395,10 +396,6 @@ Package: $NAME" >> ${BUILDDIR}/debian/control
                 if [ -n "$FILE_TREE" ]; then
                     cp -ar "$FILE_TREE" ${BUILDDIR}/debian/tmp
                 fi
-                if [ -n "$POSTINST" ]; then
-                    echo "$POSTINST" > ${BUILDDIR}/debian/tmp/DEBIAN/postinst
-                    chmod +x  ${BUILDDIR}/debian/tmp/DEBIAN/postinst
-                fi
 
                (cd ${BUILDDIR}; dpkg-gencontrol -DArchitecture=$arch)
                (cd ${BUILDDIR}/debian/tmp; md5sum $(find usr/ -type f) > DEBIAN/md5sums)
@@ -795,6 +792,22 @@ signreleasefiles() {
        msgdone "info"
 }
 
+webserverconfig() {
+       msgtest "Set webserver config option '${1}' to" "$2"
+       downloadfile "http://localhost:8080/_config/set/${1}/${2}" '/dev/null' >/dev/null
+       local DOWNLOG='download-testfile.log'
+       rm -f "$DOWNLOG"
+       local STATUS="$(mktemp)"
+       addtrap "rm $STATUS;"
+       downloadfile "http://localhost:8080/_config/find/aptwebserver::last-status-code" "$STATUS" > "$DOWNLOG"
+       if [ "$(cat "$STATUS")" = '200' ]; then
+               msgpass
+       else
+               cat >&2 "$DOWNLOG"
+               msgfail "Statuscode was $(cat "$STATUS")"
+       fi
+}
+
 rewritesourceslist() {
        local APTARCHIVE="file://$(readlink -f "${TMPWORKINGDIRECTORY}/aptarchive")"
        for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do
@@ -803,6 +816,11 @@ rewritesourceslist() {
 }
 
 changetowebserver() {
+       if [ "$1" != '--no-rewrite' ]; then
+               rewritesourceslist 'http://localhost:8080/'
+       else
+               shift
+       fi
        local LOG='/dev/null'
        if test -x ${BUILDDIRECTORY}/aptwebserver; then
                cd aptarchive
@@ -816,9 +834,6 @@ changetowebserver() {
        else
                msgdie 'You have to build aptwerbserver or install a webserver'
        fi
-       if [ "$1" != '--no-rewrite' ]; then
-               rewritesourceslist 'http://localhost:8080/'
-       fi
 }
 
 changetohttpswebserver() {
@@ -830,6 +845,7 @@ changetohttpswebserver() {
        fi
        echo "pid = ${TMPWORKINGDIRECTORY}/aptarchive/stunnel.pid
 cert = ${TESTDIRECTORY}/apt.pem
+output = /dev/null
 
 [https]
 accept = 4433