Cosmetics.
authorRalf Corsépius <corsepiu@fedoraproject.org>
Tue, 21 Aug 2007 12:52:00 +0000 (14:52 +0200)
committerRalf Corsépius <corsepiu@fedoraproject.org>
Tue, 21 Aug 2007 12:52:00 +0000 (14:52 +0200)
tests/rpmdb.at
tests/rpmgeneral.at
tests/rpmi.at
tests/rpmquery.at
tests/rpmtests.at

index 8ca9b29..e0dea0b 100644 (file)
 #    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 \
@@ -51,18 +44,13 @@ rpm \
 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])
 
@@ -85,18 +73,13 @@ rpm -i \
 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])
 
@@ -104,7 +87,7 @@ AT_CHECK([
 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],
@@ -114,18 +97,13 @@ rpm -i \
 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])
 
@@ -133,7 +111,7 @@ AT_CHECK([
 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],
index 037adf6..7a0b924 100644 (file)
@@ -16,6 +16,7 @@
 #    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
@@ -23,6 +24,7 @@ AT_CHECK([rpm --version],[0],
 AT_CLEANUP
 
 
+# ------------------------------
 AT_SETUP([rpmbuild --version])
 AT_CHECK([rpmbuild --version],[0],
 [RPM version AT_PACKAGE_VERSION
@@ -30,6 +32,7 @@ AT_CHECK([rpmbuild --version],[0],
 AT_CLEANUP
 
 
+# ------------------------------
 AT_SETUP([rpmquery --version])
 AT_CHECK([rpmquery --version],[0],
 [RPM version AT_PACKAGE_VERSION
@@ -37,6 +40,7 @@ AT_CHECK([rpmquery --version],[0],
 AT_CLEANUP
 
 
+# ------------------------------
 AT_SETUP([rpmi --version])
 AT_CHECK([rpmi --version],[0],
 [RPM version AT_PACKAGE_VERSION
@@ -44,11 +48,14 @@ AT_CHECK([rpmi --version],[0],
 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])
index ac0ba50..d55d83f 100644 (file)
@@ -35,6 +35,7 @@ rpmi \
 [ignore])
 AT_CLEANUP
 
+# ------------------------------
 # Check if rpmi -i *.src.rpm works
 AT_SETUP([rpmi -i *.src.rpm])
 AT_CHECK([
index f00d523..c4ecd8c 100644 (file)
@@ -16,6 +16,7 @@
 #    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 \
@@ -29,6 +30,7 @@ rpmquery \
 [ignore])
 AT_CLEANUP
 
+# ------------------------------
 AT_SETUP([rpmquery --qf -p *.src.rpm])
 AT_CHECK([
 rpmquery \
@@ -42,6 +44,7 @@ rpmquery \
 [ignore])
 AT_CLEANUP
 
+# ------------------------------
 AT_SETUP([rpmquery -ql -p *.src.rpm])
 AT_CHECK([
 rpmquery \
@@ -56,6 +59,7 @@ hello.spec
 [ignore])
 AT_CLEANUP
 
+# ------------------------------
 AT_SETUP([rpmquery -ql -p *.i386.rpm])
 AT_CHECK([
 rpmquery \
@@ -71,3 +75,50 @@ 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
index 74dceb9..43a57f9 100644 (file)
@@ -1,7 +1,3 @@
-AT_INIT
-
-AT_TESTED(rpm rpmbuild rpmquery)
-
 m4_include([rpmgeneral.at])
 m4_include([rpmquery.at])
 m4_include([rpmdb.at])