From 84ec8afa54c934639cb4d0603c119bda7142f12e Mon Sep 17 00:00:00 2001 From: Sebastian Luther Date: Tue, 26 Nov 2013 10:03:11 +0100 Subject: [PATCH] Add test case for bug 486580 --- .../resolver/test_slot_conflict_rebuild.py | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py index 3cd86bd32..b1fd20889 100644 --- a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py +++ b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py @@ -105,3 +105,78 @@ class SlotConflictRebuildTestCase(TestCase): self.assertEqual(test_case.test_success, True, test_case.fail_msg) finally: playground.cleanup() + + + def testSlotConflictMassRebuild(self): + """ + Bug 486580 + Before this bug was fixed, emerge would backtrack for each package that needs + a rebuild. This could cause it to hit the backtrack limit and not rebuild all + needed packages. + """ + ebuilds = { + + "app-misc/A-1" : { + "EAPI": "5", + "DEPEND": "app-misc/B:=", + "RDEPEND": "app-misc/B:=" + }, + + "app-misc/B-1" : { + "EAPI": "5", + "SLOT": "1" + }, + + "app-misc/B-2" : { + "EAPI": "5", + "SLOT": "2/2" + }, + } + + installed = { + "app-misc/B-1" : { + "EAPI": "5", + "SLOT": "1" + }, + } + + expected_mergelist = ['app-misc/A-1', 'app-misc/B-2'] + + for i in xrange(5): + ebuilds["app-misc/C%sC-1" % i] = { + "EAPI": "5", + "DEPEND": "app-misc/B:=", + "RDEPEND": "app-misc/B:=" + } + + installed["app-misc/C%sC-1" % i] = { + "EAPI": "5", + "DEPEND": "app-misc/B:1/1=", + "RDEPEND": "app-misc/B:1/1=" + } + for x in ("DEPEND", "RDEPEND"): + ebuilds["app-misc/A-1"][x] += " app-misc/C%sC" % i + + expected_mergelist.append("app-misc/C%sC-1" % i) + + + test_cases = ( + ResolverPlaygroundTestCase( + ["app-misc/A"], + ignore_mergelist_order=True, + all_permutations=True, + options = {"--backtrack": 3, '--deep': True}, + success = True, + mergelist = expected_mergelist), + ) + + world = [] + + playground = ResolverPlayground(ebuilds=ebuilds, + installed=installed, world=world, debug=True) + try: + for test_case in test_cases: + playground.run_TestCase(test_case) + self.assertEqual(test_case.test_success, True, test_case.fail_msg) + finally: + playground.cleanup() -- 2.26.2