summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-helper-cat-file
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-06-09 21:06:48 +0200
committerJulian Andres Klode <jak@debian.org>2016-06-10 15:25:19 +0200
commit49997ef025ee454283722a01210c169ca8910a98 (patch)
tree58f2355cc6aacdfa0b3a375e545b3ec74d853086 /test/integration/test-apt-helper-cat-file
parent36feef0dc51c444de1449ba26a0bf2248716591d (diff)
don't leak an FD in lz4 (de)compression
Seen first in #826783, but as this buglog also shows leaked uncompressed files as well we don't close it just yet. (cherry picked from commit 6f35be91c9e86e463bca7df6eadf05412c7b732c)
Diffstat (limited to 'test/integration/test-apt-helper-cat-file')
-rwxr-xr-xtest/integration/test-apt-helper-cat-file16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/integration/test-apt-helper-cat-file b/test/integration/test-apt-helper-cat-file
index f7c94a2b4..3f509189e 100755
--- a/test/integration/test-apt-helper-cat-file
+++ b/test/integration/test-apt-helper-cat-file
@@ -5,6 +5,15 @@ TESTDIR="$(readlink -f "$(dirname "$0")")"
. "$TESTDIR/framework"
setupenvironment
+TESTTOOL="${BUILDDIRECTORY}/test_fileutl"
+msgtest 'Check if we have build the test tool' "$TESTTOOL"
+if [ -x "$TESTTOOL" ]; then
+ msgpass
+else
+ msgskip 'not available'
+ exit 0
+fi
+
cat >rootdir/etc/apt/apt.conf.d/rev-as-compressor <<EOF
APT::Compressor::rev {
Name "rev";
@@ -26,5 +35,12 @@ while read compressor extension command; do
else
FILE="./test.txt.${extension}"
fi
+ if [ -d /proc/self/fd ]; then
+ testsuccess runapt "${TESTTOOL}" "$FILE"
+ testequal '3' grep -c '/test.txt' rootdir/tmp/testsuccess.output
+ else
+ msgtest 'Test if /proc interface is available'
+ msgskip 'seems not'
+ fi
testsuccessequal "$(cat ./test.txt)" apthelper cat-file "$FILE"
done < "${TMPWORKINGDIRECTORY}/rootdir/etc/testcase-compressor.conf"