]> git.saurik.com Git - apt.git/blame - test/integration/test-dpkg-assert-multi-arch
test/integration/framework: use EXIT_CODE to be consistent with the run-tests code
[apt.git] / test / integration / test-dpkg-assert-multi-arch
CommitLineData
86fc2ca8
DK
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6setupenvironment
7configarchitecture 'amd64' 'i386'
8
9buildsimplenativepackage 'native-pkg' 'amd64' '1.0' 'stable'
10buildsimplenativepackage 'foreign-pkg' 'i386' '0.5' 'stable' 'Multi-Arch: foreign'
11buildsimplenativepackage 'same-lib' 'amd64,i386' '0.5' 'stable' 'Multi-Arch: same'
3a5ec305 12buildsimplenativepackage 'all-pkg' 'all' '2.0' 'stable'
2a2a7ef4 13buildsimplenativepackage 'all-foreign-pkg' 'all' '2.0' 'stable' 'Multi-Arch: foreign'
86fc2ca8
DK
14
15setupaptarchive
16
17testqualifier() {
2a2a7ef4
DK
18 msgtest 'Test with' $1 'for correct qualifier mode' $2
19 GIVEN="$(aptget install $1 -qq -o Debug::pkgDPkgPM=1 2>&1 | grep -v -- '--unpack' | sed -e 's/^.*--[^u][^ ]* \([^ ]*\).*$/\1/')"
67b5d3dc
DK
20 if [ "$GIVEN" = "$2" ]; then
21 msgpass
22 else
23 echo
24 echo "$GIVEN"
25 msgfail
26 fi
86fc2ca8
DK
27}
28
29# non-multiarch or "ubuntus" old multiarchified dpkg
30echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
31echo '#! /bin/sh
32if echo "$*" | grep -q -- "--assert-multi-arch"; then
67b5d3dc
DK
33 echo >&2 'dpkg: Fehler: unbekannte Option --assert-multi-arch'
34 echo >&1 'dpkg: Info: unbekannte Option --assert-multi-arch'
86fc2ca8
DK
35 return 2;
36fi
37return $*' > ./dpkg-wrapper
38chmod +x ./dpkg-wrapper
39
40testqualifier 'native-pkg' 'native-pkg'
41testqualifier 'native-pkg:amd64' 'native-pkg'
42testqualifier 'foreign-pkg' 'foreign-pkg:i386'
43testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386'
44testqualifier 'same-lib' 'same-lib'
45testqualifier 'same-lib:amd64' 'same-lib'
46testqualifier 'same-lib:i386' 'same-lib:i386'
3a5ec305
DK
47testqualifier 'all-pkg' 'all-pkg'
48testqualifier 'all-pkg:amd64' 'all-pkg'
49testqualifier 'all-foreign-pkg' 'all-foreign-pkg'
50testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg'
51insertinstalledpackage 'all-pkg' 'amd64' '1.0'
2a2a7ef4 52insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' 'Multi-Arch: foreign'
3a5ec305
DK
53testqualifier 'all-pkg' 'all-pkg'
54testqualifier 'all-pkg:amd64' 'all-pkg'
55testqualifier 'all-foreign-pkg' 'all-foreign-pkg'
56testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg'
2a2a7ef4
DK
57insertinstalledpackage 'always-all-pkg' 'all' '1.0'
58insertinstalledpackage 'always-all-foreign-pkg' 'all' '1.0' 'Multi-Arch: foreign'
59testqualifier 'all-pkg-' 'all-pkg'
60testqualifier 'all-foreign-pkg-' 'all-foreign-pkg'
61testqualifier 'always-all-pkg-' 'always-all-pkg'
62testqualifier 'always-all-foreign-pkg-' 'always-all-foreign-pkg'
86fc2ca8
DK
63
64# multiarch dpkg (new interface version)
65
3a5ec305
DK
66rm rootdir/var/lib/dpkg/status
67touch rootdir/var/lib/dpkg/status
86fc2ca8
DK
68echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
69echo '#! /bin/sh
70if echo "$*" | grep -q -- "--assert-multi-arch"; then
71 return 0;
72fi
73return $*' > ./dpkg-wrapper
74
75testqualifier 'native-pkg' 'native-pkg:amd64'
76testqualifier 'native-pkg:amd64' 'native-pkg:amd64'
77testqualifier 'foreign-pkg' 'foreign-pkg:i386'
78testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386'
79testqualifier 'same-lib' 'same-lib:amd64'
80testqualifier 'same-lib:amd64' 'same-lib:amd64'
81testqualifier 'same-lib:i386' 'same-lib:i386'
3a5ec305
DK
82testqualifier 'all-pkg' 'all-pkg:all'
83testqualifier 'all-pkg:amd64' 'all-pkg:all'
84testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all'
85testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all'
86insertinstalledpackage 'all-pkg' 'amd64' '1.0'
2a2a7ef4 87insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' 'Multi-Arch: foreign'
3a5ec305
DK
88testqualifier 'all-pkg' 'all-pkg:all'
89testqualifier 'all-pkg:amd64' 'all-pkg:all'
90testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all'
91testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all'
2a2a7ef4
DK
92insertinstalledpackage 'always-all-pkg' 'all' '1.0'
93insertinstalledpackage 'always-all-foreign-pkg' 'all' '1.0' 'Multi-Arch: foreign'
94testqualifier 'all-pkg-' 'all-pkg:amd64'
95testqualifier 'all-foreign-pkg-' 'all-foreign-pkg:amd64'
96testqualifier 'always-all-pkg-' 'always-all-pkg:all'
97testqualifier 'always-all-foreign-pkg-' 'always-all-foreign-pkg:all'