]> git.saurik.com Git - apt.git/blame - test/integration/test-bug-612958-use-dpkg-multiarch-config
properly format multiline error messages
[apt.git] / test / integration / test-bug-612958-use-dpkg-multiarch-config
CommitLineData
8aec002f
DK
1#!/bin/sh
2set -e
3
3abb6a6a
DK
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
8aec002f
DK
6setupenvironment
7configarchitecture 'i386'
8aec002f
DK
8
9testpass() {
7f8c0eed
DK
10 msgtest 'Test architecture handling success' "$1 with $2"
11 rm -f archs.conf
12 aptconfig dump --no-empty --format='%V%n' APT::Architectures > archs.conf
13 testsuccess --nomsg grep "^$2\$" archs.conf
8aec002f
DK
14}
15
16testfail() {
7f8c0eed
DK
17 msgtest 'Test architecture handling failure' "$1 with $2"
18 rm -f archs.conf
19 aptconfig dump --no-empty --format='%V%n' APT::Architectures > archs.conf
20 testfailure --nomsg grep "^$2\$" archs.conf
8aec002f
DK
21}
22
23testpass 'no config' 'i386'
24testfail 'no config' 'amd64'
25testfail 'no config' 'armel'
26
27CONFFILE=rootdir/etc/apt/apt.conf.d/99multiarch
28echo '#clear APT::Architectures;' >> $CONFFILE
29echo 'APT::Architectures:: "i386";' >> $CONFFILE
30echo 'APT::Architectures:: "amd64";' >> $CONFFILE
31
32testpass 'apt config' 'i386'
33testpass 'apt config' 'amd64'
34testfail 'apt config' 'armel'
35
36echo 'APT::Architectures:: "armel";' >> $CONFFILE
37
38testpass 'apt config' 'armel'
39
40rm $CONFFILE
41
a1b6a4e7
DK
42echo '#clear APT::Architectures;' >> $CONFFILE
43echo 'APT::Architectures "i386,amd64";' >> $CONFFILE
44
45testpass 'apt config' 'i386'
46testpass 'apt config' 'amd64'
47testfail 'apt config' 'armel'
48
49rm $CONFFILE
50
8aec002f
DK
51echo '#clear APT::Architectures;' >> $CONFFILE
52echo 'Dir::Bin::dpkg "./dpkg-printer";' >> $CONFFILE
53
54echo '#! /bin/sh
55echo "amd64"' > ./dpkg-printer
56chmod +x ./dpkg-printer
57
58testpass 'dpkg config' 'i386'
59testpass 'dpkg config' 'amd64'
60testfail 'dpkg config' 'armel'
61
62echo '#! /bin/sh
63echo "amd64 armel"' > ./dpkg-printer
64
4df62de6
DK
65testpass 'dpkg config' 'i386'
66testpass 'dpkg config' 'amd64'
67testpass 'dpkg config' 'armel'
68
69echo '#! /bin/sh
70echo "amd64
71armel"' > ./dpkg-printer
72
73testpass 'dpkg config' 'i386'
74testpass 'dpkg config' 'amd64'
8aec002f 75testpass 'dpkg config' 'armel'
4df62de6
DK
76
77echo '#! /bin/sh
78echo "amd64
79i386"' > ./dpkg-printer
80
81testpass 'dpkg config' 'i386'
82testpass 'dpkg config' 'amd64'
83testfail 'dpkg config' 'armel'