#!/bin/sh set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment configarchitecture "i386" buildaptarchive setupflataptarchive changetowebserver prepare() { local DATE="${2:-now}" if [ "$DATE" = 'now' -a "$1" = "${PKGFILE}-new" ]; then DATE='now + 6 days' fi for release in $(find rootdir/var/lib/apt/lists 2> /dev/null); do touch -d 'now - 6 hours' "$release" done cp "$1" aptarchive/Packages find aptarchive -name 'Release' -delete compressfile aptarchive/Packages # create Release file with incorret checksums cat > aptarchive/Release </dev/null | grep -v FAILED 2>/dev/null)" = "" ] && msgpass || msgfail # now with the unsigned Release file rm -rf rootdir/var/lib/apt/lists rm aptarchive/InRelease aptarchive/Release.gpg msgtest 'unsigned apt-get update gets the expected hashsum mismatch' testfailure --nomsg aptget update --allow-insecure-repositories testsuccess grep "Hash Sum mismatch" rootdir/tmp/testfailure.output } for COMPRESSEDINDEXES in 'false' 'true'; do echo "Acquire::GzipIndexes \"$COMPRESSEDINDEXES\";" > rootdir/etc/apt/apt.conf.d/compressindexes if $COMPRESSEDINDEXES; then msgmsg 'Run tests with GzipIndexes enabled' else msgmsg 'Run tests with GzipIndexes disabled' fi runtest done