]> git.saurik.com Git - apt.git/blame - test/integration/test-bug-612958-use-dpkg-multiarch-config
merged from donkult
[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
59testpass 'dpkg config' 'armel'