1
0
Fork 0
apt/test/integration/test-apt-update-empty-files
Daniel Baumann 6810ba718b
Adding upstream version 3.0.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-20 21:10:43 +02:00

47 lines
1.6 KiB
Bash
Executable file

#!/bin/sh
set -e
TESTDIR="$(readlink -f "$(dirname "$0")")"
. "$TESTDIR/framework"
setupenvironment
configarchitecture 'amd64'
configcompression '.' 'gz'
insertpackage 'unstable' 'apt' 'amd64' '1'
# this automatically gives us an empty Sources file
setupaptarchive --no-update
msgmsg 'Test with file'
rm -rf rootdir/var/lib/apt/lists
testsuccess apt update -o Debug::pkgAcquire::Worker=1
cp rootdir/tmp/testsuccess.output apt.output
testfailure grep '%0a\(Alt\)\?Filename:%20/.*/Sources\(\.gz\)\?%0a' apt.output
testempty find rootdir/var/lib/apt/lists -name '*_Sources'
msgmsg 'Test with http'
changetowebserver
rm -rf rootdir/var/lib/apt/lists
testsuccess apt update -o Debug::pkgAcquire::Worker=1
cp rootdir/tmp/testsuccess.output apt.output
testfailure grep 'http:600.*Sources' apt.output
testempty find rootdir/var/lib/apt/lists -name '*_Sources'
msgmsg 'Test lists-cleanup on newly empty'
rm -rf rootdir/var/lib/apt/lists
insertsource 'unstable' 'apt' 'any' '1'
compressfile aptarchive/dists/unstable/main/source/Sources
generatereleasefiles
signreleasefiles
testsuccess apt update -o Debug::pkgAcquire::Worker=1
cp rootdir/tmp/testsuccess.output apt.output
testsuccess grep 'http:600.*Sources' apt.output
echo -n > aptarchive/dists/unstable/main/source/Sources
compressfile aptarchive/dists/unstable/main/source/Sources
generatereleasefiles 'now + 1hour'
signreleasefiles
testsuccess apt update -o Debug::pkgAcquire::Worker=1 -o APT::Get::List-Cleanup=0 -o Debug::Acquire::Transaction=1
cp rootdir/tmp/testsuccess.output apt.output
testfailure grep 'http:600.*Sources' apt.output
testempty find rootdir/var/lib/apt/lists -name '*_Sources'