summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-01-13 17:16:11 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-01-13 17:16:11 +0100
commitc55b8a54780c4db6a5fa270ddd2d05ab837f6ffb (patch)
tree3059c5ed654e4764f6b549748fbf2ab2bef63536 /test/integration
parentf688d1d3c90091c308ec979eabab511134810be9 (diff)
* apt-pkg/cacheiterator.h:
- do not segfault if cache is not build (Closes: #254770)
Diffstat (limited to 'test/integration')
-rwxr-xr-xtest/integration/test-bug-254770-segfault-if-cache-not-buildable57
1 files changed, 57 insertions, 0 deletions
diff --git a/test/integration/test-bug-254770-segfault-if-cache-not-buildable b/test/integration/test-bug-254770-segfault-if-cache-not-buildable
new file mode 100755
index 000000000..25c564daa
--- /dev/null
+++ b/test/integration/test-bug-254770-segfault-if-cache-not-buildable
@@ -0,0 +1,57 @@
+#!/bin/sh
+set -e
+
+local TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture "i386"
+setupaptarchive
+
+CURRENTTRAP="chmod a+x rootdir/var/lib/dpkg; $CURRENTTRAP"
+trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
+chmod a-x rootdir/var/lib/dpkg
+
+testsegfault() {
+ rm -f rootdir/var/cache/apt/*.bin
+ msgtest "No segfault in" "$*"
+ local TEST="$($* 2>&1 | grep -v 'E:')"
+ if [ -z "$TEST" ]; then
+ msgpass
+ else
+ echo
+ echo $TEST
+ msgfail
+ fi
+}
+
+echo 'quiet 2;' > rootdir/etc/apt/apt.conf.d/00be-quiet
+
+testsegfault aptcache gencaches
+testsegfault aptcache showpkg
+testsegfault aptcache showsrc
+testsegfault aptcache stats
+testsegfault aptcache dump
+testsegfault aptcache dumpavail
+testsegfault aptcache unmet
+testsegfault aptcache search
+testsegfault aptcache show apt
+testsegfault aptcache depends apt
+testsegfault aptcache rdepends apt
+testsegfault aptcache pkgnames apt
+testsegfault aptcache dotty apt
+testsegfault aptcache xvcg apt
+testsegfault aptcache policy apt
+
+testsegfault aptget update
+testsegfault aptget upgrade
+testsegfault aptget dselect-upgrade
+testsegfault aptget dist-upgrade
+testsegfault aptget install apt
+testsegfault aptget remove apt
+testsegfault aptget purge apt
+testsegfault aptget source apt
+testsegfault aptget build-dep apt
+testsegfault aptget check
+testsegfault aptget clean
+testsegfault aptget autoclean
+testsegfault aptget autoremove