summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2019-09-19 10:16:26 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2019-09-19 10:37:55 +0200
commit8a54113d450140bd6b158cb05473cacca859a54d (patch)
treeda98535a1604e8a39060a775896cf434ba7820c6 /test
parentb9127ca07c37288f16b1fdc267d3f106721ed301 (diff)
downloadapt-8a54113d450140bd6b158cb05473cacca859a54d.tar.gz
Pass --abort-after=1 to dpkg when using --force-depends
Using --force-depends causes dpkg to continue removing packages a package depends upon even if that package fails to be removed, because dpkg turns off all sanity checks. So we gotta tell dpkg to stop immediately if there's an error removing stuff. Closes: #935910 LP: #1844634
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-apt-get-remove-depends29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/integration/test-apt-get-remove-depends b/test/integration/test-apt-get-remove-depends
new file mode 100755
index 000000000..2d2cf0dd6
--- /dev/null
+++ b/test/integration/test-apt-get-remove-depends
@@ -0,0 +1,29 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+setupenvironment
+configarchitecture 'i386'
+
+buildsimplenativepackage 'alpha' 'all' '1' 'unstable' 'Depends: beta'
+buildsimplenativepackage 'beta' 'all' '1' 'unstable'
+setupaptarchive
+
+testsuccess aptget install alpha -y
+
+cat > rootdir/var/lib/dpkg/info/alpha.prerm << EOF
+#!/bin/sh
+exit 42
+EOF
+chmod 755 rootdir/var/lib/dpkg/info/alpha.prerm
+
+
+testdpkginstalled 'alpha' 'beta'
+
+
+testfailure aptget remove -y beta
+
+# Beta should not be removed because alpha failed to be removed and depends on it
+
+testdpkginstalled 'alpha' 'beta'