summaryrefslogtreecommitdiff
path: root/test/integration/test-essential-force-loopbreak
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-06-10 19:00:41 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-06-10 19:00:41 +0200
commitafaeea148553439684e6091f282bf5a4ee5c00d6 (patch)
tree9de4549d414a78bed64a2a20f7941695c7d6c4df /test/integration/test-essential-force-loopbreak
parentb4278cc96fa0184b4f522e2bcfe82bd8eba93595 (diff)
parenteea0f3a6197dba565c5df349ed06c0a70b49b77f (diff)
Merge branch 'debian/sid' into ubuntu/master1.0.4ubuntu1
Conflicts: configure.ac debian/changelog
Diffstat (limited to 'test/integration/test-essential-force-loopbreak')
-rwxr-xr-xtest/integration/test-essential-force-loopbreak51
1 files changed, 51 insertions, 0 deletions
diff --git a/test/integration/test-essential-force-loopbreak b/test/integration/test-essential-force-loopbreak
new file mode 100755
index 000000000..d60c6cbd5
--- /dev/null
+++ b/test/integration/test-essential-force-loopbreak
@@ -0,0 +1,51 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture 'native'
+
+insertinstalledpackage 'sysvinit' 'native' '1' 'Essential: yes'
+
+buildsimplenativepackage 'sysvinit' 'native' '2' 'sid' 'Pre-Depends: sysvinit-core | systemd-sysv
+Essential: yes'
+buildsimplenativepackage 'sysvinit-core' 'native' '2' 'sid'
+
+buildsimplenativepackage 'systemd-sysv' 'native' '2~conflict' 'sid-conflict' 'Conflicts: sysvinit (<< 2)
+Breaks: sysvinit-core'
+
+buildsimplenativepackage 'systemd-sysv' 'native' '2~break' 'sid-break' 'Breaks: sysvinit (<< 2), sysvinit-core'
+
+setupaptarchive
+
+cp -a rootdir/var/lib/dpkg/status dpkg.status.backup
+
+testforcebreak() {
+ cp -a dpkg.status.backup rootdir/var/lib/dpkg/status
+ rm -f rootdir/var/lib/apt/extended_states
+ testequal "Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+ sysvinit
+The following NEW packages will be installed:
+ systemd-sysv
+The following packages will be upgraded:
+ sysvinit
+1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+E: This installation run will require temporarily removing the essential package sysvinit:$(getarchitecture 'native') due to a Conflicts/Pre-Depends loop. This is often bad, but if you really want to do it, activate the APT::Force-LoopBreak option.
+E: Internal Error, Could not early remove sysvinit:amd64 (2)" aptget install systemd-sysv -t "$1" -s
+ # ensure that really nothing happens
+ testfailure aptget install systemd-sysv -y -t "$1" -o Debug::pkgPackageManager=1
+ testdpkginstalled 'sysvinit'
+ testdpkgnotinstalled 'systemd-sysv'
+
+ # with enough force however …
+ cp -a dpkg.status.backup rootdir/var/lib/dpkg/status
+ testsuccess aptget install systemd-sysv -y -t "$1" -o Debug::pkgPackageManager=1 -o APT::Force-LoopBreak=1
+ testdpkginstalled 'sysvinit' 'systemd-sysv'
+}
+
+testforcebreak 'sid-conflict'
+testforcebreak 'sid-break'