configarchitecture 'amd64' 'i386'
configdpkgnoopchroot
+if [ ! -e /proc/self/fd ]; then
+ msgskip "needs /proc/self/fd"
+ exit 0
+fi
+
setupsimplenativepackage "fdleaks" 'all' '1.0' 'unstable'
BUILDDIR="incoming/fdleaks-1.0"
for script in 'preinst' 'postinst' 'prerm' 'postrm'; do
rm -rf "$BUILDDIR"
PKGNAME='fdleaks:all'
-if ! dpkg-checkbuilddeps -d 'dpkg (>= 1.16.2)' /dev/null >/dev/null 2>&1; then
+if dpkg --compare-versions "$(dpkg_version)" 'lt' '1.16.2'; then
PKGNAME='fdleaks'
fi
testsuccess aptget install -y fdleaks -qq < /dev/null
checkfdleak() {
- msgtest 'Check if fds were not' 'leaked'
+ msgtest 'Check if fds were not' "leaked: expect $1"
if [ "$(grep 'root root' rootdir/tmp/testsuccess.output | wc -l)" = "$1" ]; then
msgpass
else
tail -n +3 rootdir/var/log/apt/term.log | head -n -1 > terminal.log
testfileequal 'terminal.log' "$(cat terminal.output)"
- testequal "startup packages purge
+ testequal "startup packages remove
status installed $PKGNAME 1.0
remove $PKGNAME 1.0 <none>
status half-configured $PKGNAME 1.0
status half-installed $PKGNAME 1.0
status config-files $PKGNAME 1.0
+status config-files $PKGNAME 1.0
+startup packages configure
+startup packages purge
+remove $PKGNAME 1.0 <none>
purge $PKGNAME 1.0 <none>
status config-files $PKGNAME 1.0
status config-files $PKGNAME 1.0
status config-files $PKGNAME 1.0
status not-installed $PKGNAME <none>
startup packages configure" cut -f 3- -d' ' rootdir/var/log/dpkg.log
+ testequalor2 "dpkg-query: no packages found matching ${PKGNAME}" "No packages found matching ${PKGNAME}." dpkg -l "$PKGNAME"
}
checkpurge