Line 0
Link Here
|
0 |
- |
1 |
# Copyright 2014 Gentoo Foundation |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
4 |
from portage.tests import TestCase |
5 |
from portage.tests.resolver.ResolverPlayground import \ |
6 |
ResolverPlayground, ResolverPlaygroundTestCase |
7 |
|
8 |
class SlotOperatorUpdateProbeParentDowngradeTestCase(TestCase): |
9 |
|
10 |
def testSlotOperatorUpdateProbeParentDowngrade(self): |
11 |
|
12 |
ebuilds = { |
13 |
"net-nds/openldap-2.4.40-r3": { |
14 |
"EAPI": "5", |
15 |
"RDEPEND": "<sys-libs/db-6.0:= " + \ |
16 |
"|| ( sys-libs/db:5.3 sys-libs/db:5.1 )" |
17 |
}, |
18 |
"net-nds/openldap-2.4.40": { |
19 |
"EAPI": "5", |
20 |
"RDEPEND": "sys-libs/db" |
21 |
}, |
22 |
"sys-libs/db-6.0": { |
23 |
"SLOT": "6.0", |
24 |
}, |
25 |
"sys-libs/db-5.3": { |
26 |
"SLOT": "5.3", |
27 |
}, |
28 |
} |
29 |
|
30 |
installed = { |
31 |
"net-nds/openldap-2.4.40-r3": { |
32 |
"EAPI": "5", |
33 |
"RDEPEND": "<sys-libs/db-6.0:5.3/5.3= " + \ |
34 |
"|| ( sys-libs/db:5.3 sys-libs/db:5.1 )" |
35 |
}, |
36 |
"sys-libs/db-6.0": { |
37 |
"SLOT": "6.0", |
38 |
}, |
39 |
"sys-libs/db-5.3": { |
40 |
"SLOT": "5.3", |
41 |
}, |
42 |
} |
43 |
|
44 |
world = ( |
45 |
"net-nds/openldap", |
46 |
) |
47 |
|
48 |
test_cases = ( |
49 |
# bug 528610 - openldap rebuild was triggered |
50 |
# inappropriately, due to slot_operator_update_probe |
51 |
# selecting an inappropriate replacement parent of |
52 |
# a lower version than desired. |
53 |
ResolverPlaygroundTestCase( |
54 |
["@world"], |
55 |
success = True, |
56 |
options = { "--update": True, "--deep": True }, |
57 |
mergelist = []), |
58 |
) |
59 |
|
60 |
playground = ResolverPlayground(ebuilds=ebuilds, |
61 |
installed=installed, world=world, debug=False) |
62 |
try: |
63 |
for test_case in test_cases: |
64 |
playground.run_TestCase(test_case) |
65 |
self.assertEqual(test_case.test_success, |
66 |
True, test_case.fail_msg) |
67 |
finally: |
68 |
playground.cleanup() |