From: Sebastian Luther Date: Tue, 26 Nov 2013 09:03:11 +0000 (+0100) Subject: Add test case for bug 486580 X-Git-Tag: v2.2.8~47 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=84ec8afa54c934639cb4d0603c119bda7142f12e;p=portage.git Add test case for bug 486580 --- 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()