#!/bin/sh
set -e
-TESTDIR=$(readlink -f $(dirname $0))
-. $TESTDIR/framework
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
setupenvironment
configarchitecture 'amd64' 'i386'
for script in 'preinst' 'postinst' 'prerm' 'postrm'; do
cat > ${BUILDDIR}/debian/$script << EOF
#!/bin/sh
-if [ -e "$(pwd)/rootdir/tmp/read_stdin" ]; then
+if [ -e '$(pwd)/rootdir/tmp/read_stdin' ]; then
read line;
echo "STDIN: -\$line-"
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
configure $PKGNAME 1.0 <none>
status unpacked $PKGNAME 1.0
status half-configured $PKGNAME 1.0
-status installed $PKGNAME 1.0
-startup packages configure" cut -f 3- -d' ' rootdir/var/log/dpkg.log
+status installed $PKGNAME 1.0" cut -f 3- -d' ' rootdir/var/log/dpkg.log
}
checkinstall
testfileequal 'terminal.log' "$(cat terminal.output)"
testequal "startup packages purge
-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 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