X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/649d3c5b7df830a67ad946921233da349c13a826..dabe9e2482180ada77d2adda2b3c03db22059fb8:/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted?ds=sidebyside

diff --git a/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted b/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted
index 633c197c0..533cf771f 100755
--- a/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted
+++ b/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted
@@ -1,8 +1,8 @@
 #!/bin/sh
 set -e
 
-TESTDIR=$(readlink -f $(dirname $0))
-. $TESTDIR/framework
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
 setupenvironment
 configarchitecture 'i386'
 
@@ -11,28 +11,32 @@ buildsimplenativepackage 'cool' 'i386' '1.0' 'unstable'
 setupaptarchive --no-update
 
 testfileexists() {
-	msgtest 'Test for existance of file' "$1"
+	msgtest 'Test for existence of file' "$1"
 	test -e "$1" && msgpass || msgfail
 	rm -f "$1"
 }
 
 testfilemissing() {
-	msgtest 'Test for non-existance of file' "$1"
+	msgtest 'Test for non-existence of file' "$1"
 	test -e "$1" && msgfail || msgpass
 	rm -f "$1"
 }
 
 testrun() {
 	rm -rf rootdir/var/lib/apt
-	testsuccess aptget update
+	cd downloaded
 
 	if [ "$1" = 'trusted' ]; then
+	        testsuccess aptget update
+
 		testsuccess aptget download cool
 		testfileexists 'cool_1.0_i386.deb'
 
 		testsuccess aptget download cool --allow-unauthenticated
 		testfileexists 'cool_1.0_i386.deb'
 	else
+                testwarning aptget update --allow-insecure-repositories
+
 		testfailure aptget download cool
 		testfilemissing 'cool_1.0_i386.deb'
 
@@ -40,18 +44,19 @@ testrun() {
 		testfileexists 'cool_1.0_i386.deb'
 	fi
 
-	mv aptarchive/pool/cool_1.0_i386.deb aptarchive/pool/cool_1.0_i386.deb.bak
-	echo 'this is not a good package' > aptarchive/pool/cool_1.0_i386.deb
+	mv ../aptarchive/pool/cool_1.0_i386.deb ../aptarchive/pool/cool_1.0_i386.deb.bak
+	echo 'this is not a good package' > ../aptarchive/pool/cool_1.0_i386.deb
 	testfailure aptget download cool
 	testfilemissing cool_1.0_i386.deb
 
 	testfailure aptget download cool --allow-unauthenticated  # unauthenticated doesn't mean unchecked
 	testfilemissing cool_1.0_i386.deb
 
-	rm -f aptarchive/pool/cool_1.0_i386.deb
-	mv aptarchive/pool/cool_1.0_i386.deb.bak aptarchive/pool/cool_1.0_i386.deb
+	rm -f ../aptarchive/pool/cool_1.0_i386.deb
+	mv ../aptarchive/pool/cool_1.0_i386.deb.bak ../aptarchive/pool/cool_1.0_i386.deb
 	testsuccess aptget download cool --allow-unauthenticated
 	testfileexists 'cool_1.0_i386.deb'
+	cd - >/dev/null
 }
 
 testrun 'trusted'