From 859093dae7dcadaff2e15a3885a1824b0d5f5913 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 30 Aug 2014 11:29:45 +0200 Subject: support regular expressions in 'apt search' apt-cache search supported this since ever and in the code for apt was a fixme indicating this should be added here as well, so here we go. --- test/integration/framework | 8 +++++++- test/integration/test-apt-cli-search | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index 3bbf440c8..fde74f55d 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -1019,7 +1019,13 @@ testfileequal() { testempty() { msgtest "Test for no output of" "$*" - test -z "$($* 2>&1)" && msgpass || msgfail + local COMPAREFILE="${TMPWORKINGDIRECTORY}/rootdir/tmp/testempty.comparefile" + if $* >$COMPAREFILE 2>&1 && test ! -s $COMPAREFILE; then + msgpass + else + cat $COMPAREFILE + msgfail + fi } testequal() { diff --git a/test/integration/test-apt-cli-search b/test/integration/test-apt-cli-search index 58613717b..3ac074952 100755 --- a/test/integration/test-apt-cli-search +++ b/test/integration/test-apt-cli-search @@ -33,16 +33,31 @@ foo/unstable 1.0 all testequal "foo/unstable 1.0 all $DESCR " apt search -qq xxyyzz +testempty apt search -qq --names-only xxyyzz + +# search name +testequal "foo/unstable 1.0 all + $DESCR +" apt search -qq foo +testequal "foo/unstable 1.0 all + $DESCR +" apt search -qq --names-only foo # search with multiple words is a AND search testequal "foo/unstable 1.0 all $DESCR " apt search -qq aabbcc xxyyzz +testequal "foo/unstable 1.0 all + $DESCR +" apt search -qq 'a+b+c+' 'i*xxy{0,2}zz' # search is not case-sensitive by default testequal "foo/unstable 1.0 all $DESCR " apt search -qq uppercase +testequal "foo/unstable 1.0 all + $DESCR +" apt search -qq 'up[pP]erc[Aa]se' # output is sorted and search word finds both package testequal "bar/testing 2.0 i386 -- cgit v1.2.3 From 1a68655de92fd036ebc7c920bc2e5e88c54eb34e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 2 Sep 2014 14:32:48 +0200 Subject: implement --full in apt search --- test/integration/test-apt-cli-search | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/integration/test-apt-cli-search b/test/integration/test-apt-cli-search index 3ac074952..8f009d57c 100755 --- a/test/integration/test-apt-cli-search +++ b/test/integration/test-apt-cli-search @@ -15,7 +15,10 @@ fi DESCR='Some description that has a unusual word xxyyzz and aabbcc and a UPPERCASE' DESCR2='Some other description with the unusual aabbcc only' -insertpackage 'unstable' 'foo' 'all' '1.0' '' '' "$DESCR" +insertpackage 'unstable' 'foo' 'all' '1.0' '' '' "$DESCR + Long description of stuff and such, with lines + . + and paragraphs and everything." insertpackage 'testing' 'bar' 'i386' '2.0' '' '' "$DESCR2" setupaptarchive @@ -59,6 +62,17 @@ testequal "foo/unstable 1.0 all $DESCR " apt search -qq 'up[pP]erc[Aa]se' +# search is done in the long description +testequal "foo/unstable 1.0 all + $DESCR +" apt search -qq 'long description' +testequal "foo/unstable 1.0 all + $DESCR + Long description of stuff and such, with lines + . + and paragraphs and everything. +" apt search --full -qq 'long description' + # output is sorted and search word finds both package testequal "bar/testing 2.0 i386 $DESCR2 -- cgit v1.2.3 From e9bb097c914ff4fb1cdeda8a2843644dca184c56 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 7 Sep 2014 19:28:21 +0200 Subject: do use an 'unknown' arch-specification in test Using 'kfreebsd' here makes the test fail on a kfreebsd system (obviously), so we just use something totally madeup in the hope that this is less like to conflict in the future. Git-Dch: Ignore --- test/integration/test-architecture-specification-parsing | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/integration/test-architecture-specification-parsing b/test/integration/test-architecture-specification-parsing index a43354871..d1f6011de 100755 --- a/test/integration/test-architecture-specification-parsing +++ b/test/integration/test-architecture-specification-parsing @@ -13,10 +13,10 @@ buildsimplenativepackage 'pkg-arch-foo' "$NATIVE" '1.0' 'stable' "Build-Depends: Depends: foo [${NATIVE} !${NATIVE}]" buildsimplenativepackage 'pkg-arch-no-foo' "$NATIVE" '1.0' 'stable' "Build-Depends: foo [!${NATIVE} ${NATIVE}] Depends: foo [!${NATIVE} ${NATIVE}]" -buildsimplenativepackage 'pkg-arch-foo-unrelated-no' "$NATIVE" '1.0' 'stable' "Build-Depends: foo [!kfreebsd-any ${NATIVE}] -Depends: foo [!kfreebsd-any ${NATIVE}]" -buildsimplenativepackage 'pkg-arch-foo-unrelated-no2' "$NATIVE" '1.0' 'stable' "Build-Depends: foo [${NATIVE} !kfreebsd-any] -Depends: foo [${NATIVE} !kfreebsd-any]" +buildsimplenativepackage 'pkg-arch-foo-unrelated-no' "$NATIVE" '1.0' 'stable' "Build-Depends: foo [!someos-any ${NATIVE}] +Depends: foo [!someos-any ${NATIVE}]" +buildsimplenativepackage 'pkg-arch-foo-unrelated-no2' "$NATIVE" '1.0' 'stable' "Build-Depends: foo [${NATIVE} !someos-any] +Depends: foo [${NATIVE} !someos-any]" buildsimplenativepackage 'no-depends' 'armel' '1.0' 'stable' 'Build-Depends: foo [armeb], bar [arm] Depends: foo [armeb], bar [arm]' -- cgit v1.2.3 From 27cb4f6c919921b04f3dddff069620ced250a94f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 7 Sep 2014 19:30:33 +0200 Subject: detect terminal output with 'test -t' in tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of trying to inspect /proc and the fds inside we use "test -t 1" instead as this is available and working on kfreebsd as well – not that something breaks if we wouldn't, but we like color. Git-Dch: Ignore --- test/integration/framework | 2 +- test/integration/run-tests | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index fde74f55d..ff010a5c4 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -4,7 +4,7 @@ EXIT_CODE=0 # we all like colorful messages if [ "$MSGCOLOR" != 'NO' ]; then - if ! expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null; then + if [ ! -t 1 ]; then # but check that we output to a terminal export MSGCOLOR='NO' fi fi diff --git a/test/integration/run-tests b/test/integration/run-tests index 9dd550aa2..c39a2ac68 100755 --- a/test/integration/run-tests +++ b/test/integration/run-tests @@ -22,7 +22,7 @@ done export MSGLEVEL="${MSGLEVEL:-3}" if [ "$MSGCOLOR" != 'NO' ]; then - if ! expr match "$(readlink -f /proc/$$/fd/1)" '/dev/pts/[0-9]\+' > /dev/null; then + if [ ! -t 1 ]; then # but check that we output to a terminal export MSGCOLOR='NO' fi fi -- cgit v1.2.3 From b578738870e83db4e61d6f6591bc73884108b7d4 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 7 Sep 2014 21:27:57 +0200 Subject: strip everything spacey in APT::String::Strip Git-Dch: Ignore --- test/libapt/strutil_test.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test') diff --git a/test/libapt/strutil_test.cc b/test/libapt/strutil_test.cc index e9b778c6b..194c9c074 100644 --- a/test/libapt/strutil_test.cc +++ b/test/libapt/strutil_test.cc @@ -19,6 +19,21 @@ TEST(StrUtilTest,DeEscapeString) EXPECT_EQ("foo\\ x", DeEscapeString("foo\\\\ x")); EXPECT_EQ("\\foo\\", DeEscapeString("\\\\foo\\\\")); } +TEST(StrUtilTest,StringStrip) +{ + EXPECT_EQ("", APT::String::Strip("")); + EXPECT_EQ("foobar", APT::String::Strip("foobar")); + EXPECT_EQ("foo bar", APT::String::Strip("foo bar")); + + EXPECT_EQ("", APT::String::Strip(" ")); + EXPECT_EQ("", APT::String::Strip(" \r\n \t ")); + + EXPECT_EQ("foo bar", APT::String::Strip("foo bar ")); + EXPECT_EQ("foo bar", APT::String::Strip("foo bar \r\n \t ")); + EXPECT_EQ("foo bar", APT::String::Strip("\r\n \t foo bar")); + EXPECT_EQ("bar foo", APT::String::Strip("\r\n \t bar foo \r\n \t ")); + EXPECT_EQ("bar \t\r\n foo", APT::String::Strip("\r\n \t bar \t\r\n foo \r\n \t ")); +} TEST(StrUtilTest,StringSplitBasic) { std::vector result = StringSplit("", ""); -- cgit v1.2.3 From f920cbe8527ce523974da2563ca1165790c1d40e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 7 Sep 2014 22:08:01 +0200 Subject: fix and non-silent fail dpkg-overwrite error test Commit cbcdd3ee9d86379d1b3a44e41ae8b17dc23111d0 removes the space at the end of the debfile name dpkg send to us and we previously had included in the pmerror message we printed on the statusfd. Git-Dch: Ignore --- test/integration/test-apt-progress-fd-error | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/integration/test-apt-progress-fd-error b/test/integration/test-apt-progress-fd-error index 96d66371a..a47095b9b 100755 --- a/test/integration/test-apt-progress-fd-error +++ b/test/integration/test-apt-progress-fd-error @@ -18,5 +18,10 @@ setupaptarchive exec 3> apt-progress.log testfailure aptget install foo1 foo2 -y -o APT::Status-Fd=3 msgtest "Ensure correct error message" -grep -q "aptarchive/pool/foo2_0.8.15_amd64.deb :40:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log && msgpass || (cat apt-progress.log && msgfail) +if grep -q "aptarchive/pool/foo2_0.8.15_amd64.deb:40:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log; then + msgpass +else + cat apt-progress.log + msgfail +fi -- cgit v1.2.3 From 4c559e97ba4cc0d3a2995b7c451e606539d2f1be Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 8 Sep 2014 17:14:17 +0200 Subject: fix progress report for upgrade and reinstall APT treats upgrades like installs and dpkg is very similar in this, but prints still a slightly different processing message indicating that it is really an upgrade which we hadn't parsed so far, but this wasn't really visible as we quickly moved on to a 'known' state. More problematic was the reinstall case as apt hadn't recognized this for the package name detection, so that reinstalls had no progress since we introduced MultiArch. --- test/integration/test-apt-progress-fd | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test') diff --git a/test/integration/test-apt-progress-fd b/test/integration/test-apt-progress-fd index 9d250e949..d72e7e72d 100755 --- a/test/integration/test-apt-progress-fd +++ b/test/integration/test-apt-progress-fd @@ -33,6 +33,22 @@ testsuccess aptget install testing=0.8.15 -y -o APT::Status-Fd=3 testequal "dlstatus:1:0:Retrieving file 1 of 1 dlstatus:1:0:Retrieving file 1 of 1 pmstatus:dpkg-exec:0:Running dpkg +pmstatus:testing:0:Installing testing (amd64) +pmstatus:testing:20:Preparing testing (amd64) +pmstatus:testing:40:Unpacking testing (amd64) +pmstatus:testing:60:Preparing to configure testing (amd64) +pmstatus:dpkg-exec:60:Running dpkg +pmstatus:testing:60:Configuring testing (amd64) +pmstatus:testing:80:Configuring testing (amd64) +pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log + +# reinstall +exec 3> apt-progress.log +testsuccess aptget install testing=0.8.15 --reinstall -y -o APT::Status-Fd=3 +testequal "dlstatus:1:0:Retrieving file 1 of 1 +dlstatus:1:0:Retrieving file 1 of 1 +pmstatus:dpkg-exec:0:Running dpkg +pmstatus:testing:0:Installing testing (amd64) pmstatus:testing:20:Preparing testing (amd64) pmstatus:testing:40:Unpacking testing (amd64) pmstatus:testing:60:Preparing to configure testing (amd64) -- cgit v1.2.3 From 22da5c135a74eee8ed998806136e25b8ed038bd0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 9 Sep 2014 13:52:32 +0200 Subject: don't call pager in non-terminals for changelog Most pagers are nice and default to running non-interactively if they aren't connected to a terminal and we relied on that. On ci.debian.net the configured pager is printing a header out of nowhere though, so if we are printing to a non-terminal we call "cat" instead. In the rework we also "remove" the dependency on sensible-utils in sofar as we call some alternatives if calling the utils fail. This seems to be the last problem preventing a "PASS" status on ci.debian.net, so we close the associated bugreport. Closes: 755040 --- test/integration/test-apt-get-changelog | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/integration/test-apt-get-changelog b/test/integration/test-apt-get-changelog index a73c3e249..4ee113482 100755 --- a/test/integration/test-apt-get-changelog +++ b/test/integration/test-apt-get-changelog @@ -28,9 +28,8 @@ testsuccess aptget changelog apt -d testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0/changelog)" rm apt.changelog aptarchive/pool/apt_1.0/changelog -aptget changelog apt -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/' > apt.changelog -testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0.changelog)" -rm apt.changelog +testequal "$(cat aptarchive/pool/apt_1.0.changelog)" aptget changelog apt \ + -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/' testsuccess aptget changelog apt -d testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0.changelog)" -- cgit v1.2.3 From ca7fd76c2f30c100dcf1c12e717ce397cccd690b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 16 Sep 2014 20:23:43 +0200 Subject: SECURITY UPDATE for CVE-2014-{0488,0487,0489} incorrect invalidating of unauthenticated data (CVE-2014-0488) incorect verification of 304 reply (CVE-2014-0487) incorrect verification of Acquire::Gzip indexes (CVE-2014-0489) --- test/integration/test-apt-update-stale | 46 ++++++++++++++++++++++++++++ test/integration/test-apt-update-unauth | 48 ++++++++++++++++++++++++++++++ test/integration/test-hashsum-verification | 14 +++++++-- 3 files changed, 105 insertions(+), 3 deletions(-) create mode 100755 test/integration/test-apt-update-stale create mode 100755 test/integration/test-apt-update-unauth (limited to 'test') diff --git a/test/integration/test-apt-update-stale b/test/integration/test-apt-update-stale new file mode 100755 index 000000000..780ff79af --- /dev/null +++ b/test/integration/test-apt-update-stale @@ -0,0 +1,46 @@ +#!/bin/sh +# +# Ensure that a MITM can not stale the Packages/Sources without +# raising a error message. Note that the Release file is protected +# via the "Valid-Until" header +# +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture "i386" + +insertpackage 'unstable' 'foo' 'all' '1.0' + +setupaptarchive +changetowebserver +aptget update -qq + +# insert new version +mkdir aptarchive/dists/unstable/main/binary-i386/saved +cp -p aptarchive/dists/unstable/main/binary-i386/Packages* \ + aptarchive/dists/unstable/main/binary-i386/saved +insertpackage 'unstable' 'foo' 'all' '2.0' + +# not using compressfile for compat with older apt releases +gzip -c aptarchive/dists/unstable/main/binary-i386/Packages > \ + aptarchive/dists/unstable/main/binary-i386/Packages.gz +generatereleasefiles +signreleasefiles + +# ensure that we do not get a I-M-S hit for the Release file +touch -d "+1hour" aptarchive/dists/unstable/*Release* + +# but now only deliver the previous Packages file instead of the new one +# (simulating a stale attack) +cp -p aptarchive/dists/unstable/main/binary-i386/saved/Packages* \ + aptarchive/dists/unstable/main/binary-i386/ + +# ensure this raises a error +testequal "W: Failed to fetch http://localhost:8080/dists/unstable/main/binary-i386/Packages Hash Sum mismatch + +E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq + + diff --git a/test/integration/test-apt-update-unauth b/test/integration/test-apt-update-unauth new file mode 100755 index 000000000..13487603c --- /dev/null +++ b/test/integration/test-apt-update-unauth @@ -0,0 +1,48 @@ +#!/bin/sh +# +# Ensure that when going from unauthenticated to authenticated all +# files are checked again +# +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture "i386" + +insertpackage 'unstable' 'foo' 'all' '1.0' +insertsource 'unstable' 'foo' 'all' '1.0' + +setupaptarchive +changetowebserver + +runtest() { + # start unauthenticated + find rootdir/var/lib/apt/lists/ -type f | xargs rm -f + rm -f aptarchive/dists/unstable/*Release* + aptget update -qq + + # become authenticated + generatereleasefiles + signreleasefiles + + # and ensure we do download the data again + msgtest "Check that the data is check when going to authenticated" + if aptget update |grep -q Hit; then + msgfail + else + msgpass + fi +} + +for COMPRESSEDINDEXES in 'false' 'true'; do + echo "Acquire::GzipIndexes \"$COMPRESSEDINDEXES\";" > rootdir/etc/apt/apt.conf.d/compressindexes + if $COMPRESSEDINDEXES; then + msgmsg 'Run tests with GzipIndexes enabled' + else + msgmsg 'Run tests with GzipIndexes disabled' + fi + + runtest +done diff --git a/test/integration/test-hashsum-verification b/test/integration/test-hashsum-verification index e77efb46e..2a400dcb4 100755 --- a/test/integration/test-hashsum-verification +++ b/test/integration/test-hashsum-verification @@ -64,7 +64,7 @@ runtest() { msgtest 'No package from the source available' [ "$(aptcache show apt 2>&1)" = "E: No packages found" ] && msgpass || msgfail msgtest 'No Packages file in /var/lib/apt/lists' - [ "$(ls rootdir/var/lib/apt/lists/*Package* 2>/dev/null)" = "" ] && msgpass || msgfail + [ "$(ls rootdir/var/lib/apt/lists/*Package* 2>/dev/null | grep -v FAILED 2>/dev/null)" = "" ] && msgpass || msgfail # now with the unsigned Release file rm -rf rootdir/var/lib/apt/lists @@ -75,5 +75,13 @@ runtest() { } -runtest - +for COMPRESSEDINDEXES in 'false' 'true'; do + echo "Acquire::GzipIndexes \"$COMPRESSEDINDEXES\";" > rootdir/etc/apt/apt.conf.d/compressindexes + if $COMPRESSEDINDEXES; then + msgmsg 'Run tests with GzipIndexes enabled' + else + msgmsg 'Run tests with GzipIndexes disabled' + fi + + runtest +done -- cgit v1.2.3 From daff4aa356128310f022370f7825bdc369c66ba8 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 17 Sep 2014 14:57:05 +0200 Subject: Fix regression for file:/// uris from CVE-2014-0487 Do not run ReverifyAfterIMS() for local file URIs as this will causes apt to mess around in the file:/// uri space. This is wrong in itself, but it will also cause a incorrect verification failure when the archive and the lists directory are on different partitions as rename(). --- test/integration/test-apt-update-file | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 test/integration/test-apt-update-file (limited to 'test') diff --git a/test/integration/test-apt-update-file b/test/integration/test-apt-update-file new file mode 100755 index 000000000..069f8ba2f --- /dev/null +++ b/test/integration/test-apt-update-file @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Ensure that we do not modify file:/// uris (regression test for +# CVE-2014-0487 +# +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture "amd64" +configcompression 'bz2' 'gz' + +insertpackage 'unstable' 'foo' 'all' '1.0' + +umask 022 +setupaptarchive --no-update + +# ensure the archive is not writable +chmod 550 aptarchive/dists/unstable/main/binary-amd64 + +testsuccess aptget update -qq +testsuccess aptget update -qq + +# the cleanup should still work +chmod 750 aptarchive/dists/unstable/main/binary-amd64 -- cgit v1.2.3 From 23d0a6fbee9e8880107481502e14411961c44a7b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 17 Sep 2014 17:48:27 +0200 Subject: improve test for commit daff4a --- test/integration/test-apt-update-file | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') diff --git a/test/integration/test-apt-update-file b/test/integration/test-apt-update-file index 069f8ba2f..e267c71da 100755 --- a/test/integration/test-apt-update-file +++ b/test/integration/test-apt-update-file @@ -22,6 +22,13 @@ chmod 550 aptarchive/dists/unstable/main/binary-amd64 testsuccess aptget update -qq testsuccess aptget update -qq +aptget update -qq -o Debug::pkgAcquire::Auth=1 2> output.log + +# ensure that the hash of the uncompressed file was verified even on a local +# ims hit +canary="SHA512:$(bzcat aptarchive/dists/unstable/main/binary-amd64/Packages.bz2 | sha512sum |cut -f1 -d' ')" +grep -q "RecivedHash: $canary" output.log + # the cleanup should still work chmod 750 aptarchive/dists/unstable/main/binary-amd64 -- cgit v1.2.3 From 8b451962751298876d1f399e4de492d8adbb135a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 19 Sep 2014 16:41:50 +0200 Subject: test/integration/test-apt-update-file: improve test --- test/integration/test-apt-update-file | 2 ++ test/integration/test-bug-762160-relpath | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 test/integration/test-bug-762160-relpath (limited to 'test') diff --git a/test/integration/test-apt-update-file b/test/integration/test-apt-update-file index e267c71da..fbcd473cc 100755 --- a/test/integration/test-apt-update-file +++ b/test/integration/test-apt-update-file @@ -29,6 +29,8 @@ aptget update -qq -o Debug::pkgAcquire::Auth=1 2> output.log canary="SHA512:$(bzcat aptarchive/dists/unstable/main/binary-amd64/Packages.bz2 | sha512sum |cut -f1 -d' ')" grep -q "RecivedHash: $canary" output.log +# foo is still available +testsuccess aptget install -s foo # the cleanup should still work chmod 750 aptarchive/dists/unstable/main/binary-amd64 diff --git a/test/integration/test-bug-762160-relpath b/test/integration/test-bug-762160-relpath new file mode 100755 index 000000000..0af71f57b --- /dev/null +++ b/test/integration/test-bug-762160-relpath @@ -0,0 +1,15 @@ +#!/bin/sh +set -e + +# dpkg implements versioned provides in commit 5bb02fe80e9f40dcad9703a72f67cf615ff217b5 +# but previous versions seem to allow parsing, working and ignoring it. + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +insertpackage 'unstable' 'foo' 'all' '1' +setupaptarchive + +aptget update -o Dir=./apt -- cgit v1.2.3 From 9da539c5aff025aab99537be1c75e8c6a853fd83 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 19 Sep 2014 16:41:55 +0200 Subject: Fix regression when copy: is used for a relative path When we do a ReverifyAfterIMS() we use the copy: method to verify the hashes again. If the user uses -o Dir=./something/relative this fails because we use the URI class in copy.cc that strips away the leading relative part. By not using URI this is fixed. Closes: #762160 --- test/integration/test-bug-762160-relpath | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/integration/test-bug-762160-relpath b/test/integration/test-bug-762160-relpath index 0af71f57b..204587727 100755 --- a/test/integration/test-bug-762160-relpath +++ b/test/integration/test-bug-762160-relpath @@ -1,9 +1,9 @@ #!/bin/sh +# regresion test for bug #762160 where apt-get update fails when a +# relative directory is given +# set -e -# dpkg implements versioned provides in commit 5bb02fe80e9f40dcad9703a72f67cf615ff217b5 -# but previous versions seem to allow parsing, working and ignoring it. - TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment @@ -11,5 +11,7 @@ configarchitecture 'amd64' insertpackage 'unstable' 'foo' 'all' '1' setupaptarchive +changetowebserver -aptget update -o Dir=./apt +testsuccess aptget update -o Dir=./rootdir +testsuccess aptget update -o Dir=./rootdir \ No newline at end of file -- cgit v1.2.3 From 2bd6be8ad24583ed9935f5c5d57c04ba7344111e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 20 Sep 2014 00:12:13 +0200 Subject: relax grep to support newer curl output format Git-Dch: Ignore --- test/integration/test-apt-https-no-redirect | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/integration/test-apt-https-no-redirect b/test/integration/test-apt-https-no-redirect index 73352a28c..bc744d6f2 100755 --- a/test/integration/test-apt-https-no-redirect +++ b/test/integration/test-apt-https-no-redirect @@ -25,6 +25,11 @@ msgtest 'download of a file does not work if' 'https redirected to http' downloadfile 'https://localhost:4433/redirectme/working' redirectfile >curloutput 2>&1 && msgfail || msgpass msgtest 'libcurl has forbidden access in last request to' 'http resource' -grep -q -- 'Protocol http not supported or disabled in libcurl' curloutput && msgpass || msgfail +if grep -q -E -- 'Protocol "?http"? not supported or disabled in libcurl' curloutput; then + msgpass +else + cat curloutput + msgfail +fi -- cgit v1.2.3