]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-bug-612958-use-dpkg-multiarch-config
add apt-key support for armored GPG key files (*.asc)
[apt.git] / test / integration / test-bug-612958-use-dpkg-multiarch-config
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
6setupenvironment
7configarchitecture 'i386'
8
9testpass() {
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
14}
15
16testfail() {
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
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
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
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
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'
75testpass 'dpkg config' 'armel'
76
77echo '#! /bin/sh
78echo "amd64
79i386"' > ./dpkg-printer
80
81testpass 'dpkg config' 'i386'
82testpass 'dpkg config' 'amd64'
83testfail 'dpkg config' 'armel'