]> git.saurik.com Git - apt.git/blob - test/integration/test-multiarch-allowed
Run ./prepare-release pre-export
[apt.git] / test / integration / test-multiarch-allowed
1 #!/bin/sh
2 set -e
3
4 TESTDIR=$(readlink -f $(dirname $0))
5 . $TESTDIR/framework
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'
15 insertpackage 'unstable' 'hatesfooany' 'amd64' '1' 'Conflicts: foo:any' # this makes no senseā€¦?
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'
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)'
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...
43 The following additional packages will be installed:
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...
56 The following additional packages will be installed:
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...
77 The following additional packages will be installed:
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...
92 The following additional packages will be installed:
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:
129 needsfoover2:i386 : Depends: foo:any (>= 2)
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
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
143 testfailureequal "$BADPREFIX
144 The following packages have unmet dependencies:
145 hatesfoonative : Conflicts: foo:amd64
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...
170 The following additional packages will be installed:
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...
181 The following additional packages will be installed:
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
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
203 testsuccessequal 'Reading package lists...
204 Building dependency tree...
205 The following additional packages will be installed:
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...
216 The following additional packages will be installed:
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)
234 Depends: coolbar:any (>= 3)
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...
245 E: Unable to locate package needsfoo:i386' aptget install needsfoo:i386 -s
246
247 solveableinsinglearch1 'needsfooany'
248 solveableinsinglearch1 'needsfoover1'
249 testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s
250 solveableinsinglearch2
251 solveableinsinglearch3
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'
258
259 testsuccessequal 'Reading package lists...
260 Building dependency tree...
261 The following additional packages will be installed:
262 foo
263 The following packages will be REMOVED:
264 foo:armel
265 The following NEW packages will be installed:
266 foo needsfooany
267 0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
268 Remv foo:armel [1]
269 Inst foo (1 unstable [amd64])
270 Inst needsfooany (1 unstable [amd64])
271 Conf foo (1 unstable [amd64])
272 Conf needsfooany (1 unstable [amd64])' aptget install needsfooany -s
273 testsuccessequal 'Reading package lists...
274 Building dependency tree...
275 The following additional packages will be installed:
276 foo
277 The following packages will be REMOVED:
278 foo:armel
279 The following NEW packages will be installed:
280 foo needsfooany:i386
281 0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
282 Remv foo:armel [1]
283 Inst foo (1 unstable [amd64])
284 Inst needsfooany:i386 (1 unstable [i386])
285 Conf foo (1 unstable [amd64])
286 Conf needsfooany:i386 (1 unstable [i386])' aptget install needsfooany:i386 -s
287 testsuccessequal 'Reading package lists...
288 Building dependency tree...
289 The following additional packages will be installed:
290 coolfoo
291 The following packages will be REMOVED:
292 coolfoo:armel
293 The following NEW packages will be installed:
294 coolfoo needscoolfoover0
295 0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
296 Remv coolfoo:armel [1]
297 Inst coolfoo (1 unstable [amd64])
298 Inst needscoolfoover0 (1 unstable [amd64])
299 Conf coolfoo (1 unstable [amd64])
300 Conf needscoolfoover0 (1 unstable [amd64])' aptget install needscoolfoover0 -s