From 851b6a097165af4d51c0db01b5e05256e5006896 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:00:48 +0200 Subject: Adding upstream version 2.6.1. Signed-off-by: Daniel Baumann --- ...17690-allow-unauthenticated-makes-all-untrusted | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100755 test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted (limited to 'test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted') 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 0000000..533cf77 --- /dev/null +++ b/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted @@ -0,0 +1,68 @@ +#!/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-existence of file' "$1" + test -e "$1" && msgfail || msgpass + rm -f "$1" +} + +testrun() { + rm -rf rootdir/var/lib/apt + cd downloaded + + if [ "$1" = 'trusted' ]; then + testsuccess aptget update + + testsuccess aptget download cool + testfileexists 'cool_1.0_i386.deb' + + testsuccess aptget download cool --allow-unauthenticated + testfileexists 'cool_1.0_i386.deb' + else + testwarning aptget update --allow-insecure-repositories + + 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' + cd - >/dev/null +} + +testrun 'trusted' + +find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete +testrun 'untrusted' + +changetowebserver +testrun 'untrusted' -- cgit v1.2.3