]> git.saurik.com Git - apt.git/blob - test/integration/test-bug-254770-segfault-if-cache-not-buildable
test: Use :$(id -gn) instead of :root (when run as root)
[apt.git] / test / integration / test-bug-254770-segfault-if-cache-not-buildable
1 #!/bin/sh
2 set -e
3
4 TESTDIR="$(readlink -f "$(dirname "$0")")"
5 . "$TESTDIR/framework"
6
7 msgtest 'Test run as' 'non-root'
8 if [ "$(id -u)" = '0' ]; then
9 msgskip 'root has by definition no problems accessing files'
10 exit 0
11 else
12 msgpass
13 fi
14
15 setupenvironment
16 configarchitecture "i386"
17 setupaptarchive
18
19 addtrap 'prefix' 'chmod a+x rootdir/var/lib/dpkg;'
20 chmod a-x rootdir/var/lib/dpkg
21
22 testsegfault() {
23 msgtest "No segfault in" "$*"
24 local TEST="$("$@" 2>&1 | grep -v 'E:')"
25 if [ -z "$TEST" ]; then
26 msgpass
27 else
28 echo
29 echo "$TEST"
30 msgfail
31 fi
32 }
33
34 echo 'quiet 2;' > rootdir/etc/apt/apt.conf.d/00be-quiet
35
36 testsegfault aptcache gencaches
37 testsegfault aptcache showpkg
38 testsegfault aptcache showsrc
39 testsegfault aptcache stats
40 testsegfault aptcache dump
41 testsegfault aptcache dumpavail
42 testsegfault aptcache unmet
43 testsegfault aptcache search
44 testsegfault aptcache show apt
45 testsegfault aptcache depends apt
46 testsegfault aptcache rdepends apt
47 testsegfault aptcache pkgnames apt
48 testsegfault aptcache dotty apt
49 testsegfault aptcache xvcg apt
50 testsegfault aptcache policy apt
51
52 testsegfault aptget update
53 testsegfault aptget upgrade
54 testsegfault aptget dselect-upgrade
55 testsegfault aptget dist-upgrade
56 testsegfault aptget install apt
57 testsegfault aptget remove apt
58 testsegfault aptget purge apt
59 testsegfault aptget source apt
60 testsegfault aptget build-dep apt
61 testsegfault aptget check
62 testsegfault aptget clean
63 testsegfault aptget autoclean
64 testsegfault aptget autoremove