1 # rpmconflict.at: rpm file conflict tests
3 AT_BANNER([RPM file conflicts])
5 # ------------------------------
6 # (Build and) install conflicting package (should fail)
7 AT_SETUP([package with file conflict])
14 for p in "one" "two"; do
15 runroot rpmbuild --quiet -bb \
17 --define "filedata $p" \
18 /data/SPECS/conflicttest.spec
21 runroot rpm -U "${TOPDIR}"/RPMS/noarch/conflictone-1.0-1.noarch.rpm
22 runroot rpm -U "${TOPDIR}"/RPMS/noarch/conflicttwo-1.0-1.noarch.rpm
29 # ------------------------------
30 # Install conflicting packages in same transaction (should fail)
31 AT_SETUP([two packages with a conflicting file])
32 AT_KEYWORDS([install])
38 "${TOPDIR}"/RPMS/noarch/conflictone-1.0-1.noarch.rpm \
39 "${TOPDIR}"/RPMS/noarch/conflicttwo-1.0-1.noarch.rpm
46 # ------------------------------
47 # (Build and) install package with shareable file
48 AT_SETUP([package with shareable file])
49 AT_KEYWORDS([install])
55 for p in "one" "two"; do
56 runroot rpmbuild --quiet -bb \
58 --define "filedata same_stuff" \
59 /data/SPECS/conflicttest.spec
62 runroot rpm -U "${TOPDIR}"/RPMS/noarch/conflictone-1.0-1.noarch.rpm
63 runroot rpm -U "${TOPDIR}"/RPMS/noarch/conflicttwo-1.0-1.noarch.rpm
70 # ------------------------------
71 # Install packages with shareable file in same transaction
72 AT_SETUP([two packages with shareable file])
73 AT_KEYWORDS([install])
79 "${TOPDIR}"/RPMS/noarch/conflictone-1.0-1.noarch.rpm \
80 "${TOPDIR}"/RPMS/noarch/conflicttwo-1.0-1.noarch.rpm
87 # ------------------------------
88 # (Build and) install package with identical basename in different directories
89 AT_SETUP([non-conflicting identical basenames])
90 AT_KEYWORDS([install])
96 runroot rpmbuild --quiet -bb /data/SPECS/selfconflict.spec
97 rm -rf "${RPMTEST}"/opt/mydir
98 runroot rpm -U "${TOPDIR}"/RPMS/noarch/selfconflict-1.0-1.noarch.rpm
105 # ------------------------------
106 # (Build and) install package with a self-conflict due to directory symlinks
107 AT_SETUP([conflicting identical basenames])
108 AT_KEYWORDS([install])
114 runroot rpmbuild --quiet -bb /data/SPECS/selfconflict.spec
115 rm -rf "${RPMTEST}"/opt/mydir
116 mkdir -p "${RPMTEST}"/opt/mydir/one
117 ln -s one "${RPMTEST}"/opt/mydir/two
118 runroot rpm -U "${TOPDIR}"/RPMS/noarch/selfconflict-1.0-1.noarch.rpm
122 [ file /opt/mydir/two/somefile conflicts between attempted installs of selfconflict-1.0-1.noarch and selfconflict-1.0-1.noarch
125 # ------------------------------
126 # File conflict between colored files, prefer 64bit
127 AT_SETUP([multilib elf conflict, prefer 64bit 1])
128 AT_KEYWORDS([install])
133 runroot rpm -U --ignoreos --ignorearch --nodeps \
134 --define "_transaction_color 3" \
135 --define "_prefer_color 2" \
136 /data/RPMS/hello-2.0-1.i686.rpm \
137 /data/RPMS/hello-2.0-1.x86_64.rpm
138 runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.i686 hello.x86_64
141 [wrong color,normal,normal,normal,normal,
142 normal,normal,normal,normal,normal,
147 # ------------------------------
148 # File conflict between colored files, prefer 64bit
149 AT_SETUP([multilib elf conflict, prefer 64bit 2])
150 AT_KEYWORDS([install])
155 runroot rpm -U --ignoreos --ignorearch --nodeps \
156 --define "_transaction_color 3" \
157 --define "_prefer_color 2" \
158 /data/RPMS/hello-2.0-1.i686.rpm
159 runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.i686
160 runroot rpm -U --ignoreos --ignorearch --nodeps \
161 --define "_transaction_color 3" \
162 --define "_prefer_color 2" \
163 /data/RPMS/hello-2.0-1.x86_64.rpm
164 runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.i686 hello.x86_64
167 [normal,normal,normal,normal,normal,
168 wrong color,normal,normal,normal,normal,
169 normal,normal,normal,normal,normal,
174 # ------------------------------
175 # File conflict between colored files, prefer 64bit
176 AT_SETUP([multilib elf conflict, prefer 64bit 3])
177 AT_KEYWORDS([install])
182 runroot rpm -U --ignoreos --ignorearch --nodeps \
183 --define "_transaction_color 3" \
184 --define "_prefer_color 2" \
185 /data/RPMS/hello-2.0-1.x86_64.rpm
186 runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.x86_64
187 runroot rpm -U --ignoreos --ignorearch --nodeps \
188 --define "_transaction_color 3" \
189 --define "_prefer_color 2" \
190 /data/RPMS/hello-2.0-1.i686.rpm
191 runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.i686 hello.x86_64
194 [normal,normal,normal,normal,normal,
195 wrong color,normal,normal,normal,normal,
196 normal,normal,normal,normal,normal,
201 # ------------------------------
202 # File conflict between colored files, prefer 32bit
203 AT_SETUP([multilib elf conflict, prefer 32bit 1])
204 AT_KEYWORDS([install])
209 runroot rpm -U --ignoreos --ignorearch --nodeps \
210 --define "_transaction_color 3" \
211 --define "_prefer_color 1" \
212 /data/RPMS/hello-2.0-1.i686.rpm \
213 /data/RPMS/hello-2.0-1.x86_64.rpm
214 runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.i686 hello.x86_64
217 [normal,normal,normal,normal,normal,
218 wrong color,normal,normal,normal,normal,
223 # ------------------------------
224 # File conflict between colored files, prefer 32bit
225 AT_SETUP([multilib elf conflict, prefer 32bit 2])
226 AT_KEYWORDS([install])
231 runroot rpm -U --ignoreos --ignorearch --nodeps \
232 --define "_transaction_color 3" \
233 --define "_prefer_color 1" \
234 /data/RPMS/hello-2.0-1.i686.rpm
235 runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.i686
236 runroot rpm -U --ignoreos --ignorearch --nodeps \
237 --define "_transaction_color 3" \
238 --define "_prefer_color 1" \
239 /data/RPMS/hello-2.0-1.x86_64.rpm
240 runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.i686 hello.x86_64
243 [normal,normal,normal,normal,normal,
244 normal,normal,normal,normal,normal,
245 wrong color,normal,normal,normal,normal,
250 # ------------------------------
251 # File conflict between colored files, prefer 32bit
252 AT_SETUP([multilib elf conflict, prefer 32bit 3])
253 AT_KEYWORDS([install])
258 runroot rpm -U --ignoreos --ignorearch --nodeps \
259 --define "_transaction_color 3" \
260 --define "_prefer_color 1" \
261 /data/RPMS/hello-2.0-1.x86_64.rpm
262 runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.x86_64
263 runroot rpm -U --ignoreos --ignorearch --nodeps \
264 --define "_transaction_color 3" \
265 --define "_prefer_color 1" \
266 /data/RPMS/hello-2.0-1.i686.rpm
267 runroot rpm -q --qf "[[%{filestates:fstate},]]\n" hello.i686 hello.x86_64
270 [normal,normal,normal,normal,normal,
271 normal,normal,normal,normal,normal,
272 wrong color,normal,normal,normal,normal,
277 # ------------------------------
278 # File conflict between colored and non-colored file 1
279 AT_SETUP([multilib elf vs non-elf file conflict 1])
280 AT_KEYWORDS([install])
285 runroot rpmbuild --quiet -bb /data/SPECS/hello-script.spec
287 runroot rpm -U --ignoreos --ignorearch --nodeps \
288 --define "_transaction_color 3" \
289 --define "_prefer_color 2" \
290 /data/RPMS/hello-2.0-1.x86_64.rpm \
291 "${TOPDIR}"/RPMS/noarch/hello-script-1.0-1.noarch.rpm
295 [ file /usr/bin/hello conflicts between attempted installs of hello-2.0-1.x86_64 and hello-script-1.0-1.noarch
299 # File conflict between colored and non-colored file 2
300 AT_SETUP([multilib elf vs non-elf file conflict 2])
301 AT_KEYWORDS([install])
306 runroot rpmbuild --quiet -bb /data/SPECS/hello-script.spec
308 runroot rpm -U --ignoreos --ignorearch --nodeps \
309 --define "_transaction_color 3" \
310 --define "_prefer_color 2" \
311 /data/RPMS/hello-2.0-1.x86_64.rpm
313 runroot rpm -U --ignoreos --ignorearch --nodeps \
314 --define "_transaction_color 3" \
315 --define "_prefer_color 2" \
316 "${TOPDIR}"/RPMS/noarch/hello-script-1.0-1.noarch.rpm
320 [ file /usr/bin/hello from install of hello-script-1.0-1.noarch conflicts with file from package hello-2.0-1.x86_64
324 # File conflict between colored and non-colored file 3
325 AT_SETUP([multilib elf vs non-elf file conflict 3])
326 AT_KEYWORDS([install])
331 runroot rpmbuild --quiet -bb /data/SPECS/hello-script.spec
333 runroot rpm -U --ignoreos --ignorearch --nodeps \
334 --define "_transaction_color 3" \
335 --define "_prefer_color 2" \
336 "${TOPDIR}"/RPMS/noarch/hello-script-1.0-1.noarch.rpm
338 runroot rpm -U --ignoreos --ignorearch --nodeps \
339 --define "_transaction_color 3" \
340 --define "_prefer_color 2" \
341 /data/RPMS/hello-2.0-1.x86_64.rpm
345 [ file /usr/bin/hello from install of hello-2.0-1.x86_64 conflicts with file from package hello-script-1.0-1.noarch
349 # ------------------------------
350 # Removal conflict on directory -> symlink change
351 AT_SETUP([replacing directory with symlink])
352 AT_KEYWORDS([install])
357 rm -rf "${RPMTEST}"/usr/{share,lib}/symlinktest*
359 runroot rpmbuild --quiet -bb \
360 --define "rel 1" --without symlink /data/SPECS/symlinktest.spec
361 runroot rpmbuild --quiet -bb \
362 --define "rel 2" --with symlink /data/SPECS/symlinktest.spec
364 runroot rpm -U "${TOPDIR}"/RPMS/noarch/symlinktest-1.0-1.noarch.rpm
365 runroot rpm -U "${TOPDIR}"/RPMS/noarch/symlinktest-1.0-2.noarch.rpm
369 [ file /usr/share/symlinktest from install of symlinktest-1.0-2.noarch conflicts with file from package symlinktest-1.0-1.noarch
373 # ------------------------------
374 # Replace symlink with a directory
375 AT_SETUP([replacing symlink with directory])
376 AT_KEYWORDS([install])
381 rm -rf "${RPMTEST}"/usr/{share,lib}/symlinktest*
383 runroot rpmbuild --quiet -bb \
384 --define "rel 1" --with symlink /data/SPECS/symlinktest.spec
385 runroot rpmbuild --quiet -bb \
386 --define "rel 2" --without symlink /data/SPECS/symlinktest.spec
388 runroot rpm -U "${TOPDIR}"/RPMS/noarch/symlinktest-1.0-1.noarch.rpm
389 runroot rpm -U "${TOPDIR}"/RPMS/noarch/symlinktest-1.0-2.noarch.rpm
393 [ file /usr/share/symlinktest from install of symlinktest-1.0-2.noarch conflicts with file from package symlinktest-1.0-1.noarch
397 # ------------------------------
398 # Regular file shared with a ghost, does not conflict
399 # Regular file should be created and not removed when the ghost is removed
400 AT_SETUP([real file with shared ghost])
401 AT_KEYWORDS([install])
405 fn="${RPMTEST}"/usr/share/my.version
406 rm -rf "${TOPDIR}" "${fn}"
408 runroot rpmbuild --quiet -bb \
409 --define "pkg one" --define "filedata one" \
410 /data/SPECS/conflicttest.spec
411 runroot rpmbuild --quiet -bb \
412 --define "pkg two" --define "filedata two" --define "fileattr %ghost"\
413 /data/SPECS/conflicttest.spec
415 test ! -f "${fn}" && echo OK
417 "${TOPDIR}"/RPMS/noarch/conflictone-1.0-1.noarch.rpm \
418 "${TOPDIR}"/RPMS/noarch/conflicttwo-1.0-1.noarch.rpm
420 runroot rpm -e conflicttwo
422 runroot rpm -e conflictone
423 test ! -f "${fn}" && echo OK