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.
136 AT_SETUP([upgrade changing, modified config 2])
137 AT_KEYWORDS([install])
141 cf="${RPMTEST}"/etc/my.conf
142 rm -f "${cf}" "${cf}".rpm*
145 for v in "1.0" "2.0"; do
146 runroot rpmbuild --quiet -bb \
148 --define "filedata foo-$v" \
149 /data/SPECS/configtest.spec
152 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
154 echo "foo-2.0" > "${RPMTEST}"/etc/my.conf
156 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
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
299 [warning: /etc/my.conf created as /etc/my.conf.rpmnew]
303 # ------------------------------
304 # Modified config file matches the content from new package.
305 AT_SETUP([upgrade changing, modified config(noreplace) 2])
306 AT_KEYWORDS([install])
310 cf="${RPMTEST}"/etc/my.conf
311 rm -f "${cf}" "${cf}".rpm*
314 for v in "1.0" "2.0"; do
315 runroot rpmbuild --quiet -bb \
317 --define "filedata foo-$v" \
318 --define "noreplace 1" \
319 /data/SPECS/configtest.spec
322 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
324 echo "foo-2.0" > "${RPMTEST}"/etc/my.conf
326 runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
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
492 [warning: /etc/my.conf saved as /etc/my.conf.rpmsave]
496 # ------------------------------
497 # Modified config file matches the content from new package.
498 AT_SETUP([upgrade changing, modified shared config 2])
499 AT_KEYWORDS([install])
503 cf="${RPMTEST}"/etc/my.conf
504 rm -f "${cf}" "${cf}".rpm*
508 for v in "1.0" "2.0"; do
509 runroot rpmbuild --quiet -bb \
512 --define "filedata foo-$v" \
513 /data/SPECS/configtest.spec
518 "${TOPDIR}"/RPMS/noarch/configtest-A-1.0-1.noarch.rpm \
519 "${TOPDIR}"/RPMS/noarch/configtest-B-1.0-1.noarch.rpm
521 echo "foo-2.0" > "${RPMTEST}"/etc/my.conf
524 "${TOPDIR}"/RPMS/noarch/configtest-A-2.0-1.noarch.rpm \
525 "${TOPDIR}"/RPMS/noarch/configtest-B-2.0-1.noarch.rpm
536 # Shared config(noreplace) variants of the more interesting cases
537 # ------------------------------
538 # Upgrade package with locally modified config file, changed in pkg.
539 AT_SETUP([upgrade changing, modified shared config(noreplace) 1])
540 AT_KEYWORDS([install])
544 cf="${RPMTEST}"/etc/my.conf
545 rm -f "${cf}" "${cf}".rpm*
549 for v in "1.0" "2.0"; do
550 runroot rpmbuild --quiet -bb \
553 --define "filedata foo-$v" \
554 --define "noreplace 1" \
555 /data/SPECS/configtest.spec
560 "${TOPDIR}"/RPMS/noarch/configtest-A-1.0-1.noarch.rpm \
561 "${TOPDIR}"/RPMS/noarch/configtest-B-1.0-1.noarch.rpm
563 echo "otherstuff" > "${RPMTEST}"/etc/my.conf
566 "${TOPDIR}"/RPMS/noarch/configtest-A-2.0-1.noarch.rpm \
567 "${TOPDIR}"/RPMS/noarch/configtest-B-2.0-1.noarch.rpm
577 [warning: /etc/my.conf created as /etc/my.conf.rpmnew]
581 # ------------------------------
582 # Modified config file matches the content from new package.
583 AT_SETUP([upgrade changing, modified shared config(noreplace) 2])
584 AT_KEYWORDS([install])
588 cf="${RPMTEST}"/etc/my.conf
589 rm -f "${cf}" "${cf}".rpm*
593 for v in "1.0" "2.0"; do
594 runroot rpmbuild --quiet -bb \
597 --define "filedata foo-$v" \
598 --define "noreplace 1" \
599 /data/SPECS/configtest.spec
604 "${TOPDIR}"/RPMS/noarch/configtest-A-1.0-1.noarch.rpm \
605 "${TOPDIR}"/RPMS/noarch/configtest-B-1.0-1.noarch.rpm
607 echo "foo-2.0" > "${RPMTEST}"/etc/my.conf
610 "${TOPDIR}"/RPMS/noarch/configtest-A-2.0-1.noarch.rpm \
611 "${TOPDIR}"/RPMS/noarch/configtest-B-2.0-1.noarch.rpm