summaryrefslogtreecommitdiffstats
path: root/test/integration/test-bug-814139-pickup-of-different-cache-states
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/test-bug-814139-pickup-of-different-cache-states')
-rwxr-xr-xtest/integration/test-bug-814139-pickup-of-different-cache-states60
1 files changed, 60 insertions, 0 deletions
diff --git a/test/integration/test-bug-814139-pickup-of-different-cache-states b/test/integration/test-bug-814139-pickup-of-different-cache-states
new file mode 100755
index 0000000..dffeb73
--- /dev/null
+++ b/test/integration/test-bug-814139-pickup-of-different-cache-states
@@ -0,0 +1,60 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+
+setupenvironment
+configarchitecture 'amd64'
+
+insertinstalledpackage 'build-essential' 'amd64' '1'
+
+buildsimplenativepackage 'foo' 'all' '1' 'stable' 'Build-Depends: bar'
+buildsimplenativepackage 'bar' 'all' '1' 'stable'
+
+setupaptarchive
+
+cp rootdir/var/lib/dpkg/status status.backup
+
+testrun() {
+ cp status.backup rootdir/var/lib/dpkg/status
+ cleanup
+ testdpkgnotinstalled 'bar'
+ testsuccess aptget build-dep foo -y
+ testdpkginstalled 'bar'
+ cleanup
+ cd downloaded
+ testsuccess aptget source foo
+ testsuccess test -s foo_1.tar.* -a -s foo_1.dsc
+ rm foo_1.tar.* foo_1.dsc
+ testsuccess test -d foo-1
+ rm -rf foo-1
+ cd ..
+ cleanup
+ testsuccess aptget install foo -y
+}
+
+msgmsg 'Caches fully up-to-date'
+cleanup() {
+ rm -f rootdir/var/cache/apt/*.bin
+ testsuccess aptcache gencaches
+}
+testrun
+
+msgmsg 'pkgcache.bin is missing'
+cleanup() {
+ rm -f rootdir/var/cache/apt/*.bin
+ testsuccess aptcache gencaches
+ rm rootdir/var/cache/apt/pkgcache.bin
+}
+testrun
+
+msgmsg 'Caches are not writeable'
+rm rootdir/var/cache/apt/*.bin
+addtrap 'prefix' 'chmod 755 rootdir/var/cache/apt;'
+chmod 555 rootdir/var/cache/apt
+testsuccess aptcache gencaches
+cleanup() {
+ testfilestats "${TMPWORKINGDIRECTORY}/rootdir/var/cache/apt" '%a' '=' '555'
+}
+testrun