]> git.saurik.com Git - apt.git/blobdiff - test/integration/test-sourceslist-trusted-options
Ensure that no by-hash file for "Release/InRelease is written"
[apt.git] / test / integration / test-sourceslist-trusted-options
index 55d4e0233a765fad3831be407c0d25486365d956..86036e2427351fac78d40bb40be9ea121945b804 100755 (executable)
@@ -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
@@ -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 concerning 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'