File: test-apt-update-empty-files

package info (click to toggle)
apt 3.1.13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,764 kB
  • sloc: cpp: 71,085; sh: 31,750; xml: 5,553; perl: 217; python: 197; ansic: 191; makefile: 41
file content (47 lines) | stat: -rwxr-xr-x 1,653 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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'