]> git.saurik.com Git - apt.git/blame - test/integration/test-crossgrades
don't perform implicit crossgrades involving M-A:same
[apt.git] / test / integration / test-crossgrades
CommitLineData
83e5cffc
DK
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
6
7setupenvironment
8configarchitecture 'i386' 'amd64' 'armel'
9configdpkgnoopchroot
10
11buildsimplenativepackage 'unrelated' 'amd64' '1' 'stable'
12buildsimplenativepackage 'crosser' 'i386,armel' '1' 'stable' 'Multi-Arch: same'
13buildsimplenativepackage 'crosser' 'amd64' '2' 'unstable'
4b10240c 14buildsimplenativepackage 'crosser' 'i386,armel' '3' 'experimental' 'Multi-Arch: same'
83e5cffc
DK
15setupaptarchive
16
17singleinstance() {
18 testsuccess apt install crosser:i386=1 unrelated:amd64 -y --planner $1
19 testdpkginstalled 'crosser:i386' 'unrelated'
20
21 testsuccess apt install crosser:amd64 -y -o Debug::pkgDpkgPm=1 -o Dpkg::Use-Pty=0 --purge --planner $1
22 cp -a rootdir/tmp/testsuccess.output crosser.output
23 testfailure grep -- '--remove.*crosser.*' crosser.output
24 testfailure grep -- '--purge' crosser.output
25 testsuccess apt install crosser:amd64 unrelated:amd64- -y -o Dpkg::Use-Pty=0 --purge -o Debug::pkgDPkgProgressReporting=1 --planner $1
26 testdpkgnotinstalled 'crosser:i386' 'unrelated'
27 testdpkginstalled 'crosser:amd64'
28
53f3fc59
DK
29 testsuccess apt install crosser:armel=3 -y -o Debug::pkgDpkgPm=1 -o Dpkg::Use-Pty=0 --purge --planner $1
30 cp -a rootdir/tmp/testsuccess.output crosser.output
31 testsuccess grep -- '--remove.*crosser.*' crosser.output
32 testsuccess grep -- '--purge' crosser.output
33 testsuccess apt install crosser:armel=3 -y -o Debug::pkgDPkgProgressReporting=1 -o Dpkg::Use-Pty=0 --purge --planner $1
34 testdpkgnotinstalled 'crosser:i386' 'crosser:amd64' 'unrelated'
35 testdpkginstalled 'crosser:armel'
36
37 testsuccess apt install crosser=1 -y -o Debug::pkgDpkgPm=1 -o Dpkg::Use-Pty=0 --purge --planner $1 --allow-downgrades
38 cp -a rootdir/tmp/testsuccess.output crosser.output
39 testsuccess grep -- '--remove.*crosser.*' crosser.output
40 testsuccess grep -- '--purge' crosser.output
41 testsuccess apt install crosser=1 -y -o Debug::pkgDPkgProgressReporting=1 -o Dpkg::Use-Pty=0 --purge --planner $1 --allow-downgrades
42 testdpkgnotinstalled 'crosser:armel' 'crosser:amd64' 'unrelated'
43 testdpkginstalled 'crosser:i386'
44
45 testsuccess apt purge crosser:i386 -y --planner $1
46 testdpkgnotinstalled 'crosser:i386'
83e5cffc
DK
47}
48singleinstance 'internal'
49singleinstance 'apt'
50
51multiinstance() {
52 testsuccess apt install crosser:i386=1 crosser:armel=1 unrelated:amd64 -y --planner $1
53 testdpkginstalled 'crosser:i386' 'crosser:armel' 'unrelated'
54
55 testsuccess apt install crosser:amd64 -y -o Debug::pkgDpkgPm=1 -o Dpkg::Use-Pty=0 --purge --planner $1
56 cp -a rootdir/tmp/testsuccess.output crosser.output
57 testsuccess grep -- '--remove.*crosser.*' crosser.output
58 testsuccess grep -- '--purge' crosser.output
59 testsuccess apt install crosser:amd64 unrelated:amd64- -y -o Dpkg::Use-Pty=0 --purge -o Debug::pkgDPkgProgressReporting=1 --planner $1
60 testdpkgnotinstalled 'crosser:i386' 'crosser:armel' 'unrelated'
61 testdpkginstalled 'crosser:amd64'
62
4b10240c
DK
63 testsuccess apt install crosser:i386 crosser:armel -t experimental -y -o Debug::pkgDpkgPm=1 -o Dpkg::Use-Pty=0 --purge --planner $1
64 cp -a rootdir/tmp/testsuccess.output crosser.output
65 testsuccess grep -- '--remove.*crosser.*' crosser.output
66 testsuccess grep -- '--purge' crosser.output
67 testsuccess apt install crosser:i386 crosser:armel -t experimental -y -o Debug::pkgDPkgProgressReporting=1 -o Dpkg::Use-Pty=0 --purge --planner $1
68 testdpkgnotinstalled 'crosser:amd64' 'unrelated'
69 testdpkginstalled 'crosser:i386' 'crosser:armel'
70
53f3fc59
DK
71 testsuccess apt install crosser:i386- crosser:armel=1 -y -o Debug::pkgDpkgPm=1 -o Dpkg::Use-Pty=0 --purge --planner $1 --allow-downgrades
72 cp -a rootdir/tmp/testsuccess.output crosser.output
73 testsuccess grep -- '--remove.*crosser.*' crosser.output
74 testsuccess grep -- '--purge' crosser.output
75 testsuccess apt install crosser:i386- crosser:armel=1 -y -o Debug::pkgDPkgProgressReporting=1 -o Dpkg::Use-Pty=0 --purge --planner $1 --allow-downgrades
76 testdpkgnotinstalled 'crosser:amd64' 'crosser:i386' 'unrelated'
77 testdpkginstalled 'crosser:armel'
78
79 testsuccess apt purge crosser:armel -y --planner $1 -o Debug::pkgDPkgProgressReporting=1
80 testdpkgnotinstalled 'crosser:i386' 'crosser:armel' 'crosser:amd64' 'unrelated'
83e5cffc
DK
81}
82multiinstance 'internal'