From 8c1dd12cb53ce141d8ade2c8abc619dcfa7f37a1 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 18 Mar 2013 08:08:37 +0100 Subject: * test/integration/framework: - continue after test failure but preserve exit status --- test/integration/framework | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index 1c4872c8e..883b65bba 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -1,5 +1,7 @@ #!/bin/sh -- # no runable script, just for vi +TESTFAILURES="no" + # we all like colorful messages if expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null && \ expr match "$(readlink -f /proc/$$/fd/2)" '/dev/pts/[0-9]\+' > /dev/null; then @@ -36,7 +38,7 @@ msgtest() { } msgpass() { echo "${CPASS}PASS${CNORMAL}" >&2; } msgskip() { echo "${CWARNING}SKIP${CNORMAL}" >&2; } -msgfail() { echo "${CFAIL}FAIL${CNORMAL}" >&2; } +msgfail() { echo "${CFAIL}FAIL${CNORMAL}" >&2; TESTFAILURES="yes"; } # enable / disable Debugging MSGLEVEL=${MSGLEVEL:-3} @@ -113,9 +115,13 @@ gdb() { APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} $(which gdb) ${BUILDDIRECTORY}/$1 } +exitwithstatus() { + [ "$TESTFAILURES" = "yes" ] && exit 1 || exit 0; +} + addtrap() { CURRENTTRAP="$CURRENTTRAP $1" - trap "$CURRENTTRAP exit;" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM + trap "$CURRENTTRAP exitwithstatus;" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM } setupenvironment() { -- cgit v1.2.3 From f91bd741d223395cc3b1a609459e7d7226916e86 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 18 Mar 2013 11:38:19 +0100 Subject: report failures via exit and ensure we don't overflow --- test/integration/framework | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index 883b65bba..cdaa20627 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -1,6 +1,6 @@ #!/bin/sh -- # no runable script, just for vi -TESTFAILURES="no" +TESTFAILURES=0 # we all like colorful messages if expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null && \ @@ -38,7 +38,7 @@ msgtest() { } msgpass() { echo "${CPASS}PASS${CNORMAL}" >&2; } msgskip() { echo "${CWARNING}SKIP${CNORMAL}" >&2; } -msgfail() { echo "${CFAIL}FAIL${CNORMAL}" >&2; TESTFAILURES="yes"; } +msgfail() { echo "${CFAIL}FAIL${CNORMAL}" >&2; TESTFAILURES=$((TESTFAILURES+1)); } # enable / disable Debugging MSGLEVEL=${MSGLEVEL:-3} @@ -116,7 +116,12 @@ gdb() { } exitwithstatus() { - [ "$TESTFAILURES" = "yes" ] && exit 1 || exit 0; + # error if we about to overflow, but ... + # "255 failures ought to be enough for everybody" + if [ $TESTFAILURES -gt 255 ]; then + msgdie "Total failure count $TESTFAILURES too big" + fi + exit $((TESTFAILURES <= 255 ? TESTFAILURES : 255)); } addtrap() { -- cgit v1.2.3 From 5d76cee187ea6f1443c6afd0d1cf99f3555304ef Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 18 Mar 2013 11:46:20 +0100 Subject: test/integration/framework: use EXIT_CODE to be consistent with the run-tests code --- test/integration/framework | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index cdaa20627..4a70573c8 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -1,6 +1,6 @@ #!/bin/sh -- # no runable script, just for vi -TESTFAILURES=0 +EXIT_CODE=0 # we all like colorful messages if expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null && \ @@ -38,7 +38,7 @@ msgtest() { } msgpass() { echo "${CPASS}PASS${CNORMAL}" >&2; } msgskip() { echo "${CWARNING}SKIP${CNORMAL}" >&2; } -msgfail() { echo "${CFAIL}FAIL${CNORMAL}" >&2; TESTFAILURES=$((TESTFAILURES+1)); } +msgfail() { echo "${CFAIL}FAIL${CNORMAL}" >&2; EXIT_CODE=$((EXIT_CODE+1)); } # enable / disable Debugging MSGLEVEL=${MSGLEVEL:-3} @@ -118,10 +118,10 @@ gdb() { exitwithstatus() { # error if we about to overflow, but ... # "255 failures ought to be enough for everybody" - if [ $TESTFAILURES -gt 255 ]; then - msgdie "Total failure count $TESTFAILURES too big" + if [ $EXIT_CODE -gt 255 ]; then + msgdie "Total failure count $EXIT_CODE too big" fi - exit $((TESTFAILURES <= 255 ? TESTFAILURES : 255)); + exit $((EXIT_CODE <= 255 ? EXIT_CODE : 255)); } addtrap() { -- cgit v1.2.3 From f1828b6977972b4ef6da6401602b7938f6570c32 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 18 Mar 2013 19:36:55 +0100 Subject: - add method to open (maybe) clearsigned files transparently * ftparchive/writer.cc: - use OpenMaybeClearSignedFile to be free from detecting and skipping clearsigning metadata in dsc files --- test/integration/framework | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index 1c4872c8e..2ef61ca84 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -328,9 +328,15 @@ Package: $NAME" >> ${BUILDDIR}/debian/control 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 + (cd ${BUILDDIR}/..; dpkg-source -b ${NAME}-${VERSION} 2>&1) | sed -n 's#^dpkg-source: info: building [^ ]\+ in ##p' \ + | while read SRC; do echo "pool/${SRC}" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.srclist +# if expr match "${SRC}" '.*\.dsc' >/dev/null 2>&1; then +# gpg --yes --no-default-keyring --secret-keyring ./keys/joesixpack.sec \ +# --keyring ./keys/joesixpack.pub --default-key 'Joe Sixpack' \ +# --clearsign -o "${BUILDDIR}/../${SRC}.sign" "${BUILDDIR}/../$SRC" +# mv "${BUILDDIR}/../${SRC}.sign" "${BUILDDIR}/../$SRC" +# fi done for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do -- cgit v1.2.3 From 233b78083f6f79730fcb5a6faeb74e2a78b6038a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 18 Mar 2013 22:57:08 +0100 Subject: * apt-pkg/deb/debindexfile.cc, apt-pkg/deb/deblistparser.cc: - use OpenMaybeClearSignedFile to be free from detecting and skipping clearsigning metadata in dsc and Release files We can't write a "clean" file to disk as not all acquire methods copy Release files before checking them (e.g. cdrom), so this reverts recombining, but uses the method we use for dsc files also in the two places we deal with Release files --- test/integration/framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/integration/framework') diff --git a/test/integration/framework b/test/integration/framework index 2ef61ca84..86e6ed7c3 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -114,7 +114,7 @@ gdb() { } addtrap() { - CURRENTTRAP="$CURRENTTRAP $1" + CURRENTTRAP="$1 $CURRENTTRAP" trap "$CURRENTTRAP exit;" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM } -- cgit v1.2.3