]> git.saurik.com Git - apt.git/blame - test/integration/test-dpkg-assert-multi-arch
various changes to increase test-coverage
[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
eb191ca3 29msgmsg 'non-multiarch or "ubuntus" old multiarchified dpkg'
86fc2ca8 30echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
eb191ca3
DK
31cat > ./dpkg-wrapper <<EOF
32#! /bin/sh
33if echo "\$*" | grep -q -- "--assert-multi-arch"; then
67b5d3dc
DK
34 echo >&2 'dpkg: Fehler: unbekannte Option --assert-multi-arch'
35 echo >&1 'dpkg: Info: unbekannte Option --assert-multi-arch'
eb191ca3 36 exit 2
86fc2ca8 37fi
eb191ca3
DK
38exec "\$@"
39EOF
86fc2ca8
DK
40chmod +x ./dpkg-wrapper
41
42testqualifier 'native-pkg' 'native-pkg'
43testqualifier 'native-pkg:amd64' 'native-pkg'
44testqualifier 'foreign-pkg' 'foreign-pkg:i386'
45testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386'
46testqualifier 'same-lib' 'same-lib'
47testqualifier 'same-lib:amd64' 'same-lib'
48testqualifier 'same-lib:i386' 'same-lib:i386'
3a5ec305
DK
49testqualifier 'all-pkg' 'all-pkg'
50testqualifier 'all-pkg:amd64' 'all-pkg'
51testqualifier 'all-foreign-pkg' 'all-foreign-pkg'
52testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg'
53insertinstalledpackage 'all-pkg' 'amd64' '1.0'
2a2a7ef4 54insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' 'Multi-Arch: foreign'
3a5ec305
DK
55testqualifier 'all-pkg' 'all-pkg'
56testqualifier 'all-pkg:amd64' 'all-pkg'
57testqualifier 'all-foreign-pkg' 'all-foreign-pkg'
58testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg'
2a2a7ef4
DK
59insertinstalledpackage 'always-all-pkg' 'all' '1.0'
60insertinstalledpackage 'always-all-foreign-pkg' 'all' '1.0' 'Multi-Arch: foreign'
61testqualifier 'all-pkg-' 'all-pkg'
62testqualifier 'all-foreign-pkg-' 'all-foreign-pkg'
63testqualifier 'always-all-pkg-' 'always-all-pkg'
64testqualifier 'always-all-foreign-pkg-' 'always-all-foreign-pkg'
86fc2ca8 65
eb191ca3 66msgmsg 'multiarch dpkg (new interface version)'
3a5ec305
DK
67rm rootdir/var/lib/dpkg/status
68touch rootdir/var/lib/dpkg/status
86fc2ca8 69echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
eb191ca3
DK
70cat > ./dpkg-wrapper <<EOF
71#! /bin/sh
72if echo "\$*" | grep -q -- "--assert-multi-arch"; then
73 exit 0
74fi
75exec "\$@"
76EOF
77chmod +x ./dpkg-wrapper
86fc2ca8
DK
78
79testqualifier 'native-pkg' 'native-pkg:amd64'
80testqualifier 'native-pkg:amd64' 'native-pkg:amd64'
81testqualifier 'foreign-pkg' 'foreign-pkg:i386'
82testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386'
83testqualifier 'same-lib' 'same-lib:amd64'
84testqualifier 'same-lib:amd64' 'same-lib:amd64'
85testqualifier 'same-lib:i386' 'same-lib:i386'
3a5ec305
DK
86testqualifier 'all-pkg' 'all-pkg:all'
87testqualifier 'all-pkg:amd64' 'all-pkg:all'
88testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all'
89testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all'
90insertinstalledpackage 'all-pkg' 'amd64' '1.0'
2a2a7ef4 91insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' 'Multi-Arch: foreign'
3a5ec305
DK
92testqualifier 'all-pkg' 'all-pkg:all'
93testqualifier 'all-pkg:amd64' 'all-pkg:all'
94testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all'
95testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all'
2a2a7ef4
DK
96insertinstalledpackage 'always-all-pkg' 'all' '1.0'
97insertinstalledpackage 'always-all-foreign-pkg' 'all' '1.0' 'Multi-Arch: foreign'
98testqualifier 'all-pkg-' 'all-pkg:amd64'
99testqualifier 'all-foreign-pkg-' 'all-foreign-pkg:amd64'
100testqualifier 'always-all-pkg-' 'always-all-pkg:all'
101testqualifier 'always-all-foreign-pkg-' 'always-all-foreign-pkg:all'