From c7403b0c8878c6767cc8535e4a0872ea8bbe350c Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 20 Aug 2012 09:49:13 +0300 Subject: Tighten the existing %config tests a bit - Test for actual file content - Also clean up any .rpm[new|save|orig] files from the testroot --- tests/rpmconfig.at | 45 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 9 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3