From ff86d7df6a53ff6283de4b9a858c1dad98ed887f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 15 Jun 2015 13:36:11 +0200 Subject: call URIStart in cdrom and file method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All other methods call it, so they should follow along even if the work they do afterwards is hardly breathtaking and usually results in a URIDone pretty soon, but the acquire system tells the individual item about this via a virtual method call, so even through none of our existing items contains any critical code in these, maybe one day they might. Consistency at least onceā€¦ Which is also why this has a good sideeffect: file: and cdrom: requests appear now in the 'apt-get update' output. Finally - it never made sense to hide them for me. Okay, I guess it made before the new hit behavior, but now that you can actually see the difference in an update it makes sense to see if a file: repository changed or not as well. --- test/integration/test-apt-cdrom | 6 ++++-- test/integration/test-apt-get-update-unauth-warning | 7 +++++++ test/integration/test-apt-progress-fd | 6 ++++-- .../test-bug-595691-empty-and-broken-archive-files | 20 ++++---------------- .../test-bug-596498-trusted-unsigned-repo | 8 +++++++- 5 files changed, 26 insertions(+), 21 deletions(-) (limited to 'test') diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom index 34b35f745..6a218ffb8 100755 --- a/test/integration/test-apt-cdrom +++ b/test/integration/test-apt-cdrom @@ -136,13 +136,15 @@ aptcache show testing -o Acquire::Languages=en | grep -q '^Description-en: ' && mv rootdir/media/cdrom-unmounted rootdir/media/cdrom-ejected msgmsg "ensure an update doesn't mess with cdrom sources" testsuccess aptget update -testfileequal rootdir/tmp/testsuccess.output 'Reading package lists...' +testfileequal rootdir/tmp/testsuccess.output 'Hit cdrom://Debian APT Testdisk 0.8.15 stable InRelease +Reading package lists...' mv rootdir/media/cdrom-ejected rootdir/media/cdrom-unmounted testcdromusage msgmsg 'and again to check that it withstands the temptation even if it could mount' testsuccess aptget update -testfileequal rootdir/tmp/testsuccess.output 'Reading package lists...' +testfileequal rootdir/tmp/testsuccess.output 'Hit cdrom://Debian APT Testdisk 0.8.15 stable InRelease +Reading package lists...' testcdromusage msgmsg 'Check that nothing touched our' 'CD-ROM' diff --git a/test/integration/test-apt-get-update-unauth-warning b/test/integration/test-apt-get-update-unauth-warning index ada7f7a26..1f4a14e23 100755 --- a/test/integration/test-apt-get-update-unauth-warning +++ b/test/integration/test-apt-get-update-unauth-warning @@ -9,6 +9,7 @@ TESTDIR=$(readlink -f $(dirname $0)) setupenvironment configarchitecture "i386" +configcompression '.' 'gz' # a "normal" package with source and binary buildsimplenativepackage 'foo' 'all' '2.0' @@ -31,11 +32,17 @@ testsuccessequal 'Listing...' apt list foo testequal 'lock partial' ls rootdir/var/lib/apt/lists +filesize() { + stat -c%s "$(aptget files --no-release-info --format '$(URI)' "Created-By: $1" | cut -d'/' -f 3- ).gz" +} # allow override testwarningequal "Ign file:$APTARCHIVE unstable InRelease File not found Ign file:$APTARCHIVE unstable Release File not found +Get:1 file:$APTARCHIVE unstable/main Sources [$(filesize 'Sources') B] +Get:2 file:$APTARCHIVE unstable/main i386 Packages [$(filesize 'Packages') B] +Get:3 file:$APTARCHIVE unstable/main Translation-en [$(filesize 'Translations') B] Reading package lists... W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository." aptget update --allow-insecure-repositories # ensure we can not install the package diff --git a/test/integration/test-apt-progress-fd b/test/integration/test-apt-progress-fd index 0c11aba7e..99b4ea050 100755 --- a/test/integration/test-apt-progress-fd +++ b/test/integration/test-apt-progress-fd @@ -16,6 +16,7 @@ setupaptarchive exec 3> apt-progress.log testsuccess aptget install testing=0.1 -y -o APT::Status-Fd=3 testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1 +dlstatus:1:0:Retrieving file 1 of 1 dlstatus:1:20:Retrieving file 1 of 1 pmstatus:dpkg-exec:0:Running dpkg pmstatus:testing:0:Installing testing (amd64) @@ -32,6 +33,7 @@ pmstatus:dpkg-exec:83.3333:Running dpkg' exec 3> apt-progress.log testsuccess aptget install testing=0.8.15 -y -o APT::Status-Fd=3 testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1 +dlstatus:1:0:Retrieving file 1 of 1 dlstatus:1:20:Retrieving file 1 of 1 pmstatus:dpkg-exec:0:Running dpkg pmstatus:testing:0:Installing testing (amd64) @@ -48,6 +50,7 @@ pmstatus:dpkg-exec:83.3333:Running dpkg' exec 3> apt-progress.log testsuccess aptget install testing=0.8.15 --reinstall -y -o APT::Status-Fd=3 testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1 +dlstatus:1:0:Retrieving file 1 of 1 dlstatus:1:20:Retrieving file 1 of 1 pmstatus:dpkg-exec:0:Running dpkg pmstatus:testing:0:Installing testing (amd64) @@ -73,9 +76,8 @@ pmstatus:dpkg-exec:75:Running dpkg' # install non-native and ensure we get proper progress info exec 3> apt-progress.log testsuccess aptget install testing2:i386 -y -o APT::Status-Fd=3 - -# and compare testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1 +dlstatus:1:0:Retrieving file 1 of 1 dlstatus:1:20:Retrieving file 1 of 1 pmstatus:dpkg-exec:0:Running dpkg pmstatus:testing2:0:Installing testing2 (i386) diff --git a/test/integration/test-bug-595691-empty-and-broken-archive-files b/test/integration/test-bug-595691-empty-and-broken-archive-files index b42212f5e..3042d116d 100755 --- a/test/integration/test-bug-595691-empty-and-broken-archive-files +++ b/test/integration/test-bug-595691-empty-and-broken-archive-files @@ -27,9 +27,6 @@ testaptgetupdate() { createemptyarchive() { find aptarchive/ \( -name "Packages*" -o -name "en*" \) -type f -delete - if [ "en" = "$1" ]; then - echo -n "" | $COMPRESSOR_CMD > aptarchive/Packages.$COMPRESS - fi touch aptarchive/Packages echo -n "" | $COMPRESSOR_CMD > aptarchive/${1}.$COMPRESS generatereleasefiles @@ -39,9 +36,6 @@ createemptyarchive() { createemptyfile() { find aptarchive/ \( -name "Packages*" -o -name "en*" \) -type f -delete - if [ "en" = "$1" ]; then - echo -n "" | $COMPRESSOR_CMD > aptarchive/Packages.$COMPRESS - fi touch aptarchive/Packages aptarchive/${1}.$COMPRESS generatereleasefiles signreleasefiles @@ -52,19 +46,13 @@ testoverfile() { local APTARCHIVE="$(readlink -f ./aptarchive)" forcecompressor "$1" - createemptyfile 'en' - testaptgetupdate 'Reading package lists...' "empty file en.$COMPRESS over file" - - createemptyarchive 'en' - testaptgetupdate 'Reading package lists...' "empty archive en.$COMPRESS over file" - createemptyarchive 'Packages' - # FIXME: Why omits the file transport the Packages Get line? - #Get:3 file: Packages [] - testaptgetupdate 'Reading package lists...' "empty archive Packages.$COMPRESS over file" + testaptgetupdate "Get: file:$APTARCHIVE Packages [] +Reading package lists..." "empty archive Packages.$COMPRESS over file" createemptyfile 'Packages' - testaptgetupdate "Err file:$APTARCHIVE Packages + testaptgetupdate "Get: file:$APTARCHIVE Packages +Err file:$APTARCHIVE Packages Empty files can't be valid archives W: Failed to fetch ${COMPRESSOR}:${APTARCHIVE}/Packages.$COMPRESS Empty files can't be valid archives diff --git a/test/integration/test-bug-596498-trusted-unsigned-repo b/test/integration/test-bug-596498-trusted-unsigned-repo index 4eb77b9a4..1ff0f1d8d 100755 --- a/test/integration/test-bug-596498-trusted-unsigned-repo +++ b/test/integration/test-bug-596498-trusted-unsigned-repo @@ -15,13 +15,17 @@ aptgetupdate() { ${1:-testwarning} aptget update --allow-insecure-repositories } -PKGTEXT="$(aptget install cool --assume-no -d | head -n 7)" +PKGTEXT="$(aptget install cool --assume-no -d | head -n 8)" +DOWNLOG="$(echo "$PKGTEXT" | tail -n 1)" +PKGTEXT="$(echo "$PKGTEXT" | head -n 7)" DEBFILE='rootdir/etc/apt/sources.list.d/apt-test-unstable-deb.list' testsuccessequal "$PKGTEXT +$DOWNLOG Download complete and in download only mode" aptget install cool --assume-no -d testsuccessequal "$PKGTEXT +$DOWNLOG Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated sed -i -e 's#deb#deb [trusted=no]#' $DEBFILE @@ -47,10 +51,12 @@ testsuccessequal "$PKGTEXT WARNING: The following packages cannot be authenticated! cool Authentication warning overridden. +$DOWNLOG Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated sed -i -e 's#deb#deb [trusted=yes]#' $DEBFILE aptgetupdate testsuccessequal "$PKGTEXT +$DOWNLOG Download complete and in download only mode" aptget install cool --assume-no -d -- cgit v1.2.3