]> git.saurik.com Git - apt.git/blame - test/integration/test-bug-814139-pickup-of-different-cache-states
don't purge directly, but remove and do purge at the end
[apt.git] / test / integration / test-bug-814139-pickup-of-different-cache-states
CommitLineData
b6f1b480
DK
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
6
7setupenvironment
8configarchitecture 'amd64'
9
10insertinstalledpackage 'build-essential' 'amd64' '1'
11
12buildsimplenativepackage 'foo' 'all' '1' 'stable' 'Build-Depends: bar'
13buildsimplenativepackage 'bar' 'all' '1' 'stable'
14
15setupaptarchive
16
17cp rootdir/var/lib/dpkg/status status.backup
18
19testrun() {
20 cp status.backup rootdir/var/lib/dpkg/status
21 cleanup
22 testdpkgnotinstalled 'bar'
23 testsuccess aptget build-dep foo -y
24 testdpkginstalled 'bar'
25 cleanup
9750213c 26 cd downloaded
b6f1b480 27 testsuccess aptget source foo
7776f6d2
DK
28 testsuccess test -s foo_1.tar.* -a -s foo_1.dsc
29 rm foo_1.tar.* foo_1.dsc
b6f1b480
DK
30 testsuccess test -d foo-1
31 rm -rf foo-1
9750213c 32 cd ..
b6f1b480
DK
33 cleanup
34 testsuccess aptget install foo -y
35}
36
37msgmsg 'Caches fully up-to-date'
38cleanup() {
39 rm -f rootdir/var/cache/apt/*.bin
40 testsuccess aptcache gencaches
41}
42testrun
43
44msgmsg 'pkgcache.bin is missing'
45cleanup() {
46 rm -f rootdir/var/cache/apt/*.bin
47 testsuccess aptcache gencaches
48 rm rootdir/var/cache/apt/pkgcache.bin
49}
50testrun
51
52msgmsg 'Caches are not writeable'
53rm rootdir/var/cache/apt/*.bin
54addtrap 'prefix' 'chmod 755 rootdir/var/cache/apt;'
55chmod 555 rootdir/var/cache/apt
56testsuccess aptcache gencaches
57cleanup() {
58 testfilestats "${TMPWORKINGDIRECTORY}/rootdir/var/cache/apt" '%a' '=' '555'
59}
60testrun