summaryrefslogtreecommitdiff
path: root/test/integration/framework
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-03-27 15:53:43 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2015-04-19 01:13:08 +0200
commit27925d82dd0cbae74d48040363fe6f6c2bae5215 (patch)
treedfeb2d006049eda1dfa2ae082eb717a515fbbfae /test/integration/framework
parentbb948ef562862e5cc9fcfb3d7b5e41c70382adeb (diff)
improve https method queue progress reporting
The worker expects that the methods tell him when they start or finish downloading a file. Various information pieces are passed along in this report including the (expected) filesize. https was using a "global" struct for reporting which made it 'reuse' incorrect values in some cases like a non-existent InRelease fallbacking to Release{,.gpg} resulting in a size-mismatch warning. Reducing the scope and redesigning the setting of the values we can fix this and related issues. Closes: 777565, 781509 Thanks: Robert Edmonds and Anders Kaseorg for initial patchs
Diffstat (limited to 'test/integration/framework')
-rw-r--r--test/integration/framework20
1 files changed, 18 insertions, 2 deletions
diff --git a/test/integration/framework b/test/integration/framework
index ec23e41e6..50c027a2c 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -1125,8 +1125,10 @@ acquire::cdrom::autodetect 0;" > rootdir/etc/apt/apt.conf.d/00cdrom
downloadfile() {
local PROTO="${1%%:*}"
- apthelper -o Debug::Acquire::${PROTO}=1 -o Debug::pkgAcquire::Worker=1 \
- download-file "$1" "$2" 2>&1 || true
+ if ! apthelper -o Debug::Acquire::${PROTO}=1 -o Debug::pkgAcquire::Worker=1 \
+ download-file "$1" "$2" 2>&1 ; then
+ return 1
+ fi
# only if the file exists the download was successful
if [ -r "$2" ]; then
return 0
@@ -1407,6 +1409,20 @@ testfailureequal() {
testfileequal "${TMPWORKINGDIRECTORY}/rootdir/tmp/testfailure.output" "$CMP"
}
+testfailuremsg() {
+ local CMP="$1"
+ shift
+ testfailure "$@"
+ msgtest 'Check that the output of the previous failed command has expected' 'failures and warnings'
+ grep '^\(W\|E\):' "${TMPWORKINGDIRECTORY}/rootdir/tmp/testfailure.output" > "${TMPWORKINGDIRECTORY}/rootdir/tmp/testfailureequal.output" 2>&1 || true
+ if echo "$CMP" | checkdiff - "${TMPWORKINGDIRECTORY}/rootdir/tmp/testfailureequal.output"; then
+ msgpass
+ else
+ echo '### Complete output ###'
+ cat "${TMPWORKINGDIRECTORY}/rootdir/tmp/testfailure.output"
+ msgfail
+ fi
+}
testfilestats() {
msgtest "Test that file $1 has $2 $3" "$4"