]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-helper-cat-file
test, travis: Quieter testing with a new -qq mode
[apt.git] / test / integration / test-apt-helper-cat-file
CommitLineData
bdc42211
DK
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
6setupenvironment
7
dfd863ea 8TESTTOOL="${BUILDDIRECTORY}/../test/interactive-helper/test_fileutl"
6f35be91
DK
9msgtest 'Check if we have build the test tool' "$TESTTOOL"
10if [ -x "$TESTTOOL" ]; then
11 msgpass
12else
13 msgskip 'not available'
14 exit 0
15fi
16
bdc42211
DK
17cat >rootdir/etc/apt/apt.conf.d/rev-as-compressor <<EOF
18APT::Compressor::rev {
19 Name "rev";
20 Extension ".rev";
21 Binary "rev";
22 Cost "1";
23};
24EOF
25
26configcompression 'ALL'
27cat >./test.txt <<EOF
28This is a test.
29EOF
30
31compressfile ./test.txt
32while read compressor extension command; do
33 if [ "$compressor" = '.' ]; then
34 FILE='./test.txt'
35 else
36 FILE="./test.txt.${extension}"
37 fi
6f35be91
DK
38 if [ -d /proc/self/fd ]; then
39 testsuccess runapt "${TESTTOOL}" "$FILE"
40 testequal '3' grep -c '/test.txt' rootdir/tmp/testsuccess.output
41 else
42 msgtest 'Test if /proc interface is available'
43 msgskip 'seems not'
44 fi
bdc42211
DK
45 testsuccessequal "$(cat ./test.txt)" apthelper cat-file "$FILE"
46done < "${TMPWORKINGDIRECTORY}/rootdir/etc/testcase-compressor.conf"