summaryrefslogtreecommitdiffstats
path: root/test/integration/test-bug-596498-trusted-unsigned-repo
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 18:07:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 18:07:13 +0000
commit636c7dc17286d93d788c741d15fd756aeda066d5 (patch)
treee7ae158cc54f591041a061b9865bcae51854f15c /test/integration/test-bug-596498-trusted-unsigned-repo
parentInitial commit. (diff)
downloadapt-upstream/1.8.2.3.tar.xz
apt-upstream/1.8.2.3.zip
Adding upstream version 1.8.2.3.upstream/1.8.2.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/test-bug-596498-trusted-unsigned-repo')
-rwxr-xr-xtest/integration/test-bug-596498-trusted-unsigned-repo75
1 files changed, 75 insertions, 0 deletions
diff --git a/test/integration/test-bug-596498-trusted-unsigned-repo b/test/integration/test-bug-596498-trusted-unsigned-repo
new file mode 100755
index 0000000..4d0e3dc
--- /dev/null
+++ b/test/integration/test-bug-596498-trusted-unsigned-repo
@@ -0,0 +1,75 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+setupenvironment
+configarchitecture 'i386'
+
+buildsimplenativepackage 'cool' 'i386' '1.0' 'unstable'
+
+msgmsg 'default setup'
+setupaptarchive
+
+aptgetupdate() {
+ rm -rf rootdir/var/lib/apt/ rootdir/var/cache/apt/*.bin
+ ${1:-testwarning} aptget update --allow-insecure-repositories
+}
+
+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-*.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
+
+msgmsg 'sources marked trusted=no'
+sed -i -e 's#\(deb\(-src\)\?\) #\1 [trusted=no] #' $DEBFILE
+aptgetupdate 'testsuccess'
+
+testfailureequal "$PKGTEXT
+WARNING: The following packages cannot be authenticated!
+ cool
+Install these packages without verification? [y/N] N
+E: Some packages could not be authenticated" aptget install cool --assume-no -d
+
+configarchitecture 'amd64' 'i386'
+testequal "$(echo "$PKGTEXT" | sed 's#cool$#cool:i386#g')
+WARNING: The following packages cannot be authenticated!
+ cool:i386
+Authentication warning overridden.
+$DOWNLOG
+Download complete and in download only mode" aptget install cool:i386 --assume-no -d --allow-unauthenticated
+configarchitecture 'i386'
+
+find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete
+msgmsg 'unsigned repo'
+sed -i -e 's#\(deb\(-src\)\?\) \[trusted=no\] #\1 #' $DEBFILE
+aptgetupdate
+
+testfailureequal "$PKGTEXT
+WARNING: The following packages cannot be authenticated!
+ cool
+Install these packages without verification? [y/N] N
+E: Some packages could not be authenticated" aptget install cool --assume-no -d
+
+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
+
+msgmsg 'sources marked trusted=yes'
+sed -i -e 's#\(deb\(-src\)\?\) #\1 [trusted=yes] #' $DEBFILE
+aptgetupdate 'testsuccess'
+
+testsuccessequal "$PKGTEXT
+$DOWNLOG
+Download complete and in download only mode" aptget install cool --assume-no -d