summaryrefslogtreecommitdiff
path: root/tests/rpmdb.at
diff options
context:
space:
mode:
authorRalf Corsépius <corsepiu@fedoraproject.org>2007-08-21 10:37:27 +0200
committerRalf Corsépius <corsepiu@fedoraproject.org>2007-08-21 10:37:27 +0200
commite290647874294d40e0e539a9b3d589f13f41165a (patch)
tree4a6afef9a9546b63a3cd92e951948d7647ac5caf /tests/rpmdb.at
parented488d4181cf9db03c99dfd94524f3c8faa45391 (diff)
downloadlibrpm-tizen-e290647874294d40e0e539a9b3d589f13f41165a.tar.gz
librpm-tizen-e290647874294d40e0e539a9b3d589f13f41165a.tar.bz2
librpm-tizen-e290647874294d40e0e539a9b3d589f13f41165a.zip
Extensively extend.
Diffstat (limited to 'tests/rpmdb.at')
-rw-r--r--tests/rpmdb.at75
1 files changed, 69 insertions, 6 deletions
diff --git a/tests/rpmdb.at b/tests/rpmdb.at
index ea74eae6e..a574f6a09 100644
--- a/tests/rpmdb.at
+++ b/tests/rpmdb.at
@@ -16,17 +16,80 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# Attempt to initialize a rpmdb
AT_SETUP([rpm --initdb])
AT_CHECK([
-rpm --initdb -r "${abs_builddir}"/testing
-status=$?
-AS_IF([test $status -ne 0],[
- AS_IF([test `id -u` -ne 0],
- [exit 77])
+DBPATH=`rpm --rcfile=${RPMRC} --eval '%_dbpath'`
+rm -rf "${abs_builddir}"/testing"${DBPATH}"/*
+rpm \
+ --rcfile=${RPMRC} \
+ --root="${abs_builddir}"/testing \
+ --initdb],
+[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 \
+ --rcfile=${RPMRC} \
+ --root="${abs_builddir}"/testing \
+ -qa
+],
+[0],
+[ignore],
+[ignore])
+AT_CLEANUP
+
+
+
+# install a package into a local rpmdb
+# * Shall only work with relocation
+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
+],
+[0],[ignore],[ignore])
+
+AT_CHECK([
+rpm -i \
+ --rcfile=${RPMRC} \
+ --root="${abs_builddir}"/testing \
+ "${abs_srcdir}"/data/RPMS/hello-1.0-1.i386.rpm
+],
+[1],
+[ignore],
+[error: Failed dependencies:
+ /bin/sh is needed by hello-1.0-1.i386
+ libc.so.6 is needed by hello-1.0-1.i386
+ libc.so.6(GLIBC_2.0) is needed by hello-1.0-1.i386
+ rtld(GNU_HASH) is needed by hello-1.0-1.i386
])
-exit $status;
+
+AT_CHECK([
+rpm -i \
+ --rcfile=${RPMRC} \
+ --root="${abs_builddir}"/testing \
+ --nodeps --relocate=/usr="${abs_builddir}"/testing \
+ "${abs_srcdir}"/data/RPMS/hello-1.0-1.i386.rpm
],
[0],
[ignore],
[ignore])
+
AT_CLEANUP