summaryrefslogtreecommitdiff
path: root/test/integration/test-ubuntu-bug-2111792-intersecting-dependencies
blob: 3f100cb1fd18eaa6df958983a3a1fb30f034f8ab (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
#!/bin/sh
# This is the same test as test-bug-961266-hold-means-hold with a chaos actor
# introduced that provides a version of git that satisfies all >> constraints,
# to reproduce the same issue with gpgv and gpgv-from-sq in the Ubuntu bug.
set -e

TESTDIR="$(readlink -f "$(dirname "$0")")"
. "$TESTDIR/framework"

# This only works with the 3.0 solver. The classic solver does not intersect
# dependencies and will cause the chaos actor to be installed, so force it.
export APT_SOLVER=3.0

setupenvironment
configarchitecture 'amd64' 'i386'

insertinstalledpackage 'git' 'amd64' '1:2.25.1-1' 'Multi-Arch: foreign'
insertinstalledpackage 'git-cvs' 'amd64' '1:2.25.1-1' 'Depends: git (>> 1:2.25.1), git (<< 1:2.25.1-.)'

insertpackage 'unstable' 'git' 'amd64,i386' '1:2.26.2-1' 'Multi-Arch: foreign'
insertpackage 'unstable' 'git-cvs' 'amd64,i386' '1:2.26.2-1' 'Depends: git (>> 1:2.26.2), git (<< 1:2.26.2-.)'
insertpackage 'unstable' 'git-ng' 'amd64,i386' '1:2.26.2-1' 'Depends: git (>> 1:2.26.2), git (<< 1:2.26.2-.)'
insertpackage 'unstable' 'git-rec-ng' 'amd64,i386' '1:2.26.2-1' 'Recommends: git (>> 1:2.26.2)
Depends: git (<< 1:2.26.2-.)'
insertpackage 'unstable' 'chaos-actor' 'amd64,i386' '1' 'Provides: git (2:1)'

# Another test case we don't want to merge
insertpackage 'unstable' 'xserver-xorg' 'amd64,i386' '1' 'Depends: xserver-xorg-input-all | xorg-driver-input, xserver-xorg-video-all | xorg-driver-video, xorg-driver-input, xorg-driver-video'
insertpackage 'unstable' 'xserver-xorg-noalt' 'amd64,i386' '1' 'Depends: xorg-driver-input, xorg-driver-video'


insertpackage 'unstable' 'xserver-xorg-input-all' 'amd64,i386' '1' 'Provides: xorg-driver-input'
insertpackage 'unstable' 'xserver-xorg-video-all' 'amd64,i386' '1' 'Provides: xorg-driver-video'
insertpackage 'unstable' 'xorgxrdp' 'amd64,i386' '1' 'Provides: xorg-driver-input, xorg-driver-video
Priority: extra'

setupaptarchive

msgmsg 'The setup is' 'fine'
UPGRADE='Reading package lists...
Building dependency tree...
Calculating upgrade...
The following packages will be upgraded:
  git git-cvs
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Inst git-cvs [1:2.25.1-1] (1:2.26.2-1 unstable [amd64]) []
Inst git [1:2.25.1-1] (1:2.26.2-1 unstable [amd64])
Conf git-cvs (1:2.26.2-1 unstable [amd64])
Conf git (1:2.26.2-1 unstable [amd64])'
testsuccessequal "$UPGRADE" apt upgrade -s
testsuccessequal "$UPGRADE" aptget upgrade -s
testsuccessequal "$UPGRADE" apt full-upgrade -s
testsuccessequal "$UPGRADE" aptget dist-upgrade -s

testsuccessequal 'Reading package lists...
Building dependency tree...
The following additional packages will be installed:
  git git-cvs
The following NEW packages will be installed:
  git-ng
The following packages will be upgraded:
  git git-cvs
2 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Inst git-cvs [1:2.25.1-1] (1:2.26.2-1 unstable [amd64]) []
Inst git [1:2.25.1-1] (1:2.26.2-1 unstable [amd64])
Inst git-ng (1:2.26.2-1 unstable [amd64])
Conf git-cvs (1:2.26.2-1 unstable [amd64])
Conf git (1:2.26.2-1 unstable [amd64])
Conf git-ng (1:2.26.2-1 unstable [amd64])' apt install git-ng -s


msgmsg 'Now mix it up by' 'holding git'
testsuccessequal 'git set on hold.' aptmark hold git
testsuccessequal 'git' aptmark showholds

NOUPGRADE='Reading package lists...
Building dependency tree...
Calculating upgrade...
The following packages have been kept back:
  git git-cvs
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.'

testsuccessequal "$NOUPGRADE" apt upgrade -s
testsuccessequal "$NOUPGRADE" apt full-upgrade -s
testsuccessequal "$NOUPGRADE" aptget dist-upgrade -s
testsuccessequal "$NOUPGRADE" aptget upgrade -s

testfailureequal 'Reading package lists...
Building dependency tree...
Solving dependencies...
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:
 git-ng : Depends: git (> 1:2.26.2)
E: Unable to satisfy dependencies. Reached two conflicting assignments:
   1. git:i386=1:2.26.2-1 is selected for install because:
      1. git-ng:amd64=1:2.26.2-1 is selected for install
      2. git-ng:amd64 Depends git (> 1:2.26.2) and Depends git (< 1:2.26.2-.)
         [selected git-ng:amd64]
      For context, additional choices that could not be installed:
      * In git-ng:amd64 Depends git (> 1:2.26.2) and Depends git (< 1:2.26.2-.):
        - git:amd64=1:2.26.2-1 is not selected for install because:
          1. git:amd64=1:2.25.1-1 is selected for install
          2. git:amd64=1:2.26.2-1 conflicts with other versions of itself
   2. git:i386=1:2.26.2-1 ->  | git:i386
      but none of the choices are installable:
      - git:i386 is not selected for install because:
        1. git:amd64=1:2.25.1-1 is selected for install as above
        2. git:i386 Conflicts git
           [selected git:amd64=1:2.25.1-1]' apt install git-ng -s


msgmsg 'Now mix it up by' 'holding git-cvs'
testsuccessequal 'Canceled hold on git.' aptmark unhold git
testsuccessequal 'git-cvs set on hold.' aptmark hold git-cvs
testsuccessequal 'git-cvs' aptmark showholds

testsuccessequal "$NOUPGRADE" apt upgrade -s
testsuccessequal "$NOUPGRADE" apt full-upgrade -s
testsuccessequal "$NOUPGRADE" aptget upgrade -s
testsuccessequal "$NOUPGRADE" aptget dist-upgrade -s

testfailureequal 'Reading package lists...
Building dependency tree...
Solving dependencies...
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:
 git-ng : Depends: git (> 1:2.26.2)
E: Unable to satisfy dependencies. Reached two conflicting assignments:
   1. git-ng:amd64=1:2.26.2-1 is selected for install
   2. git-ng:amd64 Depends git (> 1:2.26.2) and Depends git (< 1:2.26.2-.)
      but none of the choices are installable:
      - git:amd64=1:2.26.2-1 is not selected for install because:
        1. git-cvs:amd64=1:2.25.1-1 is selected for install
        2. git-cvs:amd64=1:2.25.1-1 Depends git (> 1:2.25.1) and Depends git (< 1:2.25.1-.)
        3. git:amd64=1:2.25.1-1 conflicts with other versions of itself
      - git:i386=1:2.26.2-1 is not selected for install because:
        1-2. git:amd64=1:2.25.1-1 is selected for install as above
        3. git:amd64 Conflicts git:i386' apt install git-ng -s


msgmsg 'Now mix it up by' 'holding both'
testsuccessequal 'git set on hold.' aptmark hold git
testsuccessequal 'git
git-cvs' aptmark showholds

testsuccessequal "$NOUPGRADE" apt upgrade -s
testsuccessequal "$NOUPGRADE" apt full-upgrade -s
testsuccessequal "$NOUPGRADE" aptget upgrade -s
testsuccessequal "$NOUPGRADE" aptget dist-upgrade -s

testfailureequal 'Reading package lists...
Building dependency tree...
Solving dependencies...
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:
 git-ng : Depends: git (> 1:2.26.2)
E: Unable to satisfy dependencies. Reached two conflicting assignments:
   1. git-ng:amd64=1:2.26.2-1 is selected for install
   2. git-ng:amd64 Depends git (> 1:2.26.2) and Depends git (< 1:2.26.2-.)
      but none of the choices are installable:
      - git:amd64=1:2.26.2-1 is not selected for install because:
        1. git:amd64=1:2.25.1-1 is selected for install
        2. git:amd64=1:2.25.1-1 conflicts with other versions of itself
      - git:i386=1:2.26.2-1 is not selected for install because:
        1. git:amd64=1:2.25.1-1 is selected for install as above
        2. git:amd64 Conflicts git:i386' apt install git-ng -s

# The Recommends: git (>> 1:2.26.2-1) will be left unsatisfied rather than pulling in chaos-actor.
testsuccessequal 'Reading package lists...
Building dependency tree...
Solving dependencies...
Recommended packages:
  git
The following NEW packages will be installed:
  git-rec-ng
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Inst git-rec-ng (1:2.26.2-1 unstable [amd64])
Conf git-rec-ng (1:2.26.2-1 unstable [amd64])' apt install git-rec-ng -s

msgmsg 'Check that we do not merge unrelated things'

testsuccessequal 'Reading package lists...
Building dependency tree...
Solving dependencies...
The following additional packages will be installed:
  xserver-xorg-input-all xserver-xorg-video-all
The following NEW packages will be installed:
  xserver-xorg xserver-xorg-input-all xserver-xorg-video-all
0 upgraded, 3 newly installed, 0 to remove and 2 not upgraded.
Inst xserver-xorg-input-all (1 unstable [amd64])
Inst xserver-xorg-video-all (1 unstable [amd64])
Inst xserver-xorg (1 unstable [amd64])
Conf xserver-xorg-input-all (1 unstable [amd64])
Conf xserver-xorg-video-all (1 unstable [amd64])
Conf xserver-xorg (1 unstable [amd64])' apt install -s xserver-xorg

testsuccessequal 'Reading package lists...
Building dependency tree...
Solving dependencies...
The following additional packages will be installed:
  xserver-xorg-input-all xserver-xorg-video-all
The following NEW packages will be installed:
  xserver-xorg-input-all xserver-xorg-noalt xserver-xorg-video-all
0 upgraded, 3 newly installed, 0 to remove and 2 not upgraded.
Inst xserver-xorg-input-all (1 unstable [amd64])
Inst xserver-xorg-video-all (1 unstable [amd64])
Inst xserver-xorg-noalt (1 unstable [amd64])
Conf xserver-xorg-input-all (1 unstable [amd64])
Conf xserver-xorg-video-all (1 unstable [amd64])
Conf xserver-xorg-noalt (1 unstable [amd64])' apt install -s xserver-xorg-noalt

testsuccessequal 'Reading package lists...
Building dependency tree...
Solving dependencies...
The following NEW packages will be installed:
  xorgxrdp xserver-xorg
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Inst xorgxrdp (1 unstable [amd64])
Inst xserver-xorg (1 unstable [amd64])
Conf xorgxrdp (1 unstable [amd64])
Conf xserver-xorg (1 unstable [amd64])' apt install -s xserver-xorg xorgxrdp