aboutsummaryrefslogtreecommitdiff
blob: 2ec15b60276aafe99433f0c7c384cbd28458dcd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright 2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

from portage.tests import TestCase
from portage.tests.resolver.ResolverPlayground import \
	ResolverPlayground, ResolverPlaygroundTestCase

class SlotOperatorUpdateProbeParentDowngradeTestCase(TestCase):

	def testSlotOperatorUpdateProbeParentDowngrade(self):

		ebuilds = {
			"net-nds/openldap-2.4.40-r3": {
				"EAPI": "5",
				"RDEPEND": "<sys-libs/db-6.0:= " + \
					"|| ( sys-libs/db:5.3 sys-libs/db:5.1 )"
			},
			"net-nds/openldap-2.4.40": {
				"EAPI": "5",
				"RDEPEND": "sys-libs/db"
			},
			"sys-libs/db-6.0": {
				"SLOT": "6.0",
			},
			"sys-libs/db-5.3": {
				"SLOT": "5.3",
			},
		}

		installed = {
			"net-nds/openldap-2.4.40-r3": {
				"EAPI": "5",
				"RDEPEND": "<sys-libs/db-6.0:5.3/5.3= " + \
					"|| ( sys-libs/db:5.3 sys-libs/db:5.1 )"
			},
			"sys-libs/db-6.0": {
				"SLOT": "6.0",
			},
			"sys-libs/db-5.3": {
				"SLOT": "5.3",
			},
		}

		world = (
			"net-nds/openldap",
		)

		test_cases = (
			# bug 528610 - openldap rebuild was triggered
			# inappropriately, due to slot_operator_update_probe
			# selecting an inappropriate replacement parent of
			# a lower version than desired.
			ResolverPlaygroundTestCase(
				["@world"],
				success = True,
				options = { "--update": True, "--deep": True },
				mergelist = []),
		)

		playground = ResolverPlayground(ebuilds=ebuilds,
			installed=installed, world=world, debug=False)
		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()