summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-08-20 09:49:13 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-08-20 09:49:13 +0300
commitc7403b0c8878c6767cc8535e4a0872ea8bbe350c (patch)
tree4064d3a0f11bcb3be8f4d9a7ccfebf2767bc20e0 /tests
parentbf3d65e7951aa9d98ef86db15982643a9cad79ce (diff)
downloadrpm-c7403b0c8878c6767cc8535e4a0872ea8bbe350c.tar.gz
rpm-c7403b0c8878c6767cc8535e4a0872ea8bbe350c.tar.bz2
rpm-c7403b0c8878c6767cc8535e4a0872ea8bbe350c.zip
Tighten the existing %config tests a bit
- Test for actual file content - Also clean up any .rpm[new|save|orig] files from the testroot
Diffstat (limited to 'tests')
-rw-r--r--tests/rpmconfig.at45
1 files changed, 36 insertions, 9 deletions
diff --git a/tests/rpmconfig.at b/tests/rpmconfig.at
index e84afb2d5..88f4176d7 100644
--- a/tests/rpmconfig.at
+++ b/tests/rpmconfig.at
@@ -9,8 +9,9 @@ AT_KEYWORDS([install])
AT_CHECK([
RPMDB_CLEAR
RPMDB_INIT
+cf="${RPMTEST}"/etc/my.conf
+rm -f "${cf}" "${cf}".rpm*
rm -rf "${TOPDIR}"
-rm -rf "${RPMTEST}/etc/my.conf"
for v in "1.0" "2.0"; do
runroot rpmbuild --quiet -bb \
@@ -20,10 +21,15 @@ for v in "1.0" "2.0"; do
done
runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
+cat "${cf}"
runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
+cat "${cf}"
],
[0],
-)
+[foo
+foo
+],
+[])
AT_CLEANUP
#
# ------------------------------
@@ -33,8 +39,9 @@ AT_KEYWORDS([install])
AT_CHECK([
RPMDB_CLEAR
RPMDB_INIT
+cf="${RPMTEST}"/etc/my.conf
+rm -f "${cf}" "${cf}".rpm*
rm -rf "${TOPDIR}"
-rm -rf "${RPMTEST}/etc/my.conf"
for v in "1.0" "2.0"; do
runroot rpmbuild --quiet -bb \
@@ -44,11 +51,18 @@ for v in "1.0" "2.0"; do
done
runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
-echo "otherstuff" > "${RPMTEST}"/etc/my.conf
+cat "${cf}"
+echo "otherstuff" > "${cf}"
+cat "${cf}"
runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
+cat "${cf}"
],
[0],
-)
+[foo
+otherstuff
+otherstuff
+],
+[])
AT_CLEANUP
# ------------------------------
@@ -58,8 +72,9 @@ AT_KEYWORDS([install])
AT_CHECK([
RPMDB_CLEAR
RPMDB_INIT
+cf="${RPMTEST}"/etc/my.conf
+rm -f "${cf}" "${cf}".rpm*
rm -rf "${TOPDIR}"
-rm -rf "${RPMTEST}/etc/my.conf"
for v in "1.0" "2.0"; do
runroot rpmbuild --quiet -bb \
@@ -69,10 +84,15 @@ for v in "1.0" "2.0"; do
done
runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
+cat "${cf}"
runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
+cat "${cf}"
],
[0],
-)
+[foo-1.0
+foo-2.0
+],
+[])
AT_CLEANUP
# ------------------------------
@@ -82,8 +102,9 @@ AT_KEYWORDS([install])
AT_CHECK([
RPMDB_CLEAR
RPMDB_INIT
+cf="${RPMTEST}"/etc/my.conf
+rm -f "${cf}" "${cf}".rpm*
rm -rf "${TOPDIR}"
-rm -rf "${RPMTEST}/etc/my.conf"
for v in "1.0" "2.0"; do
runroot rpmbuild --quiet -bb \
@@ -93,11 +114,17 @@ for v in "1.0" "2.0"; do
done
runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-1.0-1.noarch.rpm
+cat "${cf}"
echo "otherstuff" > "${RPMTEST}"/etc/my.conf
+cat "${cf}"
runroot rpm -U "${TOPDIR}"/RPMS/noarch/configtest-2.0-1.noarch.rpm
+cat "${cf}"
],
[0],
-[ignore],
+[foo-1.0
+otherstuff
+foo-2.0
+],
[warning: /etc/my.conf saved as /etc/my.conf.rpmsave]
)
AT_CLEANUP