summaryrefslogtreecommitdiff
path: root/test/integration/test-crossgrades
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-07-25 16:36:53 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-08-10 23:51:34 +0200
commit83e5cffc2015aa809acac84737756d292d7bf106 (patch)
tree6f6a6c75317d521bdd9cce917856841af9b4767c /test/integration/test-crossgrades
parentbfc0933abedcd57e0a5bd07e282f3a50ba1fa5b2 (diff)
try to avoid removal of crossgraded packages
The user has to approve the removal of a crossgraded package as it might be needed to remove it (temporarily) in the process, but in most cases we can happily avoid it and let dpkg unpack over it skipping the remove. This has some effects on progress reporting and how deal with selections through which makes this a tiny bit complicated.
Diffstat (limited to 'test/integration/test-crossgrades')
-rwxr-xr-xtest/integration/test-crossgrades49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/integration/test-crossgrades b/test/integration/test-crossgrades
new file mode 100755
index 000000000..d412546c1
--- /dev/null
+++ b/test/integration/test-crossgrades
@@ -0,0 +1,49 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+
+setupenvironment
+configarchitecture 'i386' 'amd64' 'armel'
+configdpkgnoopchroot
+
+buildsimplenativepackage 'unrelated' 'amd64' '1' 'stable'
+buildsimplenativepackage 'crosser' 'i386,armel' '1' 'stable' 'Multi-Arch: same'
+buildsimplenativepackage 'crosser' 'amd64' '2' 'unstable'
+setupaptarchive
+
+singleinstance() {
+ testsuccess apt install crosser:i386=1 unrelated:amd64 -y --planner $1
+ testdpkginstalled 'crosser:i386' 'unrelated'
+
+ testsuccess apt install crosser:amd64 -y -o Debug::pkgDpkgPm=1 -o Dpkg::Use-Pty=0 --purge --planner $1
+ cp -a rootdir/tmp/testsuccess.output crosser.output
+ testfailure grep -- '--remove.*crosser.*' crosser.output
+ testfailure grep -- '--purge' crosser.output
+ testsuccess apt install crosser:amd64 unrelated:amd64- -y -o Dpkg::Use-Pty=0 --purge -o Debug::pkgDPkgProgressReporting=1 --planner $1
+ testdpkgnotinstalled 'crosser:i386' 'unrelated'
+ testdpkginstalled 'crosser:amd64'
+
+ testsuccess apt purge crosser:amd64 -y --planner $1
+ testdpkgnotinstalled 'crosser:amd64'
+}
+singleinstance 'internal'
+singleinstance 'apt'
+
+multiinstance() {
+ testsuccess apt install crosser:i386=1 crosser:armel=1 unrelated:amd64 -y --planner $1
+ testdpkginstalled 'crosser:i386' 'crosser:armel' 'unrelated'
+
+ testsuccess apt install crosser:amd64 -y -o Debug::pkgDpkgPm=1 -o Dpkg::Use-Pty=0 --purge --planner $1
+ cp -a rootdir/tmp/testsuccess.output crosser.output
+ testsuccess grep -- '--remove.*crosser.*' crosser.output
+ testsuccess grep -- '--purge' crosser.output
+ testsuccess apt install crosser:amd64 unrelated:amd64- -y -o Dpkg::Use-Pty=0 --purge -o Debug::pkgDPkgProgressReporting=1 --planner $1
+ testdpkgnotinstalled 'crosser:i386' 'crosser:armel' 'unrelated'
+ testdpkginstalled 'crosser:amd64'
+
+ testsuccess apt purge crosser:amd64 -y --planner $1
+ testdpkgnotinstalled 'crosser:amd64'
+}
+multiinstance 'internal'