]>
Commit | Line | Data |
---|---|---|
ecc138f8 DK |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
3abb6a6a DK |
4 | TESTDIR="$(readlink -f "$(dirname "$0")")" |
5 | . "$TESTDIR/framework" | |
ecc138f8 DK |
6 | setupenvironment |
7 | configarchitecture 'amd64' 'i386' | |
8 | ||
9 | insertpackage 'unstable' 'foo' 'amd64,i386' '1' 'Multi-Arch: allowed' | |
10 | insertpackage 'unstable' 'needsfoo' 'amd64,i386' '1' 'Depends: foo' | |
11 | insertpackage 'unstable' 'needsfooany' 'amd64,i386' '1' 'Depends: foo:any' | |
12 | insertpackage 'unstable' 'needsfoover1' 'amd64,i386' '1' 'Depends: foo:any (>= 1)' | |
13 | insertpackage 'unstable' 'needsfoover2' 'amd64,i386' '1' 'Depends: foo:any (>= 2)' | |
14 | insertpackage 'unstable' 'hatesfoo' 'amd64' '1' 'Conflicts: foo' | |
3addaba1 | 15 | insertpackage 'unstable' 'hatesfooany' 'amd64' '1' 'Conflicts: foo:any' # this makes no senseā¦? |
ecc138f8 DK |
16 | insertpackage 'unstable' 'hatesfoonative' 'amd64' '1' 'Conflicts: foo:amd64' |
17 | ||
18 | insertpackage 'unstable' 'coolfoo' 'amd64' '1' 'Multi-Arch:allowed | |
19 | Provides: coolbar' | |
20 | insertpackage 'unstable' 'coolfoover' 'amd64' '1' 'Multi-Arch:allowed | |
21 | Provides: coolbar (= 2)' | |
22 | insertpackage 'unstable' 'needscoolfoo' 'amd64' '1' 'Depends: coolfoo, coolbar' | |
23 | insertpackage 'unstable' 'needscoolfooany' 'amd64' '1' 'Depends: coolfoo:any, coolbar:any' | |
3addaba1 DK |
24 | insertpackage 'unstable' 'needscoolfoover0' 'amd64' '1' 'Depends: coolfoo:any (>= 1), coolbar:any' |
25 | insertpackage 'unstable' 'needscoolfoover1' 'amd64' '1' 'Depends: coolfoo:any (>= 1), coolbar:any (>= 1)' | |
26 | insertpackage 'unstable' 'needscoolfoover2' 'amd64' '1' 'Depends: coolfoo:any (>= 2), coolbar:any (>= 1)' | |
27 | insertpackage 'unstable' 'needscoolfoover3' 'amd64' '1' 'Depends: coolfoo:any (>= 2), coolbar:any (>= 3)' | |
ecc138f8 DK |
28 | |
29 | setupaptarchive | |
30 | ||
31 | BADPREFIX='Reading package lists... | |
32 | Building dependency tree... | |
33 | Some packages could not be installed. This may mean that you have | |
34 | requested an impossible situation or if you are using the unstable | |
35 | distribution that some required packages have not yet been created | |
36 | or been moved out of Incoming. | |
37 | The following information may help to resolve the situation: | |
38 | ' | |
39 | ||
40 | solveableinsinglearch0() { | |
41 | testsuccessequal 'Reading package lists... | |
42 | Building dependency tree... | |
e7ebb414 | 43 | The following additional packages will be installed: |
ecc138f8 DK |
44 | foo |
45 | The following NEW packages will be installed: | |
46 | foo needsfoo | |
47 | 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. | |
48 | Inst foo (1 unstable [amd64]) | |
49 | Inst needsfoo (1 unstable [amd64]) | |
50 | Conf foo (1 unstable [amd64]) | |
51 | Conf needsfoo (1 unstable [amd64])' aptget install needsfoo -s | |
52 | } | |
53 | solveableinsinglearch0 | |
54 | testsuccessequal 'Reading package lists... | |
55 | Building dependency tree... | |
e7ebb414 | 56 | The following additional packages will be installed: |
ecc138f8 DK |
57 | foo:i386 |
58 | The following NEW packages will be installed: | |
59 | foo:i386 needsfoo:i386 | |
60 | 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. | |
61 | Inst foo:i386 (1 unstable [i386]) | |
62 | Inst needsfoo:i386 (1 unstable [i386]) | |
63 | Conf foo:i386 (1 unstable [i386]) | |
64 | Conf needsfoo:i386 (1 unstable [i386])' aptget install needsfoo:i386 -s | |
65 | testfailureequal "$BADPREFIX | |
66 | The following packages have unmet dependencies: | |
67 | needsfoo:i386 : Depends: foo:i386 but it is not going to be installed | |
68 | E: Unable to correct problems, you have held broken packages." aptget install needsfoo:i386 foo:amd64 -s | |
69 | testfailureequal "$BADPREFIX | |
70 | The following packages have unmet dependencies: | |
71 | needsfoo : Depends: foo but it is not going to be installed | |
72 | E: Unable to correct problems, you have held broken packages." aptget install needsfoo foo:i386 -s | |
73 | ||
74 | solveableinsinglearch1() { | |
75 | testsuccessequal "Reading package lists... | |
76 | Building dependency tree... | |
e7ebb414 | 77 | The following additional packages will be installed: |
ecc138f8 DK |
78 | foo |
79 | The following NEW packages will be installed: | |
80 | foo $1 | |
81 | 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. | |
82 | Inst foo (1 unstable [amd64]) | |
83 | Inst $1 (1 unstable [amd64]) | |
84 | Conf foo (1 unstable [amd64]) | |
85 | Conf $1 (1 unstable [amd64])" aptget install $1 -s | |
86 | } | |
87 | ||
88 | testneedsfooallgood() { | |
89 | solveableinsinglearch1 $1 | |
90 | testsuccessequal "Reading package lists... | |
91 | Building dependency tree... | |
e7ebb414 | 92 | The following additional packages will be installed: |
ecc138f8 DK |
93 | foo |
94 | The following NEW packages will be installed: | |
95 | foo $1:i386 | |
96 | 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. | |
97 | Inst foo (1 unstable [amd64]) | |
98 | Inst $1:i386 (1 unstable [i386]) | |
99 | Conf foo (1 unstable [amd64]) | |
100 | Conf $1:i386 (1 unstable [i386])" aptget install $1:i386 -s | |
101 | testsuccessequal "Reading package lists... | |
102 | Building dependency tree... | |
103 | The following NEW packages will be installed: | |
104 | foo:i386 $1:i386 | |
105 | 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. | |
106 | Inst foo:i386 (1 unstable [i386]) | |
107 | Inst $1:i386 (1 unstable [i386]) | |
108 | Conf foo:i386 (1 unstable [i386]) | |
109 | Conf $1:i386 (1 unstable [i386])" aptget install $1:i386 foo:i386 -s | |
110 | testsuccessequal "Reading package lists... | |
111 | Building dependency tree... | |
112 | The following NEW packages will be installed: | |
113 | foo:i386 $1 | |
114 | 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. | |
115 | Inst foo:i386 (1 unstable [i386]) | |
116 | Inst $1 (1 unstable [amd64]) | |
117 | Conf foo:i386 (1 unstable [i386]) | |
118 | Conf $1 (1 unstable [amd64])" aptget install $1 foo:i386 -s | |
119 | } | |
120 | testneedsfooallgood 'needsfooany' | |
121 | testneedsfooallgood 'needsfoover1' | |
122 | ||
123 | NEEDSFOO2NATIVE="$BADPREFIX | |
124 | The following packages have unmet dependencies: | |
125 | needsfoover2 : Depends: foo:any (>= 2) | |
126 | E: Unable to correct problems, you have held broken packages." | |
127 | NEEDSFOO2FOREIGN="$BADPREFIX | |
128 | The following packages have unmet dependencies: | |
f6ce7ffc | 129 | needsfoover2:i386 : Depends: foo:any (>= 2) |
ecc138f8 DK |
130 | E: Unable to correct problems, you have held broken packages." |
131 | testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s | |
132 | testfailureequal "$NEEDSFOO2FOREIGN" aptget install needsfoover2:i386 -s | |
133 | testfailureequal "$NEEDSFOO2FOREIGN" aptget install needsfoover2:i386 foo:i386 -s | |
134 | testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 foo:i386 -s | |
135 | ||
136 | solveableinsinglearch2() { | |
137 | testfailureequal "$BADPREFIX | |
138 | The following packages have unmet dependencies: | |
139 | hatesfoo : Conflicts: foo but 1 is to be installed | |
140 | E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoo -s | |
bb0f6a34 DK |
141 | # the message differs slightly between single and multiarch |
142 | testfailuremsg 'E: Unable to correct problems, you have held broken packages.' aptget install foo hatesfooany -s | |
ecc138f8 DK |
143 | testfailureequal "$BADPREFIX |
144 | The following packages have unmet dependencies: | |
3addaba1 | 145 | hatesfoonative : Conflicts: foo:amd64 |
ecc138f8 DK |
146 | E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoonative -s |
147 | } | |
148 | solveableinsinglearch2 | |
149 | testfailureequal "$BADPREFIX | |
150 | The following packages have unmet dependencies: | |
151 | hatesfoo : Conflicts: foo:i386 but 1 is to be installed | |
152 | E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfoo -s | |
153 | testfailureequal "$BADPREFIX | |
154 | The following packages have unmet dependencies: | |
155 | hatesfooany : Conflicts: foo:any | |
156 | E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfooany -s | |
157 | testsuccessequal 'Reading package lists... | |
158 | Building dependency tree... | |
159 | The following NEW packages will be installed: | |
160 | foo:i386 hatesfoonative | |
161 | 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. | |
162 | Inst foo:i386 (1 unstable [i386]) | |
163 | Inst hatesfoonative (1 unstable [amd64]) | |
164 | Conf foo:i386 (1 unstable [i386]) | |
165 | Conf hatesfoonative (1 unstable [amd64])' aptget install foo:i386 hatesfoonative -s | |
166 | ||
167 | solveableinsinglearch3() { | |
168 | testsuccessequal "Reading package lists... | |
169 | Building dependency tree... | |
e7ebb414 | 170 | The following additional packages will be installed: |
ecc138f8 DK |
171 | coolfoo |
172 | The following NEW packages will be installed: | |
173 | coolfoo needscoolfoo | |
174 | 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. | |
175 | Inst coolfoo (1 unstable [amd64]) | |
176 | Inst needscoolfoo (1 unstable [amd64]) | |
177 | Conf coolfoo (1 unstable [amd64]) | |
178 | Conf needscoolfoo (1 unstable [amd64])" aptget install needscoolfoo -s | |
179 | testsuccessequal "Reading package lists... | |
180 | Building dependency tree... | |
e7ebb414 | 181 | The following additional packages will be installed: |
ecc138f8 DK |
182 | coolfoo |
183 | The following NEW packages will be installed: | |
184 | coolfoo coolfoover needscoolfoo | |
185 | 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. | |
186 | Inst coolfoo (1 unstable [amd64]) | |
187 | Inst coolfoover (1 unstable [amd64]) | |
188 | Inst needscoolfoo (1 unstable [amd64]) | |
189 | Conf coolfoo (1 unstable [amd64]) | |
190 | Conf coolfoover (1 unstable [amd64]) | |
191 | Conf needscoolfoo (1 unstable [amd64])" aptget install needscoolfoo coolfoover -s | |
3addaba1 DK |
192 | testsuccessequal "Reading package lists... |
193 | Building dependency tree... | |
194 | The following additional packages will be installed: | |
195 | coolfoo | |
196 | The following NEW packages will be installed: | |
197 | coolfoo needscoolfooany | |
198 | 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. | |
199 | Inst coolfoo (1 unstable [amd64]) | |
200 | Inst needscoolfooany (1 unstable [amd64]) | |
201 | Conf coolfoo (1 unstable [amd64]) | |
202 | Conf needscoolfooany (1 unstable [amd64])" aptget install needscoolfooany -s | |
ecc138f8 DK |
203 | testsuccessequal 'Reading package lists... |
204 | Building dependency tree... | |
e7ebb414 | 205 | The following additional packages will be installed: |
ecc138f8 DK |
206 | coolfoo |
207 | The following NEW packages will be installed: | |
208 | coolfoo needscoolfoover0 | |
209 | 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. | |
210 | Inst coolfoo (1 unstable [amd64]) | |
211 | Inst needscoolfoover0 (1 unstable [amd64]) | |
212 | Conf coolfoo (1 unstable [amd64]) | |
213 | Conf needscoolfoover0 (1 unstable [amd64])' aptget install needscoolfoover0 -s | |
214 | testsuccessequal 'Reading package lists... | |
215 | Building dependency tree... | |
e7ebb414 | 216 | The following additional packages will be installed: |
ecc138f8 DK |
217 | coolfoo coolfoover |
218 | The following NEW packages will be installed: | |
219 | coolfoo coolfoover needscoolfoover1 | |
220 | 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. | |
221 | Inst coolfoo (1 unstable [amd64]) | |
222 | Inst coolfoover (1 unstable [amd64]) | |
223 | Inst needscoolfoover1 (1 unstable [amd64]) | |
224 | Conf coolfoo (1 unstable [amd64]) | |
225 | Conf coolfoover (1 unstable [amd64]) | |
226 | Conf needscoolfoover1 (1 unstable [amd64])' aptget install needscoolfoover1 -s | |
227 | testfailureequal "$BADPREFIX | |
228 | The following packages have unmet dependencies: | |
229 | needscoolfoover2 : Depends: coolfoo:any (>= 2) | |
230 | E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover2 -s | |
231 | testfailureequal "$BADPREFIX | |
232 | The following packages have unmet dependencies: | |
233 | needscoolfoover3 : Depends: coolfoo:any (>= 2) | |
3addaba1 | 234 | Depends: coolbar:any (>= 3) |
ecc138f8 DK |
235 | E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover3 -s |
236 | } | |
237 | solveableinsinglearch3 | |
238 | ||
239 | msgmsg 'switch to single architecture' | |
240 | configarchitecture 'amd64' | |
241 | ||
242 | solveableinsinglearch0 | |
243 | testfailureequal 'Reading package lists... | |
244 | Building dependency tree... | |
3addaba1 | 245 | E: Unable to locate package needsfoo:i386' aptget install needsfoo:i386 -s |
ecc138f8 DK |
246 | |
247 | solveableinsinglearch1 'needsfooany' | |
248 | solveableinsinglearch1 'needsfoover1' | |
249 | testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s | |
250 | solveableinsinglearch2 | |
251 | solveableinsinglearch3 | |
384f17b4 DK |
252 | |
253 | msgmsg 'multi-arch with barbarian archs' | |
254 | configarchitecture 'amd64' 'i386' | |
255 | insertinstalledpackage 'foo' 'armel' '1' 'Multi-Arch: allowed' | |
256 | insertinstalledpackage 'coolfoo' 'armel' '1' 'Multi-Arch:allowed | |
257 | Provides: coolbar' | |
62428dbc | 258 | insertinstalledpackage 'bar-needer' 'armel' '1.0' 'Depends: coolbar:any' |
384f17b4 | 259 | |
62428dbc | 260 | testsuccess aptget check |
384f17b4 DK |
261 | testsuccessequal 'Reading package lists... |
262 | Building dependency tree... | |
263 | The following additional packages will be installed: | |
264 | foo | |
265 | The following packages will be REMOVED: | |
266 | foo:armel | |
267 | The following NEW packages will be installed: | |
268 | foo needsfooany | |
269 | 0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. | |
270 | Remv foo:armel [1] | |
271 | Inst foo (1 unstable [amd64]) | |
272 | Inst needsfooany (1 unstable [amd64]) | |
273 | Conf foo (1 unstable [amd64]) | |
274 | Conf needsfooany (1 unstable [amd64])' aptget install needsfooany -s | |
275 | testsuccessequal 'Reading package lists... | |
276 | Building dependency tree... | |
277 | The following additional packages will be installed: | |
278 | foo | |
279 | The following packages will be REMOVED: | |
280 | foo:armel | |
281 | The following NEW packages will be installed: | |
282 | foo needsfooany:i386 | |
283 | 0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. | |
284 | Remv foo:armel [1] | |
285 | Inst foo (1 unstable [amd64]) | |
286 | Inst needsfooany:i386 (1 unstable [i386]) | |
287 | Conf foo (1 unstable [amd64]) | |
288 | Conf needsfooany:i386 (1 unstable [i386])' aptget install needsfooany:i386 -s | |
289 | testsuccessequal 'Reading package lists... | |
290 | Building dependency tree... | |
291 | The following additional packages will be installed: | |
292 | coolfoo | |
293 | The following packages will be REMOVED: | |
294 | coolfoo:armel | |
295 | The following NEW packages will be installed: | |
296 | coolfoo needscoolfoover0 | |
297 | 0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. | |
62428dbc | 298 | Remv coolfoo:armel [1] [bar-needer:armel ] |
384f17b4 DK |
299 | Inst coolfoo (1 unstable [amd64]) |
300 | Inst needscoolfoover0 (1 unstable [amd64]) | |
301 | Conf coolfoo (1 unstable [amd64]) | |
302 | Conf needscoolfoover0 (1 unstable [amd64])' aptget install needscoolfoover0 -s |