1 |
commit: b98dbb357b711f64c8fc1e305c5bca38be203f1d |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Feb 10 01:10:14 2020 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 10 02:24:11 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=b98dbb35 |
7 |
|
8 |
test_virtual_w3m: add realistic case, deps copied from real ebuilds |
9 |
|
10 |
Since virtual/w3m-0 is not removed in the depclean case, |
11 |
this test fails to reproduce bug 649622. |
12 |
|
13 |
Bug: https://bugs.gentoo.org/649622 |
14 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
15 |
|
16 |
lib/portage/tests/resolver/test_or_choices.py | 142 ++++++++++++++++++++++++++ |
17 |
1 file changed, 142 insertions(+) |
18 |
|
19 |
diff --git a/lib/portage/tests/resolver/test_or_choices.py b/lib/portage/tests/resolver/test_or_choices.py |
20 |
index a7ede1fac..f31a5ff22 100644 |
21 |
--- a/lib/portage/tests/resolver/test_or_choices.py |
22 |
+++ b/lib/portage/tests/resolver/test_or_choices.py |
23 |
@@ -581,6 +581,148 @@ class OrChoicesTestCase(TestCase): |
24 |
playground.cleanup() |
25 |
|
26 |
|
27 |
+ def test_virtual_w3m_realistic(self): |
28 |
+ """ |
29 |
+ Test for bug 649622 with realistic www-client/w3m dependencies copied |
30 |
+ from real ebuilds. |
31 |
+ """ |
32 |
+ ebuilds = { |
33 |
+ |
34 |
+ 'app-misc/neofetch-6.1.0': { |
35 |
+ 'EAPI': '7', |
36 |
+ 'RDEPEND': 'www-client/w3m' |
37 |
+ }, |
38 |
+ |
39 |
+ 'app-text/xmlto-0.0.28-r1' : { |
40 |
+ 'EAPI': '7', |
41 |
+ 'RDEPEND': '|| ( virtual/w3m www-client/lynx www-client/elinks )' |
42 |
+ }, |
43 |
+ |
44 |
+ 'mail-client/neomutt-20191207': { |
45 |
+ 'EAPI': '7', |
46 |
+ 'RDEPEND': '|| ( www-client/lynx www-client/w3m www-client/elinks )' |
47 |
+ }, |
48 |
+ |
49 |
+ 'www-client/elinks-0.13_pre_pre20180225' : { |
50 |
+ 'EAPI': '7', |
51 |
+ }, |
52 |
+ |
53 |
+ 'www-client/lynx-2.9.0_pre4' : { |
54 |
+ 'EAPI': '7', |
55 |
+ }, |
56 |
+ |
57 |
+ 'virtual/w3m-0' : { |
58 |
+ 'EAPI': '7', |
59 |
+ 'RDEPEND': '|| ( www-client/w3m www-client/w3mmee )' |
60 |
+ }, |
61 |
+ |
62 |
+ 'www-client/w3m-0.5.3_p20190105' : { |
63 |
+ 'EAPI': '7', |
64 |
+ }, |
65 |
+ |
66 |
+ 'www-client/w3mmee-0.3.2_p24-r10' : { |
67 |
+ 'EAPI': '7', |
68 |
+ }, |
69 |
+ |
70 |
+ 'x11-base/xorg-server-1.20.7' : { |
71 |
+ 'EAPI': '7', |
72 |
+ 'RDEPEND': '|| ( www-client/links www-client/lynx www-client/w3m ) app-text/xmlto', |
73 |
+ } |
74 |
+ } |
75 |
+ |
76 |
+ installed = { |
77 |
+ |
78 |
+ 'app-misc/neofetch-6.1.0': { |
79 |
+ 'EAPI': '7', |
80 |
+ 'RDEPEND': 'www-client/w3m' |
81 |
+ }, |
82 |
+ |
83 |
+ 'app-text/xmlto-0.0.28-r1' : { |
84 |
+ 'EAPI': '7', |
85 |
+ 'RDEPEND': '|| ( virtual/w3m www-client/lynx www-client/elinks )' |
86 |
+ }, |
87 |
+ |
88 |
+ 'mail-client/neomutt-20191207': { |
89 |
+ 'EAPI': '7', |
90 |
+ 'RDEPEND': '|| ( www-client/lynx www-client/w3m www-client/elinks )' |
91 |
+ }, |
92 |
+ |
93 |
+ 'www-client/lynx-2.9.0_pre4' : { |
94 |
+ 'EAPI': '7', |
95 |
+ }, |
96 |
+ |
97 |
+ 'www-client/w3m-0.5.3_p20190105' : { |
98 |
+ 'EAPI': '7', |
99 |
+ }, |
100 |
+ |
101 |
+ 'x11-base/xorg-server-1.20.7' : { |
102 |
+ 'EAPI': '7', |
103 |
+ 'RDEPEND': '|| ( www-client/links www-client/lynx www-client/w3m ) app-text/xmlto', |
104 |
+ } |
105 |
+ } |
106 |
+ |
107 |
+ world = ['app-misc/neofetch', 'mail-client/neomutt', 'www-client/lynx', 'x11-base/xorg-server'] |
108 |
+ |
109 |
+ test_cases = ( |
110 |
+ |
111 |
+ # Test for bug 649622 (with www-client/w3m installed via |
112 |
+ # xorg-server dependency), where virtual/w3m was pulled in |
113 |
+ # only to be removed by the next emerge --depclean. |
114 |
+ ResolverPlaygroundTestCase( |
115 |
+ ['@world'], |
116 |
+ options = {'--update': True, '--deep': True}, |
117 |
+ success = True, |
118 |
+ mergelist=['virtual/w3m-0'], |
119 |
+ ), |
120 |
+ |
121 |
+ ) |
122 |
+ |
123 |
+ playground = ResolverPlayground(ebuilds=ebuilds, |
124 |
+ installed=installed, world=world, debug=False) |
125 |
+ try: |
126 |
+ for test_case in test_cases: |
127 |
+ playground.run_TestCase(test_case) |
128 |
+ self.assertEqual(test_case.test_success, True, test_case.fail_msg) |
129 |
+ finally: |
130 |
+ playground.debug = False |
131 |
+ playground.cleanup() |
132 |
+ |
133 |
+ |
134 |
+ installed = dict(itertools.chain(installed.items(), { |
135 |
+ |
136 |
+ 'virtual/w3m-0' : { |
137 |
+ 'EAPI': '7', |
138 |
+ 'RDEPEND': '|| ( www-client/w3m www-client/w3mmee )' |
139 |
+ }, |
140 |
+ |
141 |
+ }.items())) |
142 |
+ |
143 |
+ test_cases = ( |
144 |
+ |
145 |
+ # Test for bug 649622, where virtual/w3m is removed by |
146 |
+ # emerge --depclean immediately after it's installed |
147 |
+ # by a world update. Since virtual/w3m-0 is not removed |
148 |
+ # here, this case fails to reproduce bug 649622. |
149 |
+ ResolverPlaygroundTestCase( |
150 |
+ [], |
151 |
+ options={'--depclean': True}, |
152 |
+ success=True, |
153 |
+ cleanlist=[], |
154 |
+ ), |
155 |
+ |
156 |
+ ) |
157 |
+ |
158 |
+ playground = ResolverPlayground(ebuilds=ebuilds, |
159 |
+ installed=installed, world=world, debug=False) |
160 |
+ try: |
161 |
+ for test_case in test_cases: |
162 |
+ playground.run_TestCase(test_case) |
163 |
+ self.assertEqual(test_case.test_success, True, test_case.fail_msg) |
164 |
+ finally: |
165 |
+ playground.debug = False |
166 |
+ playground.cleanup() |
167 |
+ |
168 |
+ |
169 |
class OrChoicesLibpostprocTestCase(TestCase): |
170 |
|
171 |
def testOrChoicesLibpostproc(self): |