]> git.saurik.com Git - apt.git/blobdiff - test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted
treat .ddeb files like .deb, especially for dpkg
[apt.git] / test / integration / test-bug-617690-allow-unauthenticated-makes-all-untrusted
index 276e10564fcfbfcc54721859dc09ac5c16ed160f..533cf771fba085e9ba0eae22f3dab94106de2e3a 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/sh
 set -e
 
 #!/bin/sh
 set -e
 
-TESTDIR=$(readlink -f $(dirname $0))
-. $TESTDIR/framework
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
 setupenvironment
 configarchitecture 'i386'
 
 setupenvironment
 configarchitecture 'i386'
 
@@ -17,16 +17,17 @@ testfileexists() {
 }
 
 testfilemissing() {
 }
 
 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
        test -e "$1" && msgfail || msgpass
        rm -f "$1"
 }
 
 testrun() {
        rm -rf rootdir/var/lib/apt
+       cd downloaded
 
        if [ "$1" = 'trusted' ]; then
 
        if [ "$1" = 'trusted' ]; then
-           testsuccess aptget update
+               testsuccess aptget update
 
                testsuccess aptget download cool
                testfileexists 'cool_1.0_i386.deb'
 
                testsuccess aptget download cool
                testfileexists 'cool_1.0_i386.deb'
@@ -34,7 +35,7 @@ testrun() {
                testsuccess aptget download cool --allow-unauthenticated
                testfileexists 'cool_1.0_i386.deb'
        else
                testsuccess aptget download cool --allow-unauthenticated
                testfileexists 'cool_1.0_i386.deb'
        else
-           testsuccess aptget update --allow-unauthenticated
+                testwarning aptget update --allow-insecure-repositories
 
                testfailure aptget download cool
                testfilemissing 'cool_1.0_i386.deb'
 
                testfailure aptget download cool
                testfilemissing 'cool_1.0_i386.deb'
@@ -43,18 +44,19 @@ testrun() {
                testfileexists 'cool_1.0_i386.deb'
        fi
 
                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
 
        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'
        testsuccess aptget download cool --allow-unauthenticated
        testfileexists 'cool_1.0_i386.deb'
+       cd - >/dev/null
 }
 
 testrun 'trusted'
 }
 
 testrun 'trusted'