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
128 [warning: /etc/my.conf saved as /etc/my.conf.rpmsave]
132 # ------------------------------
133 # Modified config file matches the content from new package. Creating a
134 # backup makes no sense in this case, but that's what currently happens.
135 AT_SETUP([upgrade changing, modified config 2])
136 AT_KEYWORDS([install])
140 cf="${RPMTEST}"/etc/my.conf
141 rm -f "${cf}" "${cf}".rpm*
144 for v in "1.0" "2.0"; do
145 runroot rpmbuild --quiet -bb \
147 --define "filedata foo-$v" \
148 /data/SPECS/configtest.spec
151 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
153 echo "foo-2.0" > "${RPMTEST}"/etc/my.conf
155 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
163 [warning: /etc/my.conf saved as /etc/my.conf.rpmsave]
167 # config(noreplace) variants of the same cases.
169 # ------------------------------
170 # (Build and) upgrade package with config file, no backup here
171 AT_SETUP([upgrade unchanged config(noreplace)])
172 AT_KEYWORDS([install])
176 cf="${RPMTEST}"/etc/my.conf
177 rm -f "${cf}" "${cf}".rpm*
180 for v in "1.0" "2.0"; do
181 runroot rpmbuild --quiet -bb \
183 --define "filedata foo" \
184 --define "noreplace 1" \
185 /data/SPECS/configtest.spec
188 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
190 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
201 # ------------------------------
202 # Upgrade package with locally modified config file, unchanged in pkg
203 AT_SETUP([upgrade modified config(noreplace)])
204 AT_KEYWORDS([install])
208 cf="${RPMTEST}"/etc/my.conf
209 rm -f "${cf}" "${cf}".rpm*
212 for v in "1.0" "2.0"; do
213 runroot rpmbuild --quiet -bb \
215 --define "filedata foo" \
216 --define "noreplace 1" \
217 /data/SPECS/configtest.spec
220 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
222 echo "otherstuff" > "${cf}"
224 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
235 # ------------------------------
236 # Upgrade package with unmodified config file, changed in pkg
237 AT_SETUP([upgrade changing config(noreplace)])
238 AT_KEYWORDS([install])
242 cf="${RPMTEST}"/etc/my.conf
243 rm -f "${cf}" "${cf}".rpm*
246 for v in "1.0" "2.0"; do
247 runroot rpmbuild --quiet -bb \
249 --define "filedata foo-$v" \
250 --define "noreplace 1" \
251 /data/SPECS/configtest.spec
254 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
256 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
266 # ------------------------------
267 # Upgrade package with locally modified config file, changed in pkg
268 AT_SETUP([upgrade changing, modified config(noreplace) 1])
269 AT_KEYWORDS([install])
273 cf="${RPMTEST}"/etc/my.conf
274 rm -f "${cf}" "${cf}".rpm*
277 for v in "1.0" "2.0"; do
278 runroot rpmbuild --quiet -bb \
280 --define "filedata foo-$v" \
281 --define "noreplace 1" \
282 /data/SPECS/configtest.spec
285 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
287 echo "otherstuff" > "${RPMTEST}"/etc/my.conf
289 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
297 [warning: /etc/my.conf created as /etc/my.conf.rpmnew]
301 # ------------------------------
302 # Modified config file matches the content from new package. Creating a
303 # backup makes no sense in this case, but that's what currently happens.
304 AT_SETUP([upgrade changing, modified config(noreplace) 2])
305 AT_KEYWORDS([install])
309 cf="${RPMTEST}"/etc/my.conf
310 rm -f "${cf}" "${cf}".rpm*
313 for v in "1.0" "2.0"; do
314 runroot rpmbuild --quiet -bb \
316 --define "filedata foo-$v" \
317 --define "noreplace 1" \
318 /data/SPECS/configtest.spec
321 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
323 echo "foo-2.0" > "${RPMTEST}"/etc/my.conf
325 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
333 [warning: /etc/my.conf created as /etc/my.conf.rpmnew]
337 # Shared config file variants of the same cases
338 # ------------------------------
339 # (Build and) upgrade package with config file, no backup here
340 AT_SETUP([upgrade unchanged shared config])
341 AT_KEYWORDS([install])
345 cf="${RPMTEST}"/etc/my.conf
346 rm -f "${cf}" "${cf}".rpm*
350 for v in "1.0" "2.0"; do
351 runroot rpmbuild --quiet -bb \
354 --define "filedata foo" \
355 /data/SPECS/configtest.spec
360 "${TOPDIR}"/RPMS/noarch/configtest-A-1.0-1.noarch.rpm \
361 "${TOPDIR}"/RPMS/noarch/configtest-B-1.0-1.noarch.rpm
364 "${TOPDIR}"/RPMS/noarch/configtest-A-2.0-1.noarch.rpm \
365 "${TOPDIR}"/RPMS/noarch/configtest-B-2.0-1.noarch.rpm
376 # ------------------------------
377 # Upgrade package with locally modified config file, unchanged in pkg
378 AT_SETUP([upgrade modified shared config])
379 AT_KEYWORDS([install])
383 cf="${RPMTEST}"/etc/my.conf
384 rm -f "${cf}" "${cf}".rpm*
388 for v in "1.0" "2.0"; do
389 runroot rpmbuild --quiet -bb \
392 --define "filedata foo" \
393 /data/SPECS/configtest.spec
398 "${TOPDIR}"/RPMS/noarch/configtest-A-1.0-1.noarch.rpm \
399 "${TOPDIR}"/RPMS/noarch/configtest-B-1.0-1.noarch.rpm
401 echo "otherstuff" > "${cf}"
404 "${TOPDIR}"/RPMS/noarch/configtest-A-2.0-1.noarch.rpm \
405 "${TOPDIR}"/RPMS/noarch/configtest-B-2.0-1.noarch.rpm
416 # ------------------------------
417 # Upgrade package with unmodified config file, changed in pkg
418 AT_SETUP([upgrade changing shared config])
419 AT_KEYWORDS([install])
423 cf="${RPMTEST}"/etc/my.conf
424 rm -f "${cf}" "${cf}".rpm*
428 for v in "1.0" "2.0"; do
429 runroot rpmbuild --quiet -bb \
432 --define "filedata foo-$v" \
433 /data/SPECS/configtest.spec
438 "${TOPDIR}"/RPMS/noarch/configtest-A-1.0-1.noarch.rpm \
439 "${TOPDIR}"/RPMS/noarch/configtest-B-1.0-1.noarch.rpm
442 "${TOPDIR}"/RPMS/noarch/configtest-A-2.0-1.noarch.rpm \
443 "${TOPDIR}"/RPMS/noarch/configtest-B-2.0-1.noarch.rpm
453 # ------------------------------
454 # Upgrade package with locally modified config file, changed in pkg
455 AT_SETUP([upgrade changing, modified shared config 1])
456 AT_KEYWORDS([install])
460 cf="${RPMTEST}"/etc/my.conf
461 rm -f "${cf}" "${cf}".rpm*
465 for v in "1.0" "2.0"; do
466 runroot rpmbuild --quiet -bb \
469 --define "filedata foo-$v" \
470 /data/SPECS/configtest.spec
475 "${TOPDIR}"/RPMS/noarch/configtest-A-1.0-1.noarch.rpm \
476 "${TOPDIR}"/RPMS/noarch/configtest-B-1.0-1.noarch.rpm
478 echo "otherstuff" > "${RPMTEST}"/etc/my.conf
481 "${TOPDIR}"/RPMS/noarch/configtest-A-2.0-1.noarch.rpm \
482 "${TOPDIR}"/RPMS/noarch/configtest-B-2.0-1.noarch.rpm
490 [warning: /etc/my.conf saved as /etc/my.conf.rpmsave]
494 # ------------------------------
495 # Modified config file matches the content from new package. Creating a
496 # backup makes no sense in this case, but that's what currently happens.
497 AT_SETUP([upgrade changing, modified shared config 2])
498 AT_KEYWORDS([install])
502 cf="${RPMTEST}"/etc/my.conf
503 rm -f "${cf}" "${cf}".rpm*
507 for v in "1.0" "2.0"; do
508 runroot rpmbuild --quiet -bb \
511 --define "filedata foo-$v" \
512 /data/SPECS/configtest.spec
517 "${TOPDIR}"/RPMS/noarch/configtest-A-1.0-1.noarch.rpm \
518 "${TOPDIR}"/RPMS/noarch/configtest-B-1.0-1.noarch.rpm
520 echo "foo-2.0" > "${RPMTEST}"/etc/my.conf
523 "${TOPDIR}"/RPMS/noarch/configtest-A-2.0-1.noarch.rpm \
524 "${TOPDIR}"/RPMS/noarch/configtest-B-2.0-1.noarch.rpm
532 [warning: /etc/my.conf saved as /etc/my.conf.rpmsave]
536 # Shared config(noreplace) variants of the more interesting cases
537 # ------------------------------
538 # Upgrade package with locally modified config file, changed in pkg.
539 # Creating *two* backups makes no sense, but that's what currently happens.
540 AT_SETUP([upgrade changing, modified shared config(noreplace) 1])
541 AT_KEYWORDS([install])
545 cf="${RPMTEST}"/etc/my.conf
546 rm -f "${cf}" "${cf}".rpm*
550 for v in "1.0" "2.0"; do
551 runroot rpmbuild --quiet -bb \
554 --define "filedata foo-$v" \
555 --define "noreplace 1" \
556 /data/SPECS/configtest.spec
561 "${TOPDIR}"/RPMS/noarch/configtest-A-1.0-1.noarch.rpm \
562 "${TOPDIR}"/RPMS/noarch/configtest-B-1.0-1.noarch.rpm
564 echo "otherstuff" > "${RPMTEST}"/etc/my.conf
567 "${TOPDIR}"/RPMS/noarch/configtest-A-2.0-1.noarch.rpm \
568 "${TOPDIR}"/RPMS/noarch/configtest-B-2.0-1.noarch.rpm
576 [warning: /etc/my.conf created as /etc/my.conf.rpmnew
577 warning: /etc/my.conf created as /etc/my.conf.rpmnew]
581 # ------------------------------
582 # Modified config file matches the content from new package. Creating a
583 # backup makes no sense in this case, but that's what currently happens.
584 AT_SETUP([upgrade changing, modified shared config(noreplace) 2])
585 AT_KEYWORDS([install])
589 cf="${RPMTEST}"/etc/my.conf
590 rm -f "${cf}" "${cf}".rpm*
594 for v in "1.0" "2.0"; do
595 runroot rpmbuild --quiet -bb \
598 --define "filedata foo-$v" \
599 --define "noreplace 1" \
600 /data/SPECS/configtest.spec
605 "${TOPDIR}"/RPMS/noarch/configtest-A-1.0-1.noarch.rpm \
606 "${TOPDIR}"/RPMS/noarch/configtest-B-1.0-1.noarch.rpm
608 echo "foo-2.0" > "${RPMTEST}"/etc/my.conf
611 "${TOPDIR}"/RPMS/noarch/configtest-A-2.0-1.noarch.rpm \
612 "${TOPDIR}"/RPMS/noarch/configtest-B-2.0-1.noarch.rpm
620 [warning: /etc/my.conf created as /etc/my.conf.rpmnew]