4 TESTDIR
=$(readlink -f $(dirname $0))
8 configarchitecture
'native'
11 setupsimplenativepackage
"fdleaks" 'all' '1.0' 'unstable'
12 BUILDDIR
="incoming/fdleaks-1.0"
13 for script in 'preinst' 'postinst' 'prerm' 'postrm'; do
15 ls -l /proc/self/fd/' > ${BUILDDIR}/debian
/$script
17 buildpackage
"$BUILDDIR" 'unstable' 'main' 'native'
22 rm -f rootdir
/var
/log
/dpkg.log rootdir
/var
/log
/apt
/term.log
23 testsuccess aptget
install -y fdleaks
-qq < /dev
/null
24 msgtest
'Check if fds were not' 'leaked'
25 if [ "$(grep 'root root' rootdir/tmp/testsuccess.output | wc -l)" = '8' ]; then
29 cat rootdir
/tmp
/testsuccess.output
33 cp rootdir
/tmp
/testsuccess.output terminal.output
34 tail -n +3 rootdir
/var
/log
/apt
/term.log
| head -n -1 > terminal.log
35 testfileequal
'terminal.log' "$(cat terminal.output)"
37 testequal
'startup archives unpack
38 install fdleaks:all <none> 1.0
39 status half-installed fdleaks:all 1.0
40 status unpacked fdleaks:all 1.0
41 status unpacked fdleaks:all 1.0
42 startup packages configure
43 configure fdleaks:all 1.0 <none>
44 status unpacked fdleaks:all 1.0
45 status half-configured fdleaks:all 1.0
46 status installed fdleaks:all 1.0' cut
-f 3- -d' ' rootdir
/var
/log
/dpkg.log
48 rm -f rootdir
/var
/log
/dpkg.log rootdir
/var
/log
/apt
/term.log
49 testsuccess aptget purge
-y fdleaks
-qq
50 msgtest
'Check if fds were not' 'leaked'
51 if [ "$(grep 'root root' rootdir/tmp/testsuccess.output | wc -l)" = '12' ]; then
55 cat rootdir
/tmp
/testsuccess.output
58 cp rootdir
/tmp
/testsuccess.output terminal.output
59 tail -n +3 rootdir
/var
/log
/apt
/term.log
| head -n -1 > terminal.log
60 testfileequal
'terminal.log' "$(cat terminal.output)"
62 testequal
'startup packages purge
63 status installed fdleaks:all 1.0
64 remove fdleaks:all 1.0 <none>
65 status half-configured fdleaks:all 1.0
66 status half-installed fdleaks:all 1.0
67 status config-files fdleaks:all 1.0
68 purge fdleaks:all 1.0 <none>
69 status config-files fdleaks:all 1.0
70 status config-files fdleaks:all 1.0
71 status config-files fdleaks:all 1.0
72 status config-files fdleaks:all 1.0
73 status config-files fdleaks:all 1.0
74 status not-installed fdleaks:all <none>' cut
-f 3- -d' ' rootdir
/var
/log
/dpkg.log