]> git.saurik.com Git - apt.git/blob - test/integration/test-bug-814139-pickup-of-different-cache-states
a6c84d6cdec0f49a0d4c1e2d152dd57c8cce53b0
[apt.git] / test / integration / test-bug-814139-pickup-of-different-cache-states
1 #!/bin/sh
2 set -e
3
4 TESTDIR="$(readlink -f "$(dirname "$0")")"
5 . "$TESTDIR/framework"
6
7 setupenvironment
8 configarchitecture 'amd64'
9
10 insertinstalledpackage 'build-essential' 'amd64' '1'
11
12 buildsimplenativepackage 'foo' 'all' '1' 'stable' 'Build-Depends: bar'
13 buildsimplenativepackage 'bar' 'all' '1' 'stable'
14
15 setupaptarchive
16
17 cp rootdir/var/lib/dpkg/status status.backup
18
19 testrun() {
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
26 testsuccess aptget source foo
27 testsuccess test -s foo_1.tar.xz -a -s foo_1.dsc
28 rm foo_1.tar.xz foo_1.dsc
29 testsuccess test -d foo-1
30 rm -rf foo-1
31 cleanup
32 testsuccess aptget install foo -y
33 }
34
35 msgmsg 'Caches fully up-to-date'
36 cleanup() {
37 rm -f rootdir/var/cache/apt/*.bin
38 testsuccess aptcache gencaches
39 }
40 testrun
41
42 msgmsg 'pkgcache.bin is missing'
43 cleanup() {
44 rm -f rootdir/var/cache/apt/*.bin
45 testsuccess aptcache gencaches
46 rm rootdir/var/cache/apt/pkgcache.bin
47 }
48 testrun
49
50 msgmsg 'Caches are not writeable'
51 rm rootdir/var/cache/apt/*.bin
52 addtrap 'prefix' 'chmod 755 rootdir/var/cache/apt;'
53 chmod 555 rootdir/var/cache/apt
54 testsuccess aptcache gencaches
55 cleanup() {
56 testfilestats "${TMPWORKINGDIRECTORY}/rootdir/var/cache/apt" '%a' '=' '555'
57 }
58 testrun