]> git.saurik.com Git - apt.git/blob - test/integration/test-bug-612958-use-dpkg-multiarch-config
merged from the debian-sid branch
[apt.git] / test / integration / test-bug-612958-use-dpkg-multiarch-config
1 #!/bin/sh
2 set -e
3
4 TESTDIR=$(readlink -f $(dirname $0))
5 . $TESTDIR/framework
6 setupenvironment
7 configarchitecture 'i386'
8 setupaptarchive
9
10 insertinstalledpackage 'libapt' 'i386' '1.0'
11 insertinstalledpackage 'libapt' 'amd64' '1.0'
12 insertinstalledpackage 'libapt' 'armel' '1.0'
13
14 testpass() {
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
20 testfail() {
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
26 testpass 'no config' 'i386'
27 testfail 'no config' 'amd64'
28 testfail 'no config' 'armel'
29
30 CONFFILE=rootdir/etc/apt/apt.conf.d/99multiarch
31 echo '#clear APT::Architectures;' >> $CONFFILE
32 echo 'APT::Architectures:: "i386";' >> $CONFFILE
33 echo 'APT::Architectures:: "amd64";' >> $CONFFILE
34
35 testpass 'apt config' 'i386'
36 testpass 'apt config' 'amd64'
37 testfail 'apt config' 'armel'
38
39 echo 'APT::Architectures:: "armel";' >> $CONFFILE
40
41 testpass 'apt config' 'armel'
42
43 rm $CONFFILE
44
45 echo '#clear APT::Architectures;' >> $CONFFILE
46 echo 'Dir::Bin::dpkg "./dpkg-printer";' >> $CONFFILE
47
48 echo '#! /bin/sh
49 echo "amd64"' > ./dpkg-printer
50 chmod +x ./dpkg-printer
51
52 testpass 'dpkg config' 'i386'
53 testpass 'dpkg config' 'amd64'
54 testfail 'dpkg config' 'armel'
55
56 echo '#! /bin/sh
57 echo "amd64 armel"' > ./dpkg-printer
58
59 testpass 'dpkg config' 'i386'
60 testpass 'dpkg config' 'amd64'
61 testpass 'dpkg config' 'armel'
62
63 echo '#! /bin/sh
64 echo "amd64
65 armel"' > ./dpkg-printer
66
67 testpass 'dpkg config' 'i386'
68 testpass 'dpkg config' 'amd64'
69 testpass 'dpkg config' 'armel'
70
71 echo '#! /bin/sh
72 echo "amd64
73 i386"' > ./dpkg-printer
74
75 testpass 'dpkg config' 'i386'
76 testpass 'dpkg config' 'amd64'
77 testfail 'dpkg config' 'armel'