diff options
author | Michael Vogt <mvo@debian.org> | 2014-02-27 22:52:34 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-02-27 22:52:34 +0100 |
commit | fce69e7a0f38299c57ef96ae1c1dd9a5379bfd5a (patch) | |
tree | be7d18baa836e9df166ec63f6c9fe6f94bb84b40 /test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted | |
parent | a5e790985752c6820e08e7a7e650e1607fa826e4 (diff) | |
parent | fc104da6a583736223b2f941e43a05ea26b63a7d (diff) |
Merge branch 'debian/sid' into debian/experimental
Conflicts:
apt-private/private-list.cc
configure.ac
debian/apt.install.in
debian/changelog
Diffstat (limited to 'test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted')
-rwxr-xr-x | test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted b/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted new file mode 100755 index 000000000..f93510fd7 --- /dev/null +++ b/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted @@ -0,0 +1,63 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' + +buildsimplenativepackage 'cool' 'i386' '1.0' 'unstable' + +setupaptarchive --no-update + +testfileexists() { + msgtest 'Test for existence of file' "$1" + test -e "$1" && msgpass || msgfail + rm -f "$1" +} + +testfilemissing() { + msgtest 'Test for non-existance of file' "$1" + test -e "$1" && msgfail || msgpass + rm -f "$1" +} + +testrun() { + rm -rf rootdir/var/lib/apt + testsuccess aptget update + + if [ "$1" = 'trusted' ]; then + testsuccess aptget download cool + testfileexists 'cool_1.0_i386.deb' + + testsuccess aptget download cool --allow-unauthenticated + testfileexists 'cool_1.0_i386.deb' + else + testfailure aptget download cool + testfilemissing 'cool_1.0_i386.deb' + + testsuccess aptget download cool --allow-unauthenticated + testfileexists 'cool_1.0_i386.deb' + fi + + mv aptarchive/pool/cool_1.0_i386.deb aptarchive/pool/cool_1.0_i386.deb.bak + echo 'this is not a good package' > aptarchive/pool/cool_1.0_i386.deb + testfailure aptget download cool + testfilemissing cool_1.0_i386.deb + + testfailure aptget download cool --allow-unauthenticated # unauthenticated doesn't mean unchecked + testfilemissing cool_1.0_i386.deb + + rm -f aptarchive/pool/cool_1.0_i386.deb + mv aptarchive/pool/cool_1.0_i386.deb.bak aptarchive/pool/cool_1.0_i386.deb + testsuccess aptget download cool --allow-unauthenticated + testfileexists 'cool_1.0_i386.deb' +} + +testrun 'trusted' + +find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete +testrun 'untrusted' + +changetowebserver +testrun 'untrusted' |