X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/d2b7b1300c7567b4c9d9b057d5077e66a9ba18b6..3abb6a6a1e485b3bc899b64b0a1b7dc2db25a9c2:/test/integration/test-acquire-same-repository-multiple-times?ds=sidebyside diff --git a/test/integration/test-acquire-same-repository-multiple-times b/test/integration/test-acquire-same-repository-multiple-times index abdfef8f0..c8372bd41 100755 --- a/test/integration/test-acquire-same-repository-multiple-times +++ b/test/integration/test-acquire-same-repository-multiple-times @@ -1,13 +1,13 @@ #!/bin/sh set -e -TESTDIR=$(readlink -f $(dirname $0)) -. $TESTDIR/framework +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" setupenvironment configarchitecture 'amd64' TESTFILE="$TESTDIR/framework" -cp $TESTFILE aptarchive/foo +cp "$TESTFILE" aptarchive/foo APTARCHIVE="$(readlink -f ./aptarchive)" getcodenamefromsuite() { echo "jessie"; } @@ -21,11 +21,14 @@ done # install a slowed down file: otherwise its to fast to reproduce combining NEWMETHODS="$(readlink -f rootdir)/usr/lib/apt/methods" OLDMETHODS="$(readlink -f rootdir/usr/lib/apt/methods)" -rm $NEWMETHODS -mkdir $NEWMETHODS -for METH in $(find $OLDMETHODS ! -type d); do - ln -s $OLDMETHODS/$(basename $METH) $NEWMETHODS +rm "$NEWMETHODS" +mkdir "$NEWMETHODS" +backupIFS="$IFS" +IFS="$(printf "\n\b")" +for METH in $(find "$OLDMETHODS" ! -type d); do + ln -s "$OLDMETHODS/$(basename "$METH")" "$NEWMETHODS" done +IFS="$backupIFS" rm "${NEWMETHODS}/file" "${NEWMETHODS}/http" cat >"${NEWMETHODS}/file" < file.lst - testequal "$(find $(readlink -f ./rootdir/var/lib/apt/lists) -name '*_dists_*' \( ! -name '*InRelease' \) -type f | sort)" cat file.lst + testequal "$(find "$(readlink -f ./rootdir/var/lib/apt/lists)" -name '*_dists_*' \( ! -name '*InRelease' \) -type f | sort)" cat file.lst testsuccess aptcache policy testequal "foo: Installed: (none) Candidate: 1.0 Version table: 1.0 500 - 500 $1:$2 jessie/main amd64 Packages - 500 $1:$2 stable/main amd64 Packages" aptcache policy foo + 500 $1:$2 jessie/main all Packages + 500 $1:$2 stable/main all Packages" aptcache policy foo testfailure aptcache show foo/unstable testsuccess aptcache show foo/stable testsuccess aptcache show foo/jessie } tworepos 'file' "$APTARCHIVE" 'no partial' -testequal '12' grep -c '200%20URI%20Start' ./download.log -testequal '12' grep -c '201%20URI%20Done' ./download.log -testequal '6' grep -c '^ @ Queue: Action combined' ./download.log +testequal '14' grep -c '200%20URI%20Start' ./download.log +testequal '14' grep -c '201%20URI%20Done' ./download.log +testequal '8' grep -c '^ @ Queue: Action combined' ./download.log tworepos 'file' "$APTARCHIVE" 'hit' testequal '6' grep -c '200%20URI%20Start' ./download.log testequal '6' grep -c '201%20URI%20Done' ./download.log @@ -71,11 +74,11 @@ rm -rf rootdir/var/lib/apt/lists changetowebserver -tworepos 'http' '//localhost:8080' 'no partial' -testequal '10' grep -c '200%20URI%20Start' ./download.log -testequal '10' grep -c '201%20URI%20Done' ./download.log -testequal '6' grep -c '^ @ Queue: Action combined' ./download.log -tworepos 'http' '//localhost:8080' 'hit' +tworepos 'http' "//localhost:${APTHTTPPORT}" 'no partial' +testequal '12' grep -c '200%20URI%20Start' ./download.log +testequal '12' grep -c '201%20URI%20Done' ./download.log +testequal '8' grep -c '^ @ Queue: Action combined' ./download.log +tworepos 'http' "//localhost:${APTHTTPPORT}" 'hit' testequal '2' grep -c '200%20URI%20Start' ./download.log testequal '4' grep -c '201%20URI%20Done' ./download.log testequal '0' grep -c '^ @ Queue: Action combined' ./download.log