summaryrefslogtreecommitdiffstats
path: root/test/integration/test-apt-update-simple
blob: 6855f1d1f06f0e7b0367e95c0898ab9e6fe9e4cf (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
30
31
32
33
34
35
36
37
#!/bin/sh
set -e

TESTDIR="$(readlink -f "$(dirname "$0")")"
. "$TESTDIR/framework"
setupenvironment
configarchitecture 'amd64'

insertpackage 'unstable' 'foo' 'all' '1'
insertpackage 'unstable' 'bar' 'amd64' '1'
insertpackage 'unstable' 'bar' 'i386' '1'
insertsource 'unstable' 'foo' 'all' '1'

sed -e 's#^Description-en:#Description-de:#' \
	aptarchive/dists/unstable/main/i18n/Translation-en > aptarchive/dists/unstable/main/i18n/Translation-de

setupaptarchive --no-update
changetowebserver

# the framework modifies some configs to ensure testability,
# at the expense of creating an environment which doesn't always
# reflect apts "normal" behavior on a "normal" system
echo 'Acquire::IndexTargets::Randomized "true";
Acquire::Languages { "environment"; "en"; "de"; };
' > rootdir/etc/apt/apt.conf.d/restore-simplicity

testempty aptget indextargets
testsuccess aptget update
testequal 'main/source/Sources
main/binary-amd64/Packages
main/binary-all/Packages
main/i18n/Translation-en
main/i18n/Translation-de' aptget indextargets --format '$(METAKEY)'

# Check that -o Acquire::Queue-Mode=access does not crash
find rootdir/var/lib/apt/lists/ -type f -delete
testsuccess valgrind aptget update -o Acquire::Queue-Mode=access