X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/d61960d9244340956a27f4ca46aecd15cc75e18b..ab5b1d0d31b2fbdc4896f8a107611ff056d6a668:/test/integration/test-sourceslist-trusted-options

diff --git a/test/integration/test-sourceslist-trusted-options b/test/integration/test-sourceslist-trusted-options
index 55d4e0233..26de76807 100755
--- a/test/integration/test-sourceslist-trusted-options
+++ b/test/integration/test-sourceslist-trusted-options
@@ -15,7 +15,7 @@ setupaptarchive --no-update
 APTARCHIVE=$(readlink -f ./aptarchive)
 
 everythingsucceeds() {
-	testequal 'Listing...
+	testsuccessequal 'Listing...
 foo/testing 2 amd64
 foo/stable 1 amd64
 ' apt list foo -a
@@ -32,7 +32,7 @@ foo/stable 1 amd64
 }
 
 everythingfails() {
-	testequal 'Listing...
+	testsuccessequal 'Listing...
 foo/testing 2 amd64
 foo/stable 1 amd64
 ' apt list foo -a
@@ -109,7 +109,7 @@ everythingsucceeds -t testing
 msgmsg 'Test with trusted=yes option and good and unsigned sources'
 cp -a rootdir/etc/apt/sources.list.d.bak/* rootdir/etc/apt/sources.list.d/
 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=yes] #' rootdir/etc/apt/sources.list.d/*
-aptgetupdate 'testwarning'
+aptgetupdate
 everythingsucceeds
 everythingsucceeds -t stable
 everythingsucceeds -t testing
@@ -187,7 +187,7 @@ everythingfails -t testing
 msgmsg 'Test with trusted=yes option and unsigned and good sources'
 cp -a rootdir/etc/apt/sources.list.d.bak/* rootdir/etc/apt/sources.list.d/
 sed -i 's#^deb\(-src\)\? #deb\1 [trusted=yes] #' rootdir/etc/apt/sources.list.d/*
-aptgetupdate 'testwarning'
+aptgetupdate
 everythingsucceeds
 everythingsucceeds -t stable
 everythingsucceeds -t testing
@@ -199,3 +199,20 @@ insecureaptgetupdate
 everythingfails
 everythingfails -t stable
 everythingfails -t testing
+
+msgmsg 'Test conflicting trusted options are refused'
+testsource() {
+	echo "$@" > rootdir/etc/apt/sources.list.d/example.list
+	testfailuremsg 'E: Conflicting values set for option Trusted regarding source http://example.org/bad/ unstable
+E: The list of sources could not be read.' aptget update --print-uris
+}
+for VAL in 'yes' 'no'; do
+	testsource "deb http://example.org/bad unstable main
+deb [trusted=${VAL}] http://example.org/bad unstable non-free"
+	testsource "deb [trusted=${VAL}] http://example.org/bad unstable main
+deb http://example.org/bad unstable non-free"
+done
+testsource 'deb [trusted=yes] http://example.org/bad unstable main
+deb [trusted=no] http://example.org/bad unstable non-free'
+testsource 'deb [trusted=no] http://example.org/bad unstable main
+deb [trusted=yes] http://example.org/bad unstable non-free'