]> git.saurik.com Git - apt.git/blobdiff - test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum
parse version correctly from binary Source field
[apt.git] / test / integration / test-ubuntu-bug-1098738-apt-get-source-md5sum
index f286f5650434360d312541e74db0beb5806e282a..f030a03dc78ca8cc9586588f6bf423d3c2d1d606 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/sh
 set -e
 
-TESTDIR=$(readlink -f $(dirname $0))
-. $TESTDIR/framework
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
 
 setupenvironment
 configarchitecture 'native'
@@ -158,8 +158,8 @@ testok() {
        testsuccessequal "Reading package lists...
 Building dependency tree...
 Need to get 6 B of source archives.
-Get:1 http://localhost:8080  $1 1.0 (dsc) [3 B]
-Get:2 http://localhost:8080  $1 1.0 (tar) [3 B]
+Get:1 http://localhost:${APTHTTPPORT}  $1 1.0 (dsc) [3 B]
+Get:2 http://localhost:${APTHTTPPORT}  $1 1.0 (tar) [3 B]
 Download complete and in download only mode" aptget source -d "$@"
        msgtest 'Files were successfully downloaded for' "$1"
        testsuccess --nomsg test -e ${1}_1.0.dsc -a -e ${1}_1.0.tar.gz
@@ -198,15 +198,15 @@ testmismatch() {
        testfailureequal "Reading package lists...
 Building dependency tree...
 Need to get 6 B of source archives.
-Get:1 http://localhost:8080  $1 1.0 (dsc) [3 B]
-Err:1 http://localhost:8080  $1 1.0 (dsc)
+Get:1 http://localhost:${APTHTTPPORT}  $1 1.0 (dsc) [3 B]
+Err:1 http://localhost:${APTHTTPPORT}  $1 1.0 (dsc)
   Hash Sum mismatch
-Get:2 http://localhost:8080  $1 1.0 (tar) [3 B]
-Err:2 http://localhost:8080  $1 1.0 (tar)
+Get:2 http://localhost:${APTHTTPPORT}  $1 1.0 (tar) [3 B]
+Err:2 http://localhost:${APTHTTPPORT}  $1 1.0 (tar)
   Hash Sum mismatch
-E: Failed to fetch http://localhost:8080/${1}_1.0.dsc  Hash Sum mismatch
+E: Failed to fetch http://localhost:${APTHTTPPORT}/${1}_1.0.dsc  Hash Sum mismatch
 
-E: Failed to fetch http://localhost:8080/${1}_1.0.tar.gz  Hash Sum mismatch
+E: Failed to fetch http://localhost:${APTHTTPPORT}/${1}_1.0.tar.gz  Hash Sum mismatch
 
 E: Failed to fetch some archives." aptget source -d "$@"
        msgtest 'Files were not download as they have hashsum mismatches for' "$1"
@@ -228,8 +228,8 @@ Download complete and in download only mode" aptget source -d "$@" -o Acquire::F
        testsuccessequal "Reading package lists...
 Building dependency tree...
 Need to get 6 B of source archives.
-Get:1 http://localhost:8080  $1 1.0 (dsc) [3 B]
-Get:2 http://localhost:8080  $1 1.0 (tar) [3 B]
+Get:1 http://localhost:${APTHTTPPORT}  $1 1.0 (dsc) [3 B]
+Get:2 http://localhost:${APTHTTPPORT}  $1 1.0 (tar) [3 B]
 Download complete and in download only mode" aptget source --allow-unauthenticated -d "$@" -o Acquire::ForceHash=ROT26
        msgtest 'Files were downloaded unauthenticated as user allowed it' "$1"
        testsuccess --nomsg test -e ${1}_1.0.dsc -a -e ${1}_1.0.tar.gz
@@ -263,28 +263,28 @@ testfailure --nomsg test -e pkg-no-md5_1.0.dsc -a -e pkg-no-md5_1.0.tar.gz
 # deal with cases in which we haven't for all files the same checksum type
 # mostly pathologic as this shouldn't happen, but just to be sure
 testok pkg-mixed-ok
-testfailureequal 'Reading package lists...
+testfailureequal "Reading package lists...
 Building dependency tree...
 Need to get 6 B of source archives.
-Get:1 http://localhost:8080  pkg-mixed-sha1-bad 1.0 (tar) [3 B]
-Get:2 http://localhost:8080  pkg-mixed-sha1-bad 1.0 (dsc) [3 B]
-Err:2 http://localhost:8080  pkg-mixed-sha1-bad 1.0 (dsc)
+Get:1 http://localhost:${APTHTTPPORT}  pkg-mixed-sha1-bad 1.0 (tar) [3 B]
+Get:2 http://localhost:${APTHTTPPORT}  pkg-mixed-sha1-bad 1.0 (dsc) [3 B]
+Err:2 http://localhost:${APTHTTPPORT}  pkg-mixed-sha1-bad 1.0 (dsc)
   Hash Sum mismatch
-E: Failed to fetch http://localhost:8080/pkg-mixed-sha1-bad_1.0.dsc  Hash Sum mismatch
+E: Failed to fetch http://localhost:${APTHTTPPORT}/pkg-mixed-sha1-bad_1.0.dsc  Hash Sum mismatch
 
-E: Failed to fetch some archives.' aptget source -d pkg-mixed-sha1-bad
+E: Failed to fetch some archives." aptget source -d pkg-mixed-sha1-bad
 msgtest 'Only tar file is downloaded as the dsc has hashsum mismatch' 'pkg-mixed-sha1-bad'
 testsuccess --nomsg test ! -e pkg-mixed-sha1-bad_1.0.dsc -a -e pkg-mixed-sha1-bad_1.0.tar.gz
-testfailureequal 'Reading package lists...
+testfailureequal "Reading package lists...
 Building dependency tree...
 Need to get 6 B of source archives.
-Get:1 http://localhost:8080  pkg-mixed-sha2-bad 1.0 (tar) [3 B]
-Err:1 http://localhost:8080  pkg-mixed-sha2-bad 1.0 (tar)
+Get:1 http://localhost:${APTHTTPPORT}  pkg-mixed-sha2-bad 1.0 (tar) [3 B]
+Err:1 http://localhost:${APTHTTPPORT}  pkg-mixed-sha2-bad 1.0 (tar)
   Hash Sum mismatch
-Get:2 http://localhost:8080  pkg-mixed-sha2-bad 1.0 (dsc) [3 B]
-E: Failed to fetch http://localhost:8080/pkg-mixed-sha2-bad_1.0.tar.gz  Hash Sum mismatch
+Get:2 http://localhost:${APTHTTPPORT}  pkg-mixed-sha2-bad 1.0 (dsc) [3 B]
+E: Failed to fetch http://localhost:${APTHTTPPORT}/pkg-mixed-sha2-bad_1.0.tar.gz  Hash Sum mismatch
 
-E: Failed to fetch some archives.' aptget source -d pkg-mixed-sha2-bad
+E: Failed to fetch some archives." aptget source -d pkg-mixed-sha2-bad
 msgtest 'Only dsc file is downloaded as the tar has hashsum mismatch' 'pkg-mixed-sha2-bad'
 testsuccess --nomsg test -e pkg-mixed-sha2-bad_1.0.dsc -a ! -e pkg-mixed-sha2-bad_1.0.tar.gz