summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-07-05 08:21:28 +0200
committerJulian Andres Klode <jak@debian.org>2016-08-31 13:49:37 +0200
commitd30f800560010cb123fdd74b46c727df0e54eaed (patch)
treec74a1b75c3b5dfcbcc57a3f32955afdce25a1a49 /test/integration
parentde2c7e41ab4fe0e1e899e1d87c991e32cd343365 (diff)
indextargets: Check that cache could be built before using it
This caused a crash because the cache was a nullptr. Closes: #829651 (cherry picked from commit 8823972649b0d3049c9c0d34b5f1d31160234fb4)
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/test-bug-82965127
1 files changed, 27 insertions, 0 deletions
diff --git a/test/integration/test-bug-829651 b/test/integration/test-bug-829651
new file mode 100644
index 000000000..976bb040c
--- /dev/null
+++ b/test/integration/test-bug-829651
@@ -0,0 +1,27 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+setupenvironment
+configarchitecture 'amd64'
+
+if [ "$(id -u)" = '0' ]; then
+ msgskip 'Tests for unreadable files do not work as root'
+ exit 0
+fi
+
+insertinstalledpackage 'foo' 'amd64' '1'
+insertpackage 'unstable' 'foo' 'amd64' '2'
+
+setupaptarchive
+
+
+testsuccess aptget indextargets
+
+aptget clean
+chmod -r rootdir/var/lib/dpkg/status
+
+testfailureequal "E: Could not open file ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status - open (13: Permission denied)
+E: Problem opening ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status
+E: The package lists or status file could not be parsed or opened." aptget indextargets