1 |
commit: 1aaed33429f390957514eb81b050cae8c7201d67 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Feb 8 07:05:02 2020 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Feb 8 08:24:04 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1aaed334 |
7 |
|
8 |
Add unit test for virtual/w3m depclean inconsistency (bug 649622) |
9 |
|
10 |
Bug: https://bugs.gentoo.org/649622 |
11 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
12 |
|
13 |
lib/portage/tests/resolver/test_or_choices.py | 114 +++++++++++++++++++++++++- |
14 |
1 file changed, 113 insertions(+), 1 deletion(-) |
15 |
|
16 |
diff --git a/lib/portage/tests/resolver/test_or_choices.py b/lib/portage/tests/resolver/test_or_choices.py |
17 |
index 10c613e39..f1cc75499 100644 |
18 |
--- a/lib/portage/tests/resolver/test_or_choices.py |
19 |
+++ b/lib/portage/tests/resolver/test_or_choices.py |
20 |
@@ -1,6 +1,8 @@ |
21 |
-# Copyright 2013-2015 Gentoo Foundation |
22 |
+# Copyright 2013-2020 Gentoo Authors |
23 |
# Distributed under the terms of the GNU General Public License v2 |
24 |
|
25 |
+import itertools |
26 |
+ |
27 |
from portage.tests import TestCase |
28 |
from portage.tests.resolver.ResolverPlayground import (ResolverPlayground, |
29 |
ResolverPlaygroundTestCase) |
30 |
@@ -407,6 +409,116 @@ class OrChoicesTestCase(TestCase): |
31 |
playground.debug = False |
32 |
playground.cleanup() |
33 |
|
34 |
+ def test_virtual_w3m(self): |
35 |
+ ebuilds = { |
36 |
+ |
37 |
+ 'app-text/xmlto-0.0.28-r1' : { |
38 |
+ 'EAPI': '7', |
39 |
+ 'RDEPEND': '|| ( virtual/w3m www-client/lynx www-client/elinks )' |
40 |
+ }, |
41 |
+ |
42 |
+ 'www-client/elinks-0.13_pre_pre20180225' : { |
43 |
+ 'EAPI': '7', |
44 |
+ }, |
45 |
+ |
46 |
+ 'www-client/lynx-2.9.0_pre4' : { |
47 |
+ 'EAPI': '7', |
48 |
+ }, |
49 |
+ |
50 |
+ 'virtual/w3m-0' : { |
51 |
+ 'EAPI': '7', |
52 |
+ 'RDEPEND': '|| ( www-client/w3m www-client/w3mmee )' |
53 |
+ }, |
54 |
+ |
55 |
+ 'www-client/w3m-0.5.3_p20190105' : { |
56 |
+ 'EAPI': '7', |
57 |
+ }, |
58 |
+ |
59 |
+ 'www-client/w3mmee-0.3.2_p24-r10' : { |
60 |
+ 'EAPI': '7', |
61 |
+ }, |
62 |
+ |
63 |
+ } |
64 |
+ |
65 |
+ installed = { |
66 |
+ |
67 |
+ 'app-text/xmlto-0.0.28-r1' : { |
68 |
+ 'EAPI': '7', |
69 |
+ 'RDEPEND': '|| ( virtual/w3m www-client/lynx www-client/elinks )' |
70 |
+ }, |
71 |
+ |
72 |
+ 'www-client/elinks-0.13_pre_pre20180225' : { |
73 |
+ 'EAPI': '7', |
74 |
+ }, |
75 |
+ |
76 |
+ 'www-client/lynx-2.9.0_pre4' : { |
77 |
+ 'EAPI': '7', |
78 |
+ }, |
79 |
+ |
80 |
+ 'www-client/w3m-0.5.3_p20190105' : { |
81 |
+ 'EAPI': '7', |
82 |
+ }, |
83 |
+ |
84 |
+ } |
85 |
+ |
86 |
+ world = ['app-text/xmlto', 'www-client/elinks', 'www-client/lynx'] |
87 |
+ |
88 |
+ test_cases = ( |
89 |
+ |
90 |
+ # Test for bug 649622, where virtual/w3m is installed only |
91 |
+ # to be removed by the next emerge --depclean. |
92 |
+ ResolverPlaygroundTestCase( |
93 |
+ ['@world'], |
94 |
+ options = {'--update': True, '--deep': True}, |
95 |
+ success = True, |
96 |
+ mergelist = ['virtual/w3m-0'] |
97 |
+ ), |
98 |
+ |
99 |
+ ) |
100 |
+ |
101 |
+ playground = ResolverPlayground(ebuilds=ebuilds, |
102 |
+ installed=installed, world=world, debug=False) |
103 |
+ try: |
104 |
+ for test_case in test_cases: |
105 |
+ playground.run_TestCase(test_case) |
106 |
+ self.assertEqual(test_case.test_success, True, test_case.fail_msg) |
107 |
+ finally: |
108 |
+ playground.debug = False |
109 |
+ playground.cleanup() |
110 |
+ |
111 |
+ installed = dict(itertools.chain(installed.items(), { |
112 |
+ |
113 |
+ 'virtual/w3m-0' : { |
114 |
+ 'EAPI': '7', |
115 |
+ 'RDEPEND': '|| ( www-client/w3m www-client/w3mmee )' |
116 |
+ }, |
117 |
+ |
118 |
+ }.items())) |
119 |
+ |
120 |
+ test_cases = ( |
121 |
+ |
122 |
+ # Test for bug 649622, where virtual/w3m is removed by |
123 |
+ # emerge --depclean immediately after it's installed |
124 |
+ # by a world update. |
125 |
+ ResolverPlaygroundTestCase( |
126 |
+ [], |
127 |
+ options={'--depclean': True}, |
128 |
+ success=True, |
129 |
+ cleanlist=['virtual/w3m-0', 'www-client/w3m-0.5.3_p20190105'], |
130 |
+ ), |
131 |
+ |
132 |
+ ) |
133 |
+ |
134 |
+ playground = ResolverPlayground(ebuilds=ebuilds, |
135 |
+ installed=installed, world=world, debug=False) |
136 |
+ try: |
137 |
+ for test_case in test_cases: |
138 |
+ playground.run_TestCase(test_case) |
139 |
+ self.assertEqual(test_case.test_success, True, test_case.fail_msg) |
140 |
+ finally: |
141 |
+ playground.debug = False |
142 |
+ playground.cleanup() |
143 |
+ |
144 |
|
145 |
class OrChoicesLibpostprocTestCase(TestCase): |