summaryrefslogtreecommitdiffstats
path: root/test/integration/test-bug-758153-versioned-provides-support
blob: 7bf9d76bd0c67bc4efa91b4510f93ccd7839df32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
#!/bin/sh
set -e

# dpkg implements versioned provides in commit 5bb02fe80e9f40dcad9703a72f67cf615ff217b5
# but previous versions seem to allow parsing, working and ignoring it.

TESTDIR="$(readlink -f "$(dirname "$0")")"
. "$TESTDIR/framework"
setupenvironment
configarchitecture 'amd64' 'i386'

insertinstalledpackage 'webapp' 'all' '1' 'Depends: httpd'
insertinstalledpackage 'webserver' 'all' '1' 'Provides: httpd'

insertpackage 'unstable' 'webapp' 'all' '2' 'Depends: httpd (>= 2)'
insertpackage 'unstable' 'webserver' 'amd64' '2' 'Provides: httpd (= 2)'
insertpackage 'unstable' 'foreign-webserver' 'i386' '2' 'Multi-Arch: foreign
Provides: httpd (= 2)'

insertpackage 'experimental' 'webapp' 'all' '3' 'Depends: httpd (>= 1.5)'
insertpackage 'experimental' 'webserver' 'amd64' '3' 'Provides: httpd (= 3)'

insertpackage 'experimental' 'foreign-webserver' 'i386' '4' 'Multi-Arch: foreign
Provides: httpd (= 4)'
insertpackage 'experimental' 'cool-webapp' 'all' '4' 'Depends: httpd (>= 4)'

# arch-qualified provides, see #777071
insertpackage 'unstable' 'foo' 'all' '1' 'Provides: bar:i386'
insertpackage 'unstable' 'baz' 'i386,amd64' '1' 'Depends: bar'
insertpackage 'experimental' 'baz' 'i386,amd64' '2' 'Depends: bar:i386'
insertpackage 'experimental' 'baz-broken' 'i386' '2' 'Depends: bar:amd64'

insertpackage 'unstable' 'next' 'amd64' '1' 'Multi-Arch: foreign
Provides: next (= 2)'
insertpackage 'unstable' 'needsrealnext' 'amd64,i386' '2' 'Depends: next (>= 2)'

insertpackage 'unstable' 'virtualnext2' 'amd64' '1' 'Multi-Arch: foreign
Provides: next2 (= 2)'
insertpackage 'unstable' 'needsnext2' 'amd64,i386' '2' 'Depends: next2 (>= 2)'

insertpackage 'unstable' 'virtualnext3' 'amd64' '1' 'Multi-Arch: no
Provides: next3 (= 2)'
insertpackage 'unstable' 'needsnext3' 'amd64,i386' '2' 'Depends: next3 (>= 2)'

insertpackage 'unstable' 'selfprov' 'amd64' '2' 'Provides: selfprov (= 1)'
insertpackage 'unstable' 'needsselfprov1' 'amd64' '1' 'Depends: selfprov (= 1)'
insertpackage 'unstable' 'needsselfprov2' 'amd64' '1' 'Depends: selfprov (= 2)'
insertpackage 'unstable' 'needsselfprov12' 'amd64' '1' 'Depends: selfprov (= 1), selfprov (= 2)'
insertpackage 'unstable' 'needsselfprov123' 'amd64' '1' 'Depends: selfprov (= 1), selfprov (= 2), selfprov (= 3)'

setupaptarchive

SOMEPACKAGESCOULDNOT='Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:'

for binary in 'aptget' 'apt'; do
	for method in 'upgrade' 'dist-upgrade'; do
		for solver in 'internal' 'apt'; do
			if [ "$solver" = 'apt' ]; then
				HEADER='Execute external solver...'
			else
				HEADER='Calculating upgrade...'
			fi
			testsuccessequal "Reading package lists...
Building dependency tree...
$HEADER
The following packages will be upgraded:
  webapp webserver
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Inst webserver [1] (2 unstable [amd64])
Inst webapp [1] (2 unstable [all])
Conf webserver (2 unstable [amd64])
Conf webapp (2 unstable [all])" $binary $method -s --solver $solver
		done
	done
done

for solver in 'internal' 'apt'; do
	msgmsg 'Testing with solver' "$solver"
	HEADER_PRE='Reading package lists...
Building dependency tree...'
	HEADER_POST='Execute external solver...'
	HEADER="${HEADER_PRE}"
	if [ "$solver" = 'apt' ]; then
		HEADER="${HEADER}
${HEADER_POST}"
	fi
	testsuccessequal "$HEADER
The following packages will be upgraded:
  webapp webserver
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Inst webserver [1] (2 unstable [amd64])
Inst webapp [1] (2 unstable [all])
Conf webserver (2 unstable [amd64])
Conf webapp (2 unstable [all])" aptget install webapp webserver -s --solver $solver

	testsuccessequal "$HEADER
The following packages will be upgraded:
  webapp webserver
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Inst webserver [1] (2 unstable [amd64])
Inst webapp [1] (3 experimental [all])
Conf webserver (2 unstable [amd64])
Conf webapp (3 experimental [all])" aptget install webapp=3 webserver -s --solver $solver

	testsuccessequal "$HEADER
The following packages will be upgraded:
  webapp webserver
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Inst webserver [1] (3 experimental [amd64])
Inst webapp [1] (2 unstable [all])
Conf webserver (3 experimental [amd64])
Conf webapp (2 unstable [all])" aptget install webapp webserver=3 -s --solver $solver

	testsuccessequal "$HEADER
The following NEW packages will be installed:
  foreign-webserver:i386
The following packages will be upgraded:
  webapp
1 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Inst foreign-webserver:i386 (2 unstable [i386])
Inst webapp [1] (2 unstable [all])
Conf foreign-webserver:i386 (2 unstable [i386])
Conf webapp (2 unstable [all])" aptget install webapp foreign-webserver:i386 -s --solver $solver

	testsuccessequal "$HEADER
The following NEW packages will be installed:
  foreign-webserver:i386
The following packages will be upgraded:
  webapp
1 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Inst foreign-webserver:i386 (2 unstable [i386])
Inst webapp [1] (3 experimental [all])
Conf foreign-webserver:i386 (2 unstable [i386])
Conf webapp (3 experimental [all])" aptget install webapp=3 foreign-webserver:i386 -s --solver $solver

	testsuccessequal "$HEADER
The following NEW packages will be installed:
  foreign-webserver:i386
The following packages will be upgraded:
  webapp
1 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Inst foreign-webserver:i386 (4 experimental [i386])
Inst webapp [1] (2 unstable [all])
Conf foreign-webserver:i386 (4 experimental [i386])
Conf webapp (2 unstable [all])" aptget install webapp foreign-webserver:i386=4 -s --solver $solver

	if [ "$solver" = 'apt' ]; then
		WEBAPP_ERR="$HEADER
The solver encountered an error of type: ERR_UNSOLVABLE
The following information might help you to understand what is wrong:
The following packages have unmet dependencies:
 cool-webapp : Depends: httpd (>= 4)

$SOMEPACKAGESCOULDNOT
 cool-webapp : Depends: httpd (>= 4)
E: External solver failed with: The following packages have unmet dependencies:"
	else
		WEBAPP_ERR="$HEADER
$SOMEPACKAGESCOULDNOT
 cool-webapp : Depends: httpd (>= 4)
E: Unable to correct problems, you have held broken packages."
	fi
	testfailureequal "$WEBAPP_ERR" aptget install cool-webapp -s --solver $solver
	testfailureequal "$WEBAPP_ERR" aptget install cool-webapp foreign-webserver:i386 -s --solver $solver

	testsuccessequal "$HEADER
The following NEW packages will be installed:
  cool-webapp foreign-webserver:i386
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Inst foreign-webserver:i386 (4 experimental [i386])
Inst cool-webapp (4 experimental [all])
Conf foreign-webserver:i386 (4 experimental [i386])
Conf cool-webapp (4 experimental [all])" aptget install cool-webapp foreign-webserver:i386=4 -s --solver $solver

	testsuccessequal "$HEADER
The following additional packages will be installed:
  foo
The following NEW packages will be installed:
  baz:i386 foo
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Inst foo (1 unstable [all])
Inst baz:i386 (1 unstable [i386])
Conf foo (1 unstable [all])
Conf baz:i386 (1 unstable [i386])" aptget install baz:i386 -s --solver $solver

	if [ "$solver" = 'apt' ]; then
		testfailureequal "$HEADER
The solver encountered an error of type: ERR_UNSOLVABLE
The following information might help you to understand what is wrong:
The following packages have unmet dependencies:
 baz : Depends: bar but it is not installable

$SOMEPACKAGESCOULDNOT
 baz : Depends: bar but it is not installable
E: External solver failed with: The following packages have unmet dependencies:" aptget install baz:amd64 -s --solver $solver
	else
		testfailureequal "$HEADER
$SOMEPACKAGESCOULDNOT
 baz : Depends: bar but it is not installable
E: Unable to correct problems, you have held broken packages." aptget install baz:amd64 -s --solver $solver
	fi

	HEADER="${HEADER_PRE}
Selected version '2' (experimental [amd64]) for 'baz'"
	if [ "$solver" = 'apt' ]; then
		HEADER="${HEADER}
${HEADER_POST}"
	fi
	testsuccessequal "$HEADER
The following additional packages will be installed:
  foo
The following NEW packages will be installed:
  baz foo
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Inst foo (1 unstable [all])
Inst baz (2 experimental [amd64])
Conf foo (1 unstable [all])
Conf baz (2 experimental [amd64])" aptget install baz/experimental -s --solver $solver

	HEADER="${HEADER_PRE}
Selected version '2' (experimental [i386]) for 'baz:i386'"
	if [ "$solver" = 'apt' ]; then
		HEADER="${HEADER}
${HEADER_POST}"
	fi
	testsuccessequal "$HEADER
The following additional packages will be installed:
  foo
The following NEW packages will be installed:
  baz:i386 foo
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Inst foo (1 unstable [all])
Inst baz:i386 (2 experimental [i386])
Conf foo (1 unstable [all])
Conf baz:i386 (2 experimental [i386])" aptget install baz:i386/experimental -s --solver $solver

	if [ "$solver" = 'apt' ]; then
		HEADER="${HEADER_PRE}
${HEADER_POST}"
	else
		HEADER="${HEADER_PRE}"
	fi

	if [ "$solver" = 'apt' ]; then
		testfailureequal "$HEADER
The solver encountered an error of type: ERR_UNSOLVABLE
The following information might help you to understand what is wrong:
The following packages have unmet dependencies:
 baz-broken:i386 : Depends: bar:amd64 but it is not installable

$SOMEPACKAGESCOULDNOT
 baz-broken:i386 : Depends: bar:amd64 but it is not installable
E: External solver failed with: The following packages have unmet dependencies:" aptget install baz-broken -s --solver $solver
	else
		testfailureequal "$HEADER
$SOMEPACKAGESCOULDNOT
 baz-broken:i386 : Depends: bar:amd64 but it is not installable
E: Unable to correct problems, you have held broken packages." aptget install baz-broken -s --solver $solver
	fi

	testsuccessequal "$HEADER
The following additional packages will be installed:
  next
The following NEW packages will be installed:
  needsrealnext next
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Inst next (1 unstable [amd64])
Inst needsrealnext (2 unstable [amd64])
Conf next (1 unstable [amd64])
Conf needsrealnext (2 unstable [amd64])" aptget install needsrealnext -s --solver $solver

	testsuccessequal "$HEADER
The following additional packages will be installed:
  next
The following NEW packages will be installed:
  needsrealnext:i386 next
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Inst next (1 unstable [amd64])
Inst needsrealnext:i386 (2 unstable [i386])
Conf next (1 unstable [amd64])
Conf needsrealnext:i386 (2 unstable [i386])" aptget install needsrealnext:i386 -s --solver $solver

	testsuccessequal "$HEADER
The following additional packages will be installed:
  virtualnext2
The following NEW packages will be installed:
  needsnext2 virtualnext2
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Inst virtualnext2 (1 unstable [amd64])
Inst needsnext2 (2 unstable [amd64])
Conf virtualnext2 (1 unstable [amd64])
Conf needsnext2 (2 unstable [amd64])" aptget install needsnext2 -s --solver $solver

	testsuccessequal "$HEADER
The following additional packages will be installed:
  virtualnext2
The following NEW packages will be installed:
  needsnext2:i386 virtualnext2
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Inst virtualnext2 (1 unstable [amd64])
Inst needsnext2:i386 (2 unstable [i386])
Conf virtualnext2 (1 unstable [amd64])
Conf needsnext2:i386 (2 unstable [i386])" aptget install needsnext2:i386 -s --solver $solver

	testsuccessequal "$HEADER
The following additional packages will be installed:
  virtualnext3
The following NEW packages will be installed:
  needsnext3 virtualnext3
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Inst virtualnext3 (1 unstable [amd64])
Inst needsnext3 (2 unstable [amd64])
Conf virtualnext3 (1 unstable [amd64])
Conf needsnext3 (2 unstable [amd64])" aptget install needsnext3 -s --solver $solver

	if [ "$solver" = 'apt' ]; then
		testfailureequal "$HEADER
The solver encountered an error of type: ERR_UNSOLVABLE
The following information might help you to understand what is wrong:
The following packages have unmet dependencies:
 needsnext3:i386 : Depends: next3:i386 (>= 2) but it is not installable

$SOMEPACKAGESCOULDNOT
 needsnext3:i386 : Depends: next3:i386 (>= 2) but it is not installable
E: External solver failed with: The following packages have unmet dependencies:" aptget install needsnext3:i386 -s --solver $solver
	else
		testfailureequal "$HEADER
$SOMEPACKAGESCOULDNOT
 needsnext3:i386 : Depends: next3:i386 (>= 2) but it is not installable
E: Unable to correct problems, you have held broken packages." aptget install needsnext3:i386 -s --solver $solver
	fi

	testsuccessequal "$HEADER
The following NEW packages will be installed:
  selfprov
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Inst selfprov (2 unstable [amd64])
Conf selfprov (2 unstable [amd64])" apt install selfprov -s --solver $solver
	if [ "$solver" = 'apt' ]; then
		HEADER_POST_NL="
$HEADER_POST"
	else
		HEADER_POST_NL=''
	fi
	testsuccessequal "$HEADER_PRE
Selected version '2' (unstable [amd64]) for 'selfprov'$HEADER_POST_NL
The following NEW packages will be installed:
  selfprov
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Inst selfprov (2 unstable [amd64])
Conf selfprov (2 unstable [amd64])" apt install selfprov=1 -s --solver $solver
	testsuccessequal "$HEADER
The following NEW packages will be installed:
  selfprov
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Inst selfprov (2 unstable [amd64])
Conf selfprov (2 unstable [amd64])" apt install selfprov=2 -s --solver $solver

	testsuccessequal "$HEADER
The following additional packages will be installed:
  selfprov
The following NEW packages will be installed:
  needsselfprov1 selfprov
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Inst selfprov (2 unstable [amd64])
Inst needsselfprov1 (1 unstable [amd64])
Conf selfprov (2 unstable [amd64])
Conf needsselfprov1 (1 unstable [amd64])" aptget install needsselfprov1 -s --solver $solver
	testsuccessequal "$HEADER
The following additional packages will be installed:
  selfprov
The following NEW packages will be installed:
  needsselfprov2 selfprov
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Inst selfprov (2 unstable [amd64])
Inst needsselfprov2 (1 unstable [amd64])
Conf selfprov (2 unstable [amd64])
Conf needsselfprov2 (1 unstable [amd64])" aptget install needsselfprov2 -s --solver $solver
	testsuccessequal "$HEADER
The following additional packages will be installed:
  selfprov
The following NEW packages will be installed:
  needsselfprov12 selfprov
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Inst selfprov (2 unstable [amd64])
Inst needsselfprov12 (1 unstable [amd64])
Conf selfprov (2 unstable [amd64])
Conf needsselfprov12 (1 unstable [amd64])" aptget install needsselfprov12 -s --solver $solver
	if [ "$solver" = 'apt' ]; then
		testfailureequal "$HEADER
The solver encountered an error of type: ERR_UNSOLVABLE
The following information might help you to understand what is wrong:
The following packages have unmet dependencies:
 needsselfprov123 : Depends: selfprov (= 3)

$SOMEPACKAGESCOULDNOT
 needsselfprov123 : Depends: selfprov (= 1)
                    Depends: selfprov (= 2)
                    Depends: selfprov (= 3)
E: External solver failed with: The following packages have unmet dependencies:" aptget install needsselfprov123 -s --solver $solver
	else
		testfailureequal "$HEADER
$SOMEPACKAGESCOULDNOT
 needsselfprov123 : Depends: selfprov (= 3)
E: Unable to correct problems, you have held broken packages." aptget install needsselfprov123 -s --solver $solver
	fi
done