diff options
author | David Kalnischkies <david@kalnischkies.de> | 2014-05-17 12:37:13 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2014-05-22 17:43:48 +0200 |
commit | 0eb4af9d3d0c524c7afdc684238aa263ac287449 (patch) | |
tree | 61c084289cd12fb924e82af1d1092a2ee00def18 /test/integration/test-bug-673536-pre-depends-breaks-loop | |
parent | 71e7a0f3a432828e5bd5498297051aa37e7f0a59 (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-673536-pre-depends-breaks-loop')
-rwxr-xr-x | test/integration/test-bug-673536-pre-depends-breaks-loop | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/test/integration/test-bug-673536-pre-depends-breaks-loop b/test/integration/test-bug-673536-pre-depends-breaks-loop index f6a90b21f..21bd5e065 100755 --- a/test/integration/test-bug-673536-pre-depends-breaks-loop +++ b/test/integration/test-bug-673536-pre-depends-breaks-loop @@ -6,18 +6,32 @@ TESTDIR=$(readlink -f $(dirname $0)) setupenvironment configarchitecture 'native' -buildsimplenativepackage 'basic' 'native' '1' 'stable' +buildsimplenativepackage 'advanced' 'native' '1' 'stable' +buildsimplenativepackage 'advanced' 'native' '2' 'unstable' 'Pre-Depends: basic' buildsimplenativepackage 'basic' 'native' '2' 'unstable' 'Pre-Depends: common' -buildsimplenativepackage 'common' 'native' '2' 'unstable' 'Breaks: basic (<= 1)' + +buildsimplenativepackage 'common' 'native' '2~conflict' 'unstable-conflict' 'Conflicts: advanced (<= 1)' +buildsimplenativepackage 'common' 'native' '2~break' 'unstable-break' 'Conflicts: advanced (<= 1)' setupaptarchive # we check with 'real' packages here as the simulation reports a 'Conf broken' # which is technical correct for the simulation, but testing errormsg is ugly -testsuccess aptget install basic=1 -y -testdpkginstalled basic -testdpkgnotinstalled common +cp -a rootdir/var/lib/dpkg/status dpkg.status.backup + +testloopbreak() { + cp -a dpkg.status.backup rootdir/var/lib/dpkg/status + rm -f rootdir/var/lib/apt/extended_states + + + testsuccess aptget install advanced=1 -y -t "$1" -o Debug::pkgPackageManager=1 + testdpkginstalled advanced + testdpkgnotinstalled basic common + + testsuccess aptget dist-upgrade -y -t "$1" -o Debug::pkgPackageManager=1 + testdpkginstalled advanced basic common +} -testsuccess aptget dist-upgrade -y -testdpkginstalled basic common +testloopbreak 'unstable-break' +testloopbreak 'unstable-conflict' |