]> git.saurik.com Git - apt.git/blob - test/integration/test-apt-helper-cat-file
pass --force-remove-essential to dpkg only if needed
[apt.git] / test / integration / test-apt-helper-cat-file
1 #!/bin/sh
2 set -e
3
4 TESTDIR="$(readlink -f "$(dirname "$0")")"
5 . "$TESTDIR/framework"
6 setupenvironment
7
8 TESTTOOL="${BUILDDIRECTORY}/../test/interactive-helper/test_fileutl"
9 msgtest 'Check if we have build the test tool' "$TESTTOOL"
10 if [ -x "$TESTTOOL" ]; then
11 msgpass
12 else
13 msgskip 'not available'
14 exit 0
15 fi
16
17 cat >rootdir/etc/apt/apt.conf.d/rev-as-compressor <<EOF
18 APT::Compressor::rev {
19 Name "rev";
20 Extension ".rev";
21 Binary "rev";
22 Cost "1";
23 };
24 EOF
25
26 configcompression 'ALL'
27 cat >./test.txt <<EOF
28 This is a test.
29 EOF
30
31 compressfile ./test.txt
32 while read compressor extension command; do
33 if [ "$compressor" = '.' ]; then
34 FILE='./test.txt'
35 else
36 FILE="./test.txt.${extension}"
37 fi
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
45 testsuccessequal "$(cat ./test.txt)" apthelper cat-file "$FILE"
46 done < "${TMPWORKINGDIRECTORY}/rootdir/etc/testcase-compressor.conf"