X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/0977f81757f42889a9edb761061529041afe0a06..c1642be522a9d9cf5a4a9f2dd8794cfaf0264fb5:/test/integration/test-bug-596498-trusted-unsigned-repo

diff --git a/test/integration/test-bug-596498-trusted-unsigned-repo b/test/integration/test-bug-596498-trusted-unsigned-repo
index a08c153f8..c515837a3 100755
--- a/test/integration/test-bug-596498-trusted-unsigned-repo
+++ b/test/integration/test-bug-596498-trusted-unsigned-repo
@@ -12,45 +12,51 @@ setupaptarchive
 
 aptgetupdate() {
 	rm -rf rootdir/var/lib/apt/ rootdir/var/cache/apt/*.bin
-	testsuccess aptget update --allow-insecure-repositories
+	${1:-testwarning} aptget update --allow-insecure-repositories
 }
 
-PKGTEXT="$(aptget install cool --assume-no -d | head -n 7)"
-DEBFILE='rootdir/etc/apt/sources.list.d/apt-test-unstable-deb.list'
+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'
 
-testequal "$PKGTEXT
+testsuccessequal "$PKGTEXT
+$DOWNLOG
 Download complete and in download only mode" aptget install cool --assume-no -d
 
-testequal "$PKGTEXT
+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
-aptgetupdate
+sed -i -e 's#\(deb\(-src\)\?\) #\1 [trusted=no] #' $DEBFILE
+aptgetupdate 'testsuccess'
 
-testequal "$PKGTEXT
+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
 
 find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete
-sed -i -e 's#deb \[trusted=no\]#deb#' $DEBFILE
+sed -i -e 's#\(deb\(-src\)\?\) \[trusted=no\] #\1 #' $DEBFILE
 aptgetupdate
 
-testequal "$PKGTEXT
+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
 
-testequal "$PKGTEXT
+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
+sed -i -e 's#\(deb\(-src\)\?\) #\1 [trusted=yes] #' $DEBFILE
 aptgetupdate
 
-testequal "$PKGTEXT
+testsuccessequal "$PKGTEXT
+$DOWNLOG
 Download complete and in download only mode" aptget install cool --assume-no -d