# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+# ------------------------------
# Attempt to initialize a rpmdb
AT_SETUP([rpm --initdb])
AT_CHECK([
-DBPATH=`rpm --rcfile=${RPMRC} --eval '%_dbpath'`
-rm -rf "${abs_builddir}"/testing"${DBPATH}"/*
-rpm \
- --rcfile=${RPMRC} \
- --root="${abs_builddir}"/testing \
- --initdb],
+RPM_INIT_DB
+],
[0],
[ignore],
[ignore])
AT_CLEANUP
+# ------------------------------
# Run rpm -qa on an empty rpmdb
AT_SETUP([rpm -qa])
AT_CHECK([
-DBPATH=`rpm --rcfile=${RPMRC} --eval '%_dbpath'`
-rm -rf "${abs_builddir}"/testing"${DBPATH}"/*
-rpm \
- --rcfile=${RPMRC} \
- --root="${abs_builddir}"/testing \
- --initdb
+RPM_INIT_DB
rpm \
--rcfile=${RPMRC} \
--root="${abs_builddir}"/testing \
AT_CLEANUP
+# ------------------------------
# install a package into a local rpmdb without --relocate and --nodeps
# * Must fail due to missing deps
# * Use --ignorearch because we don't know the arch
AT_SETUP([rpm -i *.i386.rpm])
AT_CHECK([
-DBPATH=`rpm --rcfile=${RPMRC} --eval '%_dbpath'`
-rm -rf "${abs_builddir}"/testing"${DBPATH}"/*
-
-rpm \
- --rcfile=${RPMRC} \
- --root="${abs_builddir}"/testing \
- --initdb
+RPM_INIT_DB
],
[0],[ignore],[ignore])
AT_CLEANUP
+# ------------------------------
# install a package into a local rpmdb
# * Shall only work with relocation
# * Use --ignorearch because we don't know the arch
AT_SETUP([rpm -i --relocate=.. *.i386.rpm])
AT_CHECK([
-DBPATH=`rpm --rcfile=${RPMRC} --eval '%_dbpath'`
-rm -rf "${abs_builddir}"/testing"${DBPATH}"/*
-
-rpm \
- --rcfile=${RPMRC} \
- --root="${abs_builddir}"/testing \
- --initdb
+RPM_INIT_DB
],
[0],[ignore],[ignore])
rpm -i \
--rcfile=${RPMRC} \
--root="${abs_builddir}"/testing \
- --nodeps --ignorearch --relocate=/usr="${abs_builddir}"/testing \
+ --nodeps --ignorearch --relocate=/usr="${abs_builddir}"/testing/check \
"${abs_srcdir}"/data/RPMS/hello-1.0-1.i386.rpm
],
[0],
AT_CLEANUP
+# ------------------------------
# install a package into a local rpmdb
# * Shall only work with relocation
# * Use --ignorearch because we don't know the arch
AT_SETUP([rpm -i --relocate=.. *.ppc64.rpm])
AT_CHECK([
-DBPATH=`rpm --rcfile=${RPMRC} --eval '%_dbpath'`
-rm -rf "${abs_builddir}"/testing"${DBPATH}"/*
-
-rpm \
- --rcfile=${RPMRC} \
- --root="${abs_builddir}"/testing \
- --initdb
+RPM_INIT_DB
],
[0],[ignore],[ignore])
rpm -i \
--rcfile=${RPMRC} \
--root="${abs_builddir}"/testing \
- --nodeps --ignorearch --relocate=/usr="${abs_builddir}"/testing \
+ --nodeps --ignorearch --relocate=/usr="${abs_builddir}"/testing/check \
"${abs_srcdir}"/data/RPMS/hello-1.0-1.ppc64.rpm
],
[0],
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+# ------------------------------
AT_SETUP([rpm --version])
AT_CHECK([rpm --version],[0],
[RPM version AT_PACKAGE_VERSION
AT_CLEANUP
+# ------------------------------
AT_SETUP([rpmbuild --version])
AT_CHECK([rpmbuild --version],[0],
[RPM version AT_PACKAGE_VERSION
AT_CLEANUP
+# ------------------------------
AT_SETUP([rpmquery --version])
AT_CHECK([rpmquery --version],[0],
[RPM version AT_PACKAGE_VERSION
AT_CLEANUP
+# ------------------------------
AT_SETUP([rpmi --version])
AT_CHECK([rpmi --version],[0],
[RPM version AT_PACKAGE_VERSION
AT_CLEANUP
+# ------------------------------
AT_SETUP([rpm --showrc])
AT_CHECK([rpm --rcfile=${RPMRC} --showrc],[0],
[ignore])
AT_CLEANUP
+
+# ------------------------------
# Check rpm --querytags
# * Some versions of rpm append extraneous whitespaces
AT_SETUP([rpm --querytags])
[ignore])
AT_CLEANUP
+# ------------------------------
# Check if rpmi -i *.src.rpm works
AT_SETUP([rpmi -i *.src.rpm])
AT_CHECK([
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+# ------------------------------
AT_SETUP([rpmquery --qf -p *.i386.rpm])
AT_CHECK([
rpmquery \
[ignore])
AT_CLEANUP
+# ------------------------------
AT_SETUP([rpmquery --qf -p *.src.rpm])
AT_CHECK([
rpmquery \
[ignore])
AT_CLEANUP
+# ------------------------------
AT_SETUP([rpmquery -ql -p *.src.rpm])
AT_CHECK([
rpmquery \
[ignore])
AT_CLEANUP
+# ------------------------------
AT_SETUP([rpmquery -ql -p *.i386.rpm])
AT_CHECK([
rpmquery \
[ignore])
AT_CLEANUP
+
+# ------------------------------
+# install a package into a local rpmdb
+# * Shall only work with relocation
+# * Use --ignorearch because we don't know the arch
+AT_SETUP([rpm -qil hello])
+AT_CHECK([
+RPM_INIT_DB
+],
+[0],[ignore],[ignore])
+
+AT_CHECK([
+rpm --rcfile=${RPMRC} \
+ --root="${abs_builddir}"/testing \
+ --nodeps --ignorearch --relocate=/usr="${abs_builddir}"/testing/check \
+ -i "${abs_srcdir}"/data/RPMS/hello-1.0-1.ppc64.rpm
+],
+[0],
+[ignore],
+[ignore])
+
+AT_CHECK([
+rpm --rcfile=${RPMRC} \
+ --root="${abs_builddir}"/testing \
+ -q hello
+],
+[0],
+[hello-1.0-1.ppc64
+],
+[ignore])
+
+cat > expout << _ATEOF
+${abs_builddir}/testing/check/local/bin/hello
+${abs_builddir}/testing/check/share/doc/hello-1.0
+${abs_builddir}/testing/check/share/doc/hello-1.0/FAQ
+_ATEOF
+
+AT_CHECK([
+rpm --rcfile=${RPMRC} \
+ --root="${abs_builddir}"/testing \
+ -ql hello
+],
+[0],
+[expout],
+[ignore])
+
+AT_CLEANUP
-AT_INIT
-
-AT_TESTED(rpm rpmbuild rpmquery)
-
m4_include([rpmgeneral.at])
m4_include([rpmquery.at])
m4_include([rpmdb.at])