X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/05f64ca2e483709faa6bc69dfa79129d2d4c679e..4b1fb7b1876bdb46cb7a0329158f12638baa2464:/test/integration/test-apt-update-not-modified diff --git a/test/integration/test-apt-update-not-modified b/test/integration/test-apt-update-not-modified index 2dc56e76c..064c7cbc7 100755 --- a/test/integration/test-apt-update-not-modified +++ b/test/integration/test-apt-update-not-modified @@ -1,45 +1,195 @@ #!/bin/sh set -e -TESTDIR=$(readlink -f $(dirname $0)) -. $TESTDIR/framework +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" setupenvironment configarchitecture 'amd64' 'i386' +confighashes 'SHA256' -insertpackage 'unstable' 'apt' 'all' '1.0' +insertpackage 'unstable' 'apt' 'amd64,i386' '1.0' +export APT_DONT_SIGN='' setupaptarchive --no-update methodtest() { - msgmsg 'Test with' "$1" + msgmsg 'Test InRelease with' "$1" rm -rf rootdir/var/lib/apt/lists + cp -a aptarchive/dists aptarchive/dists.good # get our cache populated testsuccess aptget update listcurrentlistsdirectory > listsdir.lst # hit again with a good cache - testsuccessequal "Hit $1 unstable InRelease + testsuccessequal "Hit:1 $1 unstable InRelease Reading package lists..." aptget update testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)" # drop an architecture, which means the file should be gone now configarchitecture 'i386' sed '/_binary-amd64_Packages/ d' listsdir.lst > listsdir-without-amd64.lst - testsuccessequal "Hit $1 unstable InRelease + testsuccessequal "Hit:1 $1 unstable InRelease Reading package lists..." aptget update testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)" - # readd arch so its downloaded again + # readd arch so its downloaded again… configarchitecture 'amd64' 'i386' - testsuccessequal "Hit $1 unstable InRelease -Get:1 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B] + # … but oh noes, hashsum mismatch! + SIZE=$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') + mv aptarchive/dists/unstable/main/binary-amd64/Packages.gz aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig + cat > aptarchive/dists/unstable/main/binary-amd64/Packages < listsdir.lst + + # hit again with a good cache + testsuccessequal "Ign:1 $1 unstable InRelease + 404 Not Found +Hit:2 $1 unstable Release Reading package lists..." aptget update testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)" + + # drop an architecture, which means the file should be gone now + configarchitecture 'i386' + sed '/_binary-amd64_Packages/ d' listsdir.lst > listsdir-without-amd64.lst + testsuccessequal "Ign:1 $1 unstable InRelease + 404 Not Found +Hit:2 $1 unstable Release +Reading package lists..." aptget update + testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)" + + # readd arch so its downloaded again… + configarchitecture 'amd64' 'i386' + # … but oh noes, hashsum mismatch! + SIZE=$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') + mv aptarchive/dists/unstable/main/binary-amd64/Packages.gz aptarchive/dists/unstable/main/binary-amd64/Packages.gz.orig + cat > aptarchive/dists/unstable/main/binary-amd64/Packages <