summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-08-24 00:25:26 +0200
committerJulian Andres Klode <jak@debian.org>2016-08-26 22:17:55 +0200
commit8683da61448b62df2ccc1918e4c605c9e6d4ab1d (patch)
tree3888a7d44f124ed2bc120b5c490e12e07df0728f /test
parentf8e8a14f17cb41c588970fc57bb41fcf6058a703 (diff)
test: Avoid use of /proc/self/fd
Use /dev/fd in test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch, skip test-no-fds-leaked-to-maintainer-scripts (it is not guaranteed that /dev/fd contains all file descriptors), and avoid the unneeded use of /proc/fd in another test case. Gbp-Dch: ignore
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch2
-rwxr-xr-xtest/integration/test-bug-769609-triggers-still-pending-after-run10
-rwxr-xr-xtest/integration/test-no-fds-leaked-to-maintainer-scripts5
3 files changed, 11 insertions, 6 deletions
diff --git a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch
index d9fd3d30d..bf93367c9 100755
--- a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch
+++ b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch
@@ -32,7 +32,7 @@ if [ -n \"${2}\" ]; then
FD=\$APT_HOOK_INFO_FD
if [ "\$FD" != \"${2}\" ]; then echo \"ERROR: Information is not on requested FD: \$FD != ${2}\" >> ${hook}-v${1}.list; fi
fi
-while read </proc/\$\$/fd/\$FD line; do
+while read </dev/fd/\$FD line; do
if echo \"\$line\" | grep -Fq '**'; then
echo \"\$line\"
fi
diff --git a/test/integration/test-bug-769609-triggers-still-pending-after-run b/test/integration/test-bug-769609-triggers-still-pending-after-run
index bd43578a5..b44ebf74f 100755
--- a/test/integration/test-bug-769609-triggers-still-pending-after-run
+++ b/test/integration/test-bug-769609-triggers-still-pending-after-run
@@ -23,7 +23,7 @@ buildtriggerpackages() {
cat >"${BUILDDIR}/debian/postinst" <<EOF
#!/bin/sh
if [ "\$1" = 'triggered' ]; then
- ls -l /proc/self/fd/
+ echo "TRIGGER IS RUNNING"
fi
EOF
echo "$TYPE /usr/share/doc" > "${BUILDDIR}/debian/triggers"
@@ -49,26 +49,26 @@ runtests() {
testsuccess aptget install trigdepends-$TYPE -y --reinstall
cp rootdir/tmp/testsuccess.output terminal.output
testsuccess grep '^REWRITE ' terminal.output
- testsuccess grep ' root root ' terminal.output
+ testsuccess grep 'TRIGGER IS RUNNING' terminal.output
testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
testsuccess aptget install trigstuff -y
cp rootdir/tmp/testsuccess.output terminal.output
testsuccess grep '^REWRITE ' terminal.output
- testsuccess grep ' root root ' terminal.output
+ testsuccess grep 'TRIGGER IS RUNNING' terminal.output
testdpkginstalled triggerable-$TYPE trigdepends-$TYPE trigstuff
testsuccess aptget purge trigstuff -y
cp rootdir/tmp/testsuccess.output terminal.output
testsuccess grep '^REWRITE ' terminal.output
- testsuccess grep ' root root ' terminal.output
+ testsuccess grep 'TRIGGER IS RUNNING' terminal.output
testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
testdpkgnotinstalled trigstuff
testsuccess aptget purge trigdepends-$TYPE -y
cp rootdir/tmp/testsuccess.output terminal.output
testfailure grep '^REWRITE ' terminal.output
- testfailure grep ' root root ' terminal.output
+ testfailure grep 'TRIGGER IS RUNNING' terminal.output
testdpkgnotinstalled triggerable-$TYPE trigdepends-$TYPE
}
#runtests 'interest'
diff --git a/test/integration/test-no-fds-leaked-to-maintainer-scripts b/test/integration/test-no-fds-leaked-to-maintainer-scripts
index baf85e311..ca93f78b4 100755
--- a/test/integration/test-no-fds-leaked-to-maintainer-scripts
+++ b/test/integration/test-no-fds-leaked-to-maintainer-scripts
@@ -8,6 +8,11 @@ setupenvironment
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