summaryrefslogtreecommitdiff
path: root/test/integration/test-bug-618288-multiarch-same-lockstep
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-05-17 12:37:13 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2014-05-22 17:43:48 +0200
commit0eb4af9d3d0c524c7afdc684238aa263ac287449 (patch)
tree61c084289cd12fb924e82af1d1092a2ee00def18 /test/integration/test-bug-618288-multiarch-same-lockstep
parent71e7a0f3a432828e5bd5498297051aa37e7f0a59 (diff)
fix tight loop detection and temporary removes
As outlined in #748355 apt segfaulted if it encountered a loop between a package pre-depending on a package conflicting with the previous as it ended up in an endless loop trying to unpack 'the other package'. In this specific case as an essential package is involved a lot of force needs to be applied, but can also be caused by 'normal' tight loops and highlights a problem in how we handle breaks which we want to avoid. The fix comes in multiple entangled changes: 1. All Smart* calls are guarded with loop detection. Some already had it, some had parts of it, some did it incorrect, and some didn't even try. 2. temporary removes to avoid a loop (which is done if a loop is detected) prevent the unpack of this looping package (we tried to unpack it to avoid the conflict/breaks, but due to a loop we couldn't, so we remove/deconfigure it instead which means we can't unpack it now) 3. handle conflicts and breaks very similar instead of duplicating most of the code. The only remaining difference is, as it should: deconfigure is enough for breaks, for conflicts we need the big hammer
Diffstat (limited to 'test/integration/test-bug-618288-multiarch-same-lockstep')
-rwxr-xr-xtest/integration/test-bug-618288-multiarch-same-lockstep19
1 files changed, 10 insertions, 9 deletions
diff --git a/test/integration/test-bug-618288-multiarch-same-lockstep b/test/integration/test-bug-618288-multiarch-same-lockstep
index e0305b64b..536124c2c 100755
--- a/test/integration/test-bug-618288-multiarch-same-lockstep
+++ b/test/integration/test-bug-618288-multiarch-same-lockstep
@@ -16,22 +16,23 @@ buildsimplenativepackage 'apt' 'i386' '2' 'unstable' 'Depends: libsame (= 2)' ''
buildsimplenativepackage 'apt2' 'amd64' '2' 'unstable' 'Depends: libsame (= 2)' '' 'required'
setupaptarchive
-aptget dist-upgrade -s >output.apt 2>&1
+testsuccess aptget dist-upgrade -s -o Debug::pkgPackageManager=1
# order in switch libsame:{amd64,i386} are unpacked is irrelevant, as both are installed - but we need to do it together
-LS_U_AMD="$(grep -o -n '^Inst libsame ' output.apt | cut -d: -f1)"
-LS_U_INT="$(grep -o -n '^Inst libsame:i386 ' output.apt | cut -d: -f1)"
-LS_C_AMD="$(grep -o -n '^Conf libsame ' output.apt | cut -d: -f1)"
-LS_C_INT="$(grep -o -n '^Conf libsame:i386 ' output.apt | cut -d: -f1)"
+OUTPUT=rootdir/tmp/testsuccess.output
+LS_U_AMD="$(grep -o -n '^Inst libsame ' $OUTPUT | cut -d: -f1)"
+LS_U_INT="$(grep -o -n '^Inst libsame:i386 ' $OUTPUT | cut -d: -f1)"
+LS_C_AMD="$(grep -o -n '^Conf libsame ' $OUTPUT | cut -d: -f1)"
+LS_C_INT="$(grep -o -n '^Conf libsame:i386 ' $OUTPUT | cut -d: -f1)"
-msgtest 'Test if libsame:amd64 unpack before configure'
+msgtest 'Test if' 'libsame:amd64 unpack before configure'
test "$LS_U_AMD" -lt "$LS_C_AMD" && msgpass || msgfail
-msgtest 'Test if libsame:i386 unpack before configure'
+msgtest 'Test if' 'libsame:i386 unpack before configure'
test "$LS_U_INT" -lt "$LS_C_INT" && msgpass || msgfail
-msgtest 'Test if libsame:amd64 unpack is before libsame:i386 configure'
+msgtest 'Test if' 'libsame:amd64 unpack is before libsame:i386 configure'
test "$LS_U_AMD" -lt "$LS_C_INT" && msgpass || msgfail
-msgtest 'Test if libsame:i386 unpack is before libsame:amd64 configure'
+msgtest 'Test if' 'libsame:i386 unpack is before libsame:amd64 configure'
test "$LS_U_INT" -lt "$LS_C_AMD" && msgpass || msgfail