]> git.saurik.com Git - apt.git/blame - test/integration/test-bug-612958-use-dpkg-multiarch-config
add an additional test for arch specific conflicts
[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"
0440d936 17 testsuccess --nomsg aptcache show libapt:$2
8aec002f
DK
18}
19
20testfail() {
21 rm rootdir/var/cache/apt/*.bin
22 msgtest 'Test architecture handling' "$1 with $2"
0440d936 23 testfailure --nomsg aptcache show libapt:$2
8aec002f
DK
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
a1b6a4e7
DK
45echo '#clear APT::Architectures;' >> $CONFFILE
46echo 'APT::Architectures "i386,amd64";' >> $CONFFILE
47
48testpass 'apt config' 'i386'
49testpass 'apt config' 'amd64'
50testfail 'apt config' 'armel'
51
52rm $CONFFILE
53
8aec002f
DK
54echo '#clear APT::Architectures;' >> $CONFFILE
55echo 'Dir::Bin::dpkg "./dpkg-printer";' >> $CONFFILE
56
57echo '#! /bin/sh
58echo "amd64"' > ./dpkg-printer
59chmod +x ./dpkg-printer
60
61testpass 'dpkg config' 'i386'
62testpass 'dpkg config' 'amd64'
63testfail 'dpkg config' 'armel'
64
65echo '#! /bin/sh
66echo "amd64 armel"' > ./dpkg-printer
67
4df62de6
DK
68testpass 'dpkg config' 'i386'
69testpass 'dpkg config' 'amd64'
70testpass 'dpkg config' 'armel'
71
72echo '#! /bin/sh
73echo "amd64
74armel"' > ./dpkg-printer
75
76testpass 'dpkg config' 'i386'
77testpass 'dpkg config' 'amd64'
8aec002f 78testpass 'dpkg config' 'armel'
4df62de6
DK
79
80echo '#! /bin/sh
81echo "amd64
82i386"' > ./dpkg-printer
83
84testpass 'dpkg config' 'i386'
85testpass 'dpkg config' 'amd64'
86testfail 'dpkg config' 'armel'