summaryrefslogtreecommitdiffstats
path: root/test/integration/test-apt-update-empty-files
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 09:59:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 09:59:37 +0000
commit76e2632459410dec81337edb6a9fee33c9a660f3 (patch)
treea73345df208eede4a4daad340515c9328f34625c /test/integration/test-apt-update-empty-files
parentInitial commit. (diff)
downloadapt-76e2632459410dec81337edb6a9fee33c9a660f3.tar.xz
apt-76e2632459410dec81337edb6a9fee33c9a660f3.zip
Adding upstream version 2.7.12.upstream/2.7.12
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/test-apt-update-empty-files')
-rwxr-xr-xtest/integration/test-apt-update-empty-files47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/integration/test-apt-update-empty-files b/test/integration/test-apt-update-empty-files
new file mode 100755
index 0000000..24e40f9
--- /dev/null
+++ b/test/integration/test-apt-update-empty-files
@@ -0,0 +1,47 @@
+#!/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'