]> git.saurik.com Git - apt.git/blobdiff - test/integration/framework
always send content-length via the new addDataHeaders() to ensure w3m/curl are happy...
[apt.git] / test / integration / framework
index b80b02922507f2bbbb9cf2524e2472d4b3227d0f..bf46ae0c56eb397d0c68bc0195bf735c7a0b94dd 100644 (file)
@@ -107,6 +107,10 @@ aptitude() {
                LD_LIBRARY_PATH=${BUILDDIRECTORY}  $(which aptitude) $*
        fi
 }
                LD_LIBRARY_PATH=${BUILDDIRECTORY}  $(which aptitude) $*
        fi
 }
+gdb() {
+       echo "gdb: run »$*«"
+       APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} $(which gdb) ${BUILDDIRECTORY}/$1
+}
 
 addtrap() {
        CURRENTTRAP="$CURRENTTRAP $1"
 
 addtrap() {
        CURRENTTRAP="$CURRENTTRAP $1"
@@ -300,23 +304,28 @@ echo '$NAME says \"Hello!\"'" > ${BUILDDIR}/${NAME}
 Section: $SECTION
 Priority: $PRIORITY
 Maintainer: Joe Sixpack <joe@example.org>
 Section: $SECTION
 Priority: $PRIORITY
 Maintainer: Joe Sixpack <joe@example.org>
-Standards-Version: 3.9.1
+Standards-Version: 3.9.3" > ${BUILDDIR}/debian/control
+       local BUILDDEPS="$(echo "$DEPENDENCIES" | grep '^Build-')"
+       test -z "$BUILDDEPS" || echo "$BUILDDEPS" >> ${BUILDDIR}/debian/control
+       echo "
+Package: $NAME" >> ${BUILDDIR}/debian/control
 
 
-Package: $NAME" > ${BUILDDIR}/debian/control
        if [ "$ARCH" = 'all' ]; then
                echo "Architecture: all" >> ${BUILDDIR}/debian/control
        else
                echo "Architecture: any" >> ${BUILDDIR}/debian/control
        fi
        if [ "$ARCH" = 'all' ]; then
                echo "Architecture: all" >> ${BUILDDIR}/debian/control
        else
                echo "Architecture: any" >> ${BUILDDIR}/debian/control
        fi
-       test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> ${BUILDDIR}/debian/control
+       local DEPS="$(echo "$DEPENDENCIES" | grep -v '^Build-')"
+       test -z "$DEPS" || echo "$DEPS" >> ${BUILDDIR}/debian/control
        if [ -z "$DESCRIPTION" ]; then
                echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE}
  If you find such a package installed on your system,
  YOU did something horribly wrong! They are autogenerated
  und used only by testcases for APT and surf no other propose…" >> ${BUILDDIR}/debian/control
        else
        if [ -z "$DESCRIPTION" ]; then
                echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE}
  If you find such a package installed on your system,
  YOU did something horribly wrong! They are autogenerated
  und used only by testcases for APT and surf no other propose…" >> ${BUILDDIR}/debian/control
        else
-               echo "Description: $DESCRIPTION" >> ${BUILDIR}/debian/control
+               echo "Description: $DESCRIPTION" >> ${BUILDDIR}/debian/control
        fi
        fi
+
        echo '3.0 (native)' > ${BUILDDIR}/debian/source/format
        local SRCS="$( (cd ${BUILDDIR}/..; dpkg-source -b ${NAME}-${VERSION} 2>&1) | grep '^dpkg-source: info: building' | grep -o '[a-z0-9._+~-]*$')"
        for SRC in $SRCS; do
        echo '3.0 (native)' > ${BUILDDIR}/debian/source/format
        local SRCS="$( (cd ${BUILDDIR}/..; dpkg-source -b ${NAME}-${VERSION} 2>&1) | grep '^dpkg-source: info: building' | grep -o '[a-z0-9._+~-]*$')"
        for SRC in $SRCS; do
@@ -504,7 +513,8 @@ Architecture: $ARCH" >> $FILE
        test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE
        echo "Files:
  d41d8cd98f00b204e9800998ecf8427e 0 ${NAME}_${VERSION}.dsc
        test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE
        echo "Files:
  d41d8cd98f00b204e9800998ecf8427e 0 ${NAME}_${VERSION}.dsc
- d41d8cd98f00b204e9800998ecf8427e 0 ${NAME}_${VERSION}.tar.gz" >> $FILE
+ d41d8cd98f00b204e9800998ecf8427e 0 ${NAME}_${VERSION}.tar.gz
+" >> $FILE
 }
 
 insertinstalledpackage() {
 }
 
 insertinstalledpackage() {
@@ -677,8 +687,20 @@ signreleasefiles() {
        msgdone "info"
 }
 
        msgdone "info"
 }
 
+simulatebrokenwebserver() {
+       if ! test -x ${BUILDDIRECTORY}/aptwebserver; then
+                 msgdie 'Need the aptwebserver to simulate broken connections'
+        fi
+        changetowebserver '--simulate-paywall'
+}
+
 changetowebserver() {
 changetowebserver() {
-       if which weborf > /dev/null; then
+       if test -x ${BUILDDIRECTORY}/aptwebserver; then
+               cd aptarchive
+               LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/aptwebserver $@ 2> /dev/null > /dev/null &
+               addtrap "kill $!;"
+               cd - > /dev/null
+       elif which weborf > /dev/null; then
                weborf -xb aptarchive/ 2>&1 > /dev/null &
                addtrap "kill $!;"
        elif which gatling > /dev/null; then
                weborf -xb aptarchive/ 2>&1 > /dev/null &
                addtrap "kill $!;"
        elif which gatling > /dev/null; then