[Rpm-maint] [PATCH] Fix rpmi.at testcase by checking actual datadir and docdir used.

Mark Wielaard mjw at redhat.com
Fri Mar 18 15:16:50 UTC 2016


The testcase for rpm -i with/without --excludedocs had hardcoded paths
checking if files were installed or not. This meant that depending on
the configure --prefix used the test might fail because the datadir
and/or docdir were different from expected. Fixed by checking the
actual datadir and (default)docdir to test against.
---
 tests/rpmi.at | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/tests/rpmi.at b/tests/rpmi.at
index ec58ce1..6742761 100644
--- a/tests/rpmi.at
+++ b/tests/rpmi.at
@@ -332,18 +332,21 @@ runroot rpmbuild --quiet -bb /data/SPECS/testdoc.spec
 runroot rpm -i --excludedocs \
   "${TOPDIR}"/RPMS/noarch/testdoc-1.0-1.noarch.rpm
 
-test ! -e ${RPMTEST}/usr/share/doc/testdoc || exit 1
-test -e ${RPMTEST}/usr/share/testdoc/nodoc || exit 1
+RPM_DOCDIR=$(runroot rpm --eval '%_defaultdocdir')
+RPM_DATADIR=$(runroot rpm --eval '%_datadir')
+
+test ! -e ${RPMTEST}${RPM_DOCDIR}/testdoc || exit 1
+test -e ${RPMTEST}${RPM_DATADIR}/testdoc/nodoc || exit 1
 
 runroot rpm -e testdoc
 
 runroot rpm -i \
   "${TOPDIR}"/RPMS/noarch/testdoc-1.0-1.noarch.rpm
-test -e ${RPMTEST}/usr/share/doc/testdoc/documentation1 || exit 1
-test -e ${RPMTEST}/usr/share/doc/testdoc/documentation2 || exit 1
-test -e ${RPMTEST}/usr/share/doc/testdoc/examples/example1 || exit 1
-test -e ${RPMTEST}/usr/share/doc/testdoc/examples/example2 || exit 1
-test -e ${RPMTEST}/usr/share/testdoc/nodoc || exit 1
+test -e ${RPMTEST}${RPM_DOCDIR}/testdoc/documentation1 || exit 1
+test -e ${RPMTEST}${RPM_DOCDIR}/testdoc/documentation2 || exit 1
+test -e ${RPMTEST}${RPM_DOCDIR}/testdoc/examples/example1 || exit 1
+test -e ${RPMTEST}${RPM_DOCDIR}/testdoc/examples/example2 || exit 1
+test -e ${RPMTEST}${RPM_DATADIR}/testdoc/nodoc || exit 1
 
 runroot rpm -e testdoc
 ],
-- 
2.5.0



More information about the Rpm-maint mailing list