#!/bin/sh
set -e
-TESTDIR=$(readlink -f $(dirname $0))
-. $TESTDIR/framework
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
setupenvironment
configarchitecture 'amd64'
insertpackage 'unstable' 'unrelated2' 'amd64' '0.5~squeeze1'
insertsource 'unstable' 'unrelated' 'all' '0.5~squeeze1'
+export APT_DONT_SIGN=""
setupaptarchive --no-update
changetowebserver
rm -rf rootdir/var/lib/apt/lists/
local TEST="test${1:-success}"
- $TEST aptget update $APTOPT
+ $TEST aptget update $APTOPT -o Debug::pkgAcquire::Worker=1
if [ "$1" = 'failure' ]; then
# accept the outdated Release file so we can check Hit behaviour
"test${2:-success}" aptget update -o Acquire::Min-ValidTime=9999999 $APTOPT
fi
listcurrentlistsdirectory > listsdir.lst
- testsuccess grep '_Packages\(\.gz\)\?$' listsdir.lst
- testsuccess grep '_Sources\(\.gz\)\?$' listsdir.lst
- testsuccess grep '_Translation-en\(\.gz\)\?$' listsdir.lst
+ testsuccess grep '_Packages\(\.[0-9a-z]\+\)\?$' listsdir.lst
+ testsuccess grep '_Sources\(\.[0-9a-z]\+\)\?$' listsdir.lst
+ testsuccess grep '_Translation-en\(\.[0-9a-z]\+\)\?$' listsdir.lst
# ensure no leftovers in partial
testfailure ls 'rootdir/var/lib/apt/lists/partial/*'
$TEST aptget update -o Debug::Acquire::gpgv=1 $APTOPT
cp rootdir/tmp/${TEST}.output goodsign.output
testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
- testsuccess grep '^Got GOODSIG, key ID:GOODSIG' goodsign.output
+ testsuccess grep '^Got GOODSIG ' goodsign.output
fi
# ensure no leftovers in partial
# make the release file old
find aptarchive -name '*Release' -exec sed -i \
- -e "s#^Date: .*\$#Date: $(date -d '-2 weeks' '+%a, %d %b %Y %H:%M:%S %Z')#" \
+ -e "s#^Date: .*\$#Date: $(date -ud '-2 weeks' '+%a, %d %b %Y %H:%M:%S %Z')#" \
-e '/^Valid-Until: / d' -e "/^Date: / a\
-Valid-Until: $(date -d '-1 weeks' '+%a, %d %b %Y %H:%M:%S %Z')" '{}' \;
+Valid-Until: $(date -ud '-1 weeks' '+%a, %d %b %Y %H:%M:%S %Z')" '{}' \;
signreleasefiles
msgmsg 'expired InRelease'