diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-11-22 01:15:20 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-11-22 01:15:20 +0200 |
commit | 0bcdd93151c21b78ff64d05c05711b0bf79966c5 (patch) | |
tree | decf559e827b180a82c1b9723771fa0a75fa8316 /tests/rpmconfig.at | |
parent | 9844bfc9b776b00c56dd389bfe5fb4807b189d59 (diff) | |
download | librpm-tizen-0bcdd93151c21b78ff64d05c05711b0bf79966c5.tar.gz librpm-tizen-0bcdd93151c21b78ff64d05c05711b0bf79966c5.tar.bz2 librpm-tizen-0bcdd93151c21b78ff64d05c05711b0bf79966c5.zip |
Add some basic tests for config file behavior
Diffstat (limited to 'tests/rpmconfig.at')
-rw-r--r-- | tests/rpmconfig.at | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/tests/rpmconfig.at b/tests/rpmconfig.at new file mode 100644 index 000000000..db16307e6 --- /dev/null +++ b/tests/rpmconfig.at @@ -0,0 +1,93 @@ +# rpmvercmp.at: rpm config file behavior tests + +# ------------------------------ +# (Build and) upgrade package with config file, no backup here +AT_SETUP([rpm -U to package with unchanged config file]) +AT_CHECK([ +RPMDB_CLEAR +rm -rf "${TOPDIR}" +rm -rf "${RPMTEST}/etc/my.conf" + +for v in "1.0" "2.0"; do + run rpmbuild --quiet -bb \ + --define "ver $v" \ + --define "filedata foo" \ + ${RPMDATA}/SPECS/configtest.spec +done + +runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm +runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm +], +[0], +) +AT_CLEANUP +# +# ------------------------------ +# Upgrade package with locally modified config file, unchanged in pkg +AT_SETUP([rpm -U to package with locally modified config file]) +AT_CHECK([ +RPMDB_CLEAR +rm -rf "${TOPDIR}" +rm -rf "${RPMTEST}/etc/my.conf" + +for v in "1.0" "2.0"; do + run rpmbuild --quiet -bb \ + --define "ver $v" \ + --define "filedata foo" \ + ${RPMDATA}/SPECS/configtest.spec +done + +runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm +echo "otherstuff" > "${RPMTEST}"/etc/my.conf +runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm +], +[0], +) +AT_CLEANUP + +# ------------------------------ +# Upgrade package with unmodified config file, changed in pkg +AT_SETUP([rpm -U to package with unchanged config file]) +AT_CHECK([ +RPMDB_CLEAR +rm -rf "${TOPDIR}" +rm -rf "${RPMTEST}/etc/my.conf" + +for v in "1.0" "2.0"; do + run rpmbuild --quiet -bb \ + --define "ver $v" \ + --define "filedata foo-$v" \ + ${RPMDATA}/SPECS/configtest.spec +done + +runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm +runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm +], +[0], +) +AT_CLEANUP + +# ------------------------------ +# Upgrade package with locally modified config file, changed in pkg +AT_SETUP([rpm -U to package with modified config file]) +AT_CHECK([ +RPMDB_CLEAR +rm -rf "${TOPDIR}" +rm -rf "${RPMTEST}/etc/my.conf" + +for v in "1.0" "2.0"; do + run rpmbuild --quiet -bb \ + --define "ver $v" \ + --define "filedata foo-$v" \ + ${RPMDATA}/SPECS/configtest.spec +done + +runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm +echo "otherstuff" > "${RPMTEST}"/etc/my.conf +runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm +], +[0], +[ignore], +[warning: /etc/my.conf saved as /etc/my.conf.rpmsave] +) +AT_CLEANUP |