]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-dpkg-assert-multi-arch
tests: support spaces in path and TMPDIR
[apt.git] / test / integration / test-dpkg-assert-multi-arch
... / ...
CommitLineData
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'
12buildsimplenativepackage 'all-pkg' 'all' '2.0' 'stable'
13buildsimplenativepackage 'all-foreign-pkg' 'all' '2.0' 'stable' 'Multi-Arch: foreign'
14
15setupaptarchive
16
17testqualifier() {
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/')"
20 if [ "$GIVEN" = "$2" ]; then
21 msgpass
22 else
23 echo
24 echo "$GIVEN"
25 msgfail
26 fi
27}
28
29msgmsg 'non-multiarch or "ubuntus" old multiarchified dpkg'
30echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
31cat > ./dpkg-wrapper <<EOF
32#! /bin/sh
33if echo "\$*" | grep -q -- "--assert-multi-arch"; then
34 echo >&2 'dpkg: Fehler: unbekannte Option --assert-multi-arch'
35 echo >&1 'dpkg: Info: unbekannte Option --assert-multi-arch'
36 exit 2
37fi
38exec "\$@"
39EOF
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'
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'
54insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' 'Multi-Arch: foreign'
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'
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'
65
66msgmsg 'multiarch dpkg (new interface version)'
67rm rootdir/var/lib/dpkg/status
68touch rootdir/var/lib/dpkg/status
69echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
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
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'
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'
91insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' 'Multi-Arch: foreign'
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'
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'