summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-update-empty-files
blob: 42329bb4bbe5a188d87047130c0200000c6e5685 (plain)
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
#!/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'