]> git.saurik.com Git - apt.git/blame - test/integration/test-bug-612958-use-dpkg-multiarch-config
* cmdline/apt-get.cc:
[apt.git] / test / integration / test-bug-612958-use-dpkg-multiarch-config
CommitLineData
8aec002f
DK
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6setupenvironment
7configarchitecture 'i386'
8setupaptarchive
9
10insertinstalledpackage 'libapt' 'i386' '1.0'
11insertinstalledpackage 'libapt' 'amd64' '1.0'
12insertinstalledpackage 'libapt' 'armel' '1.0'
13
14testpass() {
15 rm rootdir/var/cache/apt/*.bin
16 msgtest 'Test architecture handling' "$1 with $2"
17 aptcache show libapt:$2 2> /dev/null > /dev/null && msgpass || msgfail
18}
19
20testfail() {
21 rm rootdir/var/cache/apt/*.bin
22 msgtest 'Test architecture handling' "$1 with $2"
23 aptcache show libapt:$2 2> /dev/null > /dev/null && msgfail || msgpass
24}
25
26testpass 'no config' 'i386'
27testfail 'no config' 'amd64'
28testfail 'no config' 'armel'
29
30CONFFILE=rootdir/etc/apt/apt.conf.d/99multiarch
31echo '#clear APT::Architectures;' >> $CONFFILE
32echo 'APT::Architectures:: "i386";' >> $CONFFILE
33echo 'APT::Architectures:: "amd64";' >> $CONFFILE
34
35testpass 'apt config' 'i386'
36testpass 'apt config' 'amd64'
37testfail 'apt config' 'armel'
38
39echo 'APT::Architectures:: "armel";' >> $CONFFILE
40
41testpass 'apt config' 'armel'
42
43rm $CONFFILE
44
45echo '#clear APT::Architectures;' >> $CONFFILE
46echo 'Dir::Bin::dpkg "./dpkg-printer";' >> $CONFFILE
47
48echo '#! /bin/sh
49echo "amd64"' > ./dpkg-printer
50chmod +x ./dpkg-printer
51
52testpass 'dpkg config' 'i386'
53testpass 'dpkg config' 'amd64'
54testfail 'dpkg config' 'armel'
55
56echo '#! /bin/sh
57echo "amd64 armel"' > ./dpkg-printer
58
4df62de6
DK
59testpass 'dpkg config' 'i386'
60testpass 'dpkg config' 'amd64'
61testpass 'dpkg config' 'armel'
62
63echo '#! /bin/sh
64echo "amd64
65armel"' > ./dpkg-printer
66
67testpass 'dpkg config' 'i386'
68testpass 'dpkg config' 'amd64'
8aec002f 69testpass 'dpkg config' 'armel'
4df62de6
DK
70
71echo '#! /bin/sh
72echo "amd64
73i386"' > ./dpkg-printer
74
75testpass 'dpkg config' 'i386'
76testpass 'dpkg config' 'amd64'
77testfail 'dpkg config' 'armel'