summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-bug-596498-trusted-unsigned-repo8
-rwxr-xr-xtest/integration/test-sourceslist-trusted-options17
2 files changed, 21 insertions, 4 deletions
diff --git a/test/integration/test-bug-596498-trusted-unsigned-repo b/test/integration/test-bug-596498-trusted-unsigned-repo
index 1ff0f1d8d..c515837a3 100755
--- a/test/integration/test-bug-596498-trusted-unsigned-repo
+++ b/test/integration/test-bug-596498-trusted-unsigned-repo
@@ -18,7 +18,7 @@ aptgetupdate() {
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-deb.list'
+DEBFILE='rootdir/etc/apt/sources.list.d/apt-test-unstable-*.list'
testsuccessequal "$PKGTEXT
$DOWNLOG
@@ -28,7 +28,7 @@ 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
+sed -i -e 's#\(deb\(-src\)\?\) #\1 [trusted=no] #' $DEBFILE
aptgetupdate 'testsuccess'
testfailureequal "$PKGTEXT
@@ -38,7 +38,7 @@ 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
testfailureequal "$PKGTEXT
@@ -54,7 +54,7 @@ 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
testsuccessequal "$PKGTEXT
diff --git a/test/integration/test-sourceslist-trusted-options b/test/integration/test-sourceslist-trusted-options
index 5fe4933ce..86036e242 100755
--- a/test/integration/test-sourceslist-trusted-options
+++ b/test/integration/test-sourceslist-trusted-options
@@ -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'