1 # rpmvercmp.at: rpm config file behavior tests
3 AT_BANNER([RPM config file behavior])
5 # ------------------------------
6 # (Build and) upgrade package with config file, no backup here
7 AT_SETUP([upgrade unchanged config])
12 cf="${RPMTEST}"/etc/my.conf
13 rm -f "${cf}" "${cf}".rpm*
16 for v in "1.0" "2.0"; do
17 runroot rpmbuild --quiet -bb \
19 --define "filedata foo" \
20 /data/SPECS/configtest.spec
23 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
25 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
35 # ------------------------------
36 # Upgrade package with locally modified config file, unchanged in pkg
37 AT_SETUP([upgrade modified config])
38 AT_KEYWORDS([install])
42 cf="${RPMTEST}"/etc/my.conf
43 rm -f "${cf}" "${cf}".rpm*
46 for v in "1.0" "2.0"; do
47 runroot rpmbuild --quiet -bb \
49 --define "filedata foo" \
50 /data/SPECS/configtest.spec
53 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
55 echo "otherstuff" > "${cf}"
57 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
68 # ------------------------------
69 # Upgrade package with unmodified config file, changed in pkg
70 AT_SETUP([upgrade changing config])
71 AT_KEYWORDS([install])
75 cf="${RPMTEST}"/etc/my.conf
76 rm -f "${cf}" "${cf}".rpm*
79 for v in "1.0" "2.0"; do
80 runroot rpmbuild --quiet -bb \
82 --define "filedata foo-$v" \
83 /data/SPECS/configtest.spec
86 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
88 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
98 # ------------------------------
99 # Upgrade package with locally modified config file, changed in pkg
100 AT_SETUP([upgrade changing, modified config 1])
101 AT_KEYWORDS([install])
105 cf="${RPMTEST}"/etc/my.conf
106 rm -f "${cf}" "${cf}".rpm*
109 for v in "1.0" "2.0"; do
110 runroot rpmbuild --quiet -bb \
112 --define "filedata foo-$v" \
113 /data/SPECS/configtest.spec
116 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
118 echo "otherstuff" > "${RPMTEST}"/etc/my.conf
120 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
130 [warning: /etc/my.conf saved as /etc/my.conf.rpmsave]
134 # ------------------------------
135 # Modified config file matches the content from new package. Creating a
136 # backup makes no sense in this case, but that's what currently happens.
137 AT_SETUP([upgrade changing, modified config 2])
138 AT_KEYWORDS([install])
142 cf="${RPMTEST}"/etc/my.conf
143 rm -f "${cf}" "${cf}".rpm*
146 for v in "1.0" "2.0"; do
147 runroot rpmbuild --quiet -bb \
149 --define "filedata foo-$v" \
150 /data/SPECS/configtest.spec
153 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
155 echo "foo-2.0" > "${RPMTEST}"/etc/my.conf
157 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
165 [warning: /etc/my.conf saved as /etc/my.conf.rpmsave]
169 # config(noreplace) variants of the same cases.
171 # ------------------------------
172 # (Build and) upgrade package with config file, no backup here
173 AT_SETUP([upgrade unchanged config(noreplace)])
174 AT_KEYWORDS([install])
178 cf="${RPMTEST}"/etc/my.conf
179 rm -f "${cf}" "${cf}".rpm*
182 for v in "1.0" "2.0"; do
183 runroot rpmbuild --quiet -bb \
185 --define "filedata foo" \
186 --define "noreplace 1" \
187 /data/SPECS/configtest.spec
190 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
192 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
203 # ------------------------------
204 # Upgrade package with locally modified config file, unchanged in pkg
205 AT_SETUP([upgrade modified config(noreplace)])
206 AT_KEYWORDS([install])
210 cf="${RPMTEST}"/etc/my.conf
211 rm -f "${cf}" "${cf}".rpm*
214 for v in "1.0" "2.0"; do
215 runroot rpmbuild --quiet -bb \
217 --define "filedata foo" \
218 --define "noreplace 1" \
219 /data/SPECS/configtest.spec
222 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
224 echo "otherstuff" > "${cf}"
226 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
237 # ------------------------------
238 # Upgrade package with unmodified config file, changed in pkg
239 AT_SETUP([upgrade changing config(noreplace)])
240 AT_KEYWORDS([install])
244 cf="${RPMTEST}"/etc/my.conf
245 rm -f "${cf}" "${cf}".rpm*
248 for v in "1.0" "2.0"; do
249 runroot rpmbuild --quiet -bb \
251 --define "filedata foo-$v" \
252 --define "noreplace 1" \
253 /data/SPECS/configtest.spec
256 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
258 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
268 # ------------------------------
269 # Upgrade package with locally modified config file, changed in pkg
270 AT_SETUP([upgrade changing, modified config(noreplace) 1])
271 AT_KEYWORDS([install])
275 cf="${RPMTEST}"/etc/my.conf
276 rm -f "${cf}" "${cf}".rpm*
279 for v in "1.0" "2.0"; do
280 runroot rpmbuild --quiet -bb \
282 --define "filedata foo-$v" \
283 --define "noreplace 1" \
284 /data/SPECS/configtest.spec
287 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
289 echo "otherstuff" > "${RPMTEST}"/etc/my.conf
291 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
301 [warning: /etc/my.conf created as /etc/my.conf.rpmnew]
305 # ------------------------------
306 # Modified config file matches the content from new package. Creating a
307 # backup makes no sense in this case, but that's what currently happens.
308 AT_SETUP([upgrade changing, modified config(noreplace) 2])
309 AT_KEYWORDS([install])
313 cf="${RPMTEST}"/etc/my.conf
314 rm -f "${cf}" "${cf}".rpm*
317 for v in "1.0" "2.0"; do
318 runroot rpmbuild --quiet -bb \
320 --define "filedata foo-$v" \
321 --define "noreplace 1" \
322 /data/SPECS/configtest.spec
325 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
327 echo "foo-2.0" > "${RPMTEST}"/etc/my.conf
329 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
337 [warning: /etc/my.conf created as /etc/my.conf.rpmnew]
341 # Shared config file variants of the same cases
342 # ------------------------------
343 # (Build and) upgrade package with config file, no backup here
344 AT_SETUP([upgrade unchanged shared config])
345 AT_KEYWORDS([install])
349 cf="${RPMTEST}"/etc/my.conf
350 rm -f "${cf}" "${cf}".rpm*
354 for v in "1.0" "2.0"; do
355 runroot rpmbuild --quiet -bb \
358 --define "filedata foo" \
359 /data/SPECS/configtest.spec
364 "${TOPDIR}"/RPMS/noarch/configtest-A-1.0-1.noarch.rpm \
365 "${TOPDIR}"/RPMS/noarch/configtest-B-1.0-1.noarch.rpm
368 "${TOPDIR}"/RPMS/noarch/configtest-A-2.0-1.noarch.rpm \
369 "${TOPDIR}"/RPMS/noarch/configtest-B-2.0-1.noarch.rpm
380 # ------------------------------
381 # Upgrade package with locally modified config file, unchanged in pkg
382 AT_SETUP([upgrade modified shared config])
383 AT_KEYWORDS([install])
387 cf="${RPMTEST}"/etc/my.conf
388 rm -f "${cf}" "${cf}".rpm*
392 for v in "1.0" "2.0"; do
393 runroot rpmbuild --quiet -bb \
396 --define "filedata foo" \
397 /data/SPECS/configtest.spec
402 "${TOPDIR}"/RPMS/noarch/configtest-A-1.0-1.noarch.rpm \
403 "${TOPDIR}"/RPMS/noarch/configtest-B-1.0-1.noarch.rpm
405 echo "otherstuff" > "${cf}"
408 "${TOPDIR}"/RPMS/noarch/configtest-A-2.0-1.noarch.rpm \
409 "${TOPDIR}"/RPMS/noarch/configtest-B-2.0-1.noarch.rpm
420 # ------------------------------
421 # Upgrade package with unmodified config file, changed in pkg
422 AT_SETUP([upgrade changing shared config])
423 AT_KEYWORDS([install])
427 cf="${RPMTEST}"/etc/my.conf
428 rm -f "${cf}" "${cf}".rpm*
432 for v in "1.0" "2.0"; do
433 runroot rpmbuild --quiet -bb \
436 --define "filedata foo-$v" \
437 /data/SPECS/configtest.spec
442 "${TOPDIR}"/RPMS/noarch/configtest-A-1.0-1.noarch.rpm \
443 "${TOPDIR}"/RPMS/noarch/configtest-B-1.0-1.noarch.rpm
446 "${TOPDIR}"/RPMS/noarch/configtest-A-2.0-1.noarch.rpm \
447 "${TOPDIR}"/RPMS/noarch/configtest-B-2.0-1.noarch.rpm
457 # ------------------------------
458 # Upgrade package with locally modified config file, changed in pkg
459 AT_SETUP([upgrade changing, modified shared config 1])
460 AT_KEYWORDS([install])
464 cf="${RPMTEST}"/etc/my.conf
465 rm -f "${cf}" "${cf}".rpm*
469 for v in "1.0" "2.0"; do
470 runroot rpmbuild --quiet -bb \
473 --define "filedata foo-$v" \
474 /data/SPECS/configtest.spec
479 "${TOPDIR}"/RPMS/noarch/configtest-A-1.0-1.noarch.rpm \
480 "${TOPDIR}"/RPMS/noarch/configtest-B-1.0-1.noarch.rpm
482 echo "otherstuff" > "${RPMTEST}"/etc/my.conf
485 "${TOPDIR}"/RPMS/noarch/configtest-A-2.0-1.noarch.rpm \
486 "${TOPDIR}"/RPMS/noarch/configtest-B-2.0-1.noarch.rpm
496 [warning: /etc/my.conf saved as /etc/my.conf.rpmsave]
500 # ------------------------------
501 # Modified config file matches the content from new package. Creating a
502 # backup makes no sense in this case, but that's what currently happens.
503 AT_SETUP([upgrade changing, modified shared config 2])
504 AT_KEYWORDS([install])
508 cf="${RPMTEST}"/etc/my.conf
509 rm -f "${cf}" "${cf}".rpm*
513 for v in "1.0" "2.0"; do
514 runroot rpmbuild --quiet -bb \
517 --define "filedata foo-$v" \
518 /data/SPECS/configtest.spec
523 "${TOPDIR}"/RPMS/noarch/configtest-A-1.0-1.noarch.rpm \
524 "${TOPDIR}"/RPMS/noarch/configtest-B-1.0-1.noarch.rpm
526 echo "foo-2.0" > "${RPMTEST}"/etc/my.conf
529 "${TOPDIR}"/RPMS/noarch/configtest-A-2.0-1.noarch.rpm \
530 "${TOPDIR}"/RPMS/noarch/configtest-B-2.0-1.noarch.rpm
538 [warning: /etc/my.conf saved as /etc/my.conf.rpmsave]
542 # Shared config(noreplace) variants of the more interesting cases
543 # ------------------------------
544 # Upgrade package with locally modified config file, changed in pkg.
545 AT_SETUP([upgrade changing, modified shared config(noreplace) 1])
546 AT_KEYWORDS([install])
550 cf="${RPMTEST}"/etc/my.conf
551 rm -f "${cf}" "${cf}".rpm*
555 for v in "1.0" "2.0"; do
556 runroot rpmbuild --quiet -bb \
559 --define "filedata foo-$v" \
560 --define "noreplace 1" \
561 /data/SPECS/configtest.spec
566 "${TOPDIR}"/RPMS/noarch/configtest-A-1.0-1.noarch.rpm \
567 "${TOPDIR}"/RPMS/noarch/configtest-B-1.0-1.noarch.rpm
569 echo "otherstuff" > "${RPMTEST}"/etc/my.conf
572 "${TOPDIR}"/RPMS/noarch/configtest-A-2.0-1.noarch.rpm \
573 "${TOPDIR}"/RPMS/noarch/configtest-B-2.0-1.noarch.rpm
583 [warning: /etc/my.conf created as /etc/my.conf.rpmnew]
587 # ------------------------------
588 # Modified config file matches the content from new package. Creating a
589 # backup makes no sense in this case, but that's what currently happens.
590 AT_SETUP([upgrade changing, modified shared config(noreplace) 2])
591 AT_KEYWORDS([install])
595 cf="${RPMTEST}"/etc/my.conf
596 rm -f "${cf}" "${cf}".rpm*
600 for v in "1.0" "2.0"; do
601 runroot rpmbuild --quiet -bb \
604 --define "filedata foo-$v" \
605 --define "noreplace 1" \
606 /data/SPECS/configtest.spec
611 "${TOPDIR}"/RPMS/noarch/configtest-A-1.0-1.noarch.rpm \
612 "${TOPDIR}"/RPMS/noarch/configtest-B-1.0-1.noarch.rpm
614 echo "foo-2.0" > "${RPMTEST}"/etc/my.conf
617 "${TOPDIR}"/RPMS/noarch/configtest-A-2.0-1.noarch.rpm \
618 "${TOPDIR}"/RPMS/noarch/configtest-B-2.0-1.noarch.rpm
626 [warning: /etc/my.conf created as /etc/my.conf.rpmnew]