4 TESTDIR
=$(readlink -f $(dirname $0))
8 configarchitecture
'amd64' 'i386'
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'
21 if ! dpkg
-checkbuilddeps -d 'dpkg (>= 1.16.2)' /dev
/null
; then
27 rm -f rootdir
/var
/log
/dpkg.log rootdir
/var
/log
/apt
/term.log
28 testsuccess aptget
install -y fdleaks
-qq < /dev
/null
29 msgtest
'Check if fds were not' 'leaked'
30 if [ "$(grep 'root root' rootdir/tmp/testsuccess.output | wc -l)" = '8' ]; then
34 cat rootdir
/tmp
/testsuccess.output
38 cp rootdir
/tmp
/testsuccess.output terminal.output
39 tail -n +3 rootdir
/var
/log
/apt
/term.log
| head -n -1 > terminal.log
40 testfileequal
'terminal.log' "$(cat terminal.output)"
42 testequal
"startup archives unpack
43 install $PKGNAME <none> 1.0
44 status half-installed $PKGNAME 1.0
45 status unpacked $PKGNAME 1.0
46 status unpacked $PKGNAME 1.0
47 startup packages configure
48 configure $PKGNAME 1.0 <none>
49 status unpacked $PKGNAME 1.0
50 status half-configured $PKGNAME 1.0
51 status installed $PKGNAME 1.0
52 startup packages configure" cut
-f 3- -d' ' rootdir
/var
/log
/dpkg.log
54 rm -f rootdir
/var
/log
/dpkg.log rootdir
/var
/log
/apt
/term.log
55 testsuccess aptget purge
-y fdleaks
-qq
56 msgtest
'Check if fds were not' 'leaked'
57 if [ "$(grep 'root root' rootdir/tmp/testsuccess.output | wc -l)" = '12' ]; then
61 cat rootdir
/tmp
/testsuccess.output
64 cp rootdir
/tmp
/testsuccess.output terminal.output
65 tail -n +3 rootdir
/var
/log
/apt
/term.log
| head -n -1 > terminal.log
66 testfileequal
'terminal.log' "$(cat terminal.output)"
68 testequal
"startup packages purge
69 status installed $PKGNAME 1.0
70 remove $PKGNAME 1.0 <none>
71 status half-configured $PKGNAME 1.0
72 status half-installed $PKGNAME 1.0
73 status config-files $PKGNAME 1.0
74 purge $PKGNAME 1.0 <none>
75 status config-files $PKGNAME 1.0
76 status config-files $PKGNAME 1.0
77 status config-files $PKGNAME 1.0
78 status config-files $PKGNAME 1.0
79 status config-files $PKGNAME 1.0
80 status not-installed $PKGNAME <none>
81 startup packages configure" cut
-f 3- -d' ' rootdir
/var
/log
/dpkg.log