summaryrefslogtreecommitdiffstats
path: root/test/integration/test-bug-254770-segfault-if-cache-not-buildable
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 09:59:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 09:59:37 +0000
commit76e2632459410dec81337edb6a9fee33c9a660f3 (patch)
treea73345df208eede4a4daad340515c9328f34625c /test/integration/test-bug-254770-segfault-if-cache-not-buildable
parentInitial commit. (diff)
downloadapt-76e2632459410dec81337edb6a9fee33c9a660f3.tar.xz
apt-76e2632459410dec81337edb6a9fee33c9a660f3.zip
Adding upstream version 2.7.12.upstream/2.7.12
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/test-bug-254770-segfault-if-cache-not-buildable')
-rwxr-xr-xtest/integration/test-bug-254770-segfault-if-cache-not-buildable64
1 files changed, 64 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 0000000..6f6e1ab
--- /dev/null
+++ b/test/integration/test-bug-254770-segfault-if-cache-not-buildable
@@ -0,0 +1,64 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+
+msgtest 'Test run as' 'non-root'
+if [ "$(id -u)" = '0' ]; then
+ msgskip 'root has by definition no problems accessing files'
+ exit 0
+else
+ msgpass
+fi
+
+setupenvironment
+configarchitecture "i386"
+setupaptarchive
+
+addtrap 'prefix' 'chmod a+x rootdir/var/lib/dpkg;'
+chmod a-x rootdir/var/lib/dpkg
+
+testsegfault() {
+ 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