diff options
author | Ralf Corsépius <corsepiu@fedoraproject.org> | 2007-08-30 15:33:15 +0200 |
---|---|---|
committer | Ralf Corsépius <corsepiu@fedoraproject.org> | 2007-08-30 15:33:15 +0200 |
commit | 333fc3b70efdabd2d6928375ec0ce67ef29797fa (patch) | |
tree | 74be399f36fedf5190db6968bd8b46f12697121c /tests | |
parent | 1e27f6ec10605daf5fae46a159959706a3827ec4 (diff) | |
download | librpm-tizen-333fc3b70efdabd2d6928375ec0ce67ef29797fa.tar.gz librpm-tizen-333fc3b70efdabd2d6928375ec0ce67ef29797fa.tar.bz2 librpm-tizen-333fc3b70efdabd2d6928375ec0ce67ef29797fa.zip |
Massive hacking on tests.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/local.at | 13 | ||||
-rw-r--r-- | tests/rpmbuild.at | 12 | ||||
-rw-r--r-- | tests/rpmdb.at | 60 | ||||
-rw-r--r-- | tests/rpmgeneral.at | 3 | ||||
-rw-r--r-- | tests/rpmi.at | 4 | ||||
-rw-r--r-- | tests/rpmquery.at | 28 |
6 files changed, 55 insertions, 65 deletions
diff --git a/tests/local.at b/tests/local.at index 0ee66b822..24d73200f 100644 --- a/tests/local.at +++ b/tests/local.at @@ -1,12 +1,15 @@ AT_TESTED([rpm rpmbuild rpmquery]) -m4_define([RPM_INIT_DB],[ -DBPATH=`rpm --rcfile=${RPMRC} --eval '%_dbpath'` -rm -rf "${abs_builddir}"/testing"${DBPATH}"/* +m4_define([RPMDB_INIT],[[ rpm \ - --rcfile=${RPMRC} \ + --rcfile="${RPMRC}" \ --root="${abs_builddir}"/testing \ --initdb -]) +]]) + +m4_define([RPMDB_CLEAR],[[ +rm -rf "${abs_builddir}"/testing`rpm --rcfile="${RPMRC}" --eval '%_dbpath'`/* +]]) + AT_INIT diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at index 62f9776e4..61806d27d 100644 --- a/tests/rpmbuild.at +++ b/tests/rpmbuild.at @@ -19,6 +19,7 @@ # ------------------------------ # Check if rpmbuild -ba *.spec works AT_SETUP([rpmbuild -ba *.spec]) +AT_XFAIL_IF([test $RPM_XFAIL -gt 0]) AT_CHECK([ TOPDIR="${abs_builddir}"/testing/build @@ -32,7 +33,7 @@ AS_MKDIR_P(${TOPDIR}/SRPMS) cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz ${TOPDIR}/SOURCES rpmbuild \ - --rcfile=${RPMRC} \ + --rcfile="${RPMRC}" \ --define "_topdir ${TOPDIR}" \ -ba "${abs_srcdir}"/data/SPECS/hello.spec ], @@ -45,6 +46,7 @@ AT_CLEANUP # Check if rpmbuild -ba *.spec # honours a relative topdir with --root AT_SETUP([rpmbuild --root=... -ba *.spec]) +AT_XFAIL_IF([test $RPM_XFAIL -gt 0]) AT_CHECK([ TOPDIR="${abs_builddir}"/testing/build @@ -58,7 +60,7 @@ AS_MKDIR_P(${TOPDIR}/SRPMS) cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz ${TOPDIR}/SOURCES rpmbuild \ - --rcfile=${RPMRC} \ + --rcfile="${RPMRC}" \ --define "_topdir build" \ --root="${abs_builddir}"/testing \ -ba "${abs_srcdir}"/data/SPECS/hello.spec @@ -71,6 +73,7 @@ AT_CLEANUP # ------------------------------ # Check if rpmbuild --rebuild *.src.rpm works AT_SETUP([rpmbuild --rebuild]) +AT_XFAIL_IF([test $RPM_XFAIL -gt 0]) AT_CHECK([ TOPDIR="${abs_builddir}"/testing/build @@ -82,7 +85,7 @@ AS_MKDIR_P(${TOPDIR}/RPMS) AS_MKDIR_P(${TOPDIR}/SRPMS) rpmbuild \ - --rcfile=${RPMRC} \ + --rcfile="${RPMRC}" \ --define "_topdir ${TOPDIR}" \ --rebuild "${abs_srcdir}"/data/SRPMS/hello-1.0-1.src.rpm ], @@ -95,6 +98,7 @@ AT_CLEANUP # Check if rpmbuild --rebuild *.src.rpm # honours a relative topdir with --root AT_SETUP([rpmbuild --root=... --rebuild]) +AT_XFAIL_IF([test $RPM_XFAIL -gt 0]) AT_CHECK([ TOPDIR="${abs_builddir}"/testing/build @@ -106,7 +110,7 @@ AS_MKDIR_P(${TOPDIR}/RPMS) AS_MKDIR_P(${TOPDIR}/SRPMS) rpmbuild \ - --rcfile=${RPMRC} \ + --rcfile="${RPMRC}" \ --define "_topdir build" \ --root="${abs_builddir}"/testing \ --rebuild "${abs_srcdir}"/data/SRPMS/hello-1.0-1.src.rpm diff --git a/tests/rpmdb.at b/tests/rpmdb.at index e0dea0b94..d75ca61d3 100644 --- a/tests/rpmdb.at +++ b/tests/rpmdb.at @@ -21,7 +21,8 @@ # Attempt to initialize a rpmdb AT_SETUP([rpm --initdb]) AT_CHECK([ -RPM_INIT_DB +RPMDB_CLEAR +RPMDB_INIT ], [0], [ignore], @@ -32,43 +33,32 @@ AT_CLEANUP # Run rpm -qa on an empty rpmdb AT_SETUP([rpm -qa]) AT_CHECK([ -RPM_INIT_DB +RPMDB_CLEAR +RPMDB_INIT rpm \ - --rcfile=${RPMRC} \ + --rcfile="${RPMRC}" \ --root="${abs_builddir}"/testing \ -qa ], -[0], -[ignore], -[ignore]) +[0]) 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([ -RPM_INIT_DB -], -[0],[ignore],[ignore]) +# install a noarch package into a local rpmdb without --relocate and --nodeps +# * Should always succeed +AT_SETUP([rpm -i *.noarch.rpm]) AT_CHECK([ +RPMDB_CLEAR +RPMDB_INIT + rpm -i \ - --rcfile=${RPMRC} \ + --rcfile="${RPMRC}" \ --root="${abs_builddir}"/testing \ - --ignorearch \ - "${abs_srcdir}"/data/RPMS/hello-1.0-1.i386.rpm + "${abs_srcdir}"/data/RPMS/foo-1.0-1.noarch.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 -]) +[0]) AT_CLEANUP @@ -79,20 +69,16 @@ AT_CLEANUP # * Use --ignorearch because we don't know the arch AT_SETUP([rpm -i --relocate=.. *.i386.rpm]) AT_CHECK([ -RPM_INIT_DB -], -[0],[ignore],[ignore]) +RPMDB_CLEAR +RPMDB_INIT -AT_CHECK([ rpm -i \ - --rcfile=${RPMRC} \ + --rcfile="${RPMRC}" \ --root="${abs_builddir}"/testing \ --nodeps --ignorearch --relocate=/usr="${abs_builddir}"/testing/check \ "${abs_srcdir}"/data/RPMS/hello-1.0-1.i386.rpm ], -[0], -[ignore], -[ignore]) +[0]) AT_CLEANUP @@ -103,13 +89,11 @@ AT_CLEANUP # * Use --ignorearch because we don't know the arch AT_SETUP([rpm -i --relocate=.. *.ppc64.rpm]) AT_CHECK([ -RPM_INIT_DB -], -[0],[ignore],[ignore]) +RPMDB_CLEAR +RPMDB_INIT -AT_CHECK([ rpm -i \ - --rcfile=${RPMRC} \ + --rcfile="${RPMRC}" \ --root="${abs_builddir}"/testing \ --nodeps --ignorearch --relocate=/usr="${abs_builddir}"/testing/check \ "${abs_srcdir}"/data/RPMS/hello-1.0-1.ppc64.rpm diff --git a/tests/rpmgeneral.at b/tests/rpmgeneral.at index 7a0b924dd..ca2c287ad 100644 --- a/tests/rpmgeneral.at +++ b/tests/rpmgeneral.at @@ -50,7 +50,7 @@ AT_CLEANUP # ------------------------------ AT_SETUP([rpm --showrc]) -AT_CHECK([rpm --rcfile=${RPMRC} --showrc],[0], +AT_CHECK([rpm --rcfile="${RPMRC}" --showrc],[0], [ignore]) AT_CLEANUP @@ -59,6 +59,7 @@ AT_CLEANUP # Check rpm --querytags # * Some versions of rpm append extraneous whitespaces AT_SETUP([rpm --querytags]) +AT_XFAIL_IF([test $RPM_XFAIL -gt 0]) AT_CHECK([rpm --querytags],[0], [ARCH ARCHIVESIZE diff --git a/tests/rpmi.at b/tests/rpmi.at index d55d83fa3..94a1a5a1f 100644 --- a/tests/rpmi.at +++ b/tests/rpmi.at @@ -26,7 +26,7 @@ rm -rf ${TOPDIR} AS_MKDIR_P([${TOPDIR}]) rpmi \ - --rcfile=${RPMRC} \ + --rcfile="${RPMRC}" \ --define "_topdir ${TOPDIR}" \ -U "${abs_srcdir}"/data/SRPMS/hello-1.0-1.src.rpm ], @@ -45,7 +45,7 @@ rm -rf ${TOPDIR} AS_MKDIR_P([${TOPDIR}]) rpmi \ - --rcfile=${RPMRC} \ + --rcfile="${RPMRC}" \ --define "_topdir ${TOPDIR}" \ -i "${abs_srcdir}"/data/SRPMS/hello-1.0-1.src.rpm ], diff --git a/tests/rpmquery.at b/tests/rpmquery.at index 85c5b5dc3..6e182b905 100644 --- a/tests/rpmquery.at +++ b/tests/rpmquery.at @@ -20,7 +20,7 @@ AT_SETUP([rpmquery --qf -p *.i386.rpm]) AT_CHECK([ rpmquery \ - --rcfile=${RPMRC} \ + --rcfile="${RPMRC}" \ --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n" \ -p "${abs_srcdir}"/data/RPMS/hello-1.0-1.i386.rpm ], @@ -34,7 +34,7 @@ AT_CLEANUP AT_SETUP([rpmquery --qf -p *.src.rpm]) AT_CHECK([ rpmquery \ - --rcfile=${RPMRC} \ + --rcfile="${RPMRC}" \ --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n" \ -p "${abs_srcdir}"/data/SRPMS/hello-1.0-1.src.rpm ], @@ -48,7 +48,7 @@ AT_CLEANUP AT_SETUP([rpmquery -ql -p *.src.rpm]) AT_CHECK([ rpmquery \ - --rcfile=${RPMRC} \ + --rcfile="${RPMRC}" \ -ql \ -p "${abs_srcdir}"/data/SRPMS/hello-1.0-1.src.rpm ], @@ -63,7 +63,7 @@ AT_CLEANUP AT_SETUP([rpmquery -ql -p *.i386.rpm]) AT_CHECK([ rpmquery \ - --rcfile=${RPMRC} \ + --rcfile="${RPMRC}" \ -ql \ -p "${abs_srcdir}"/data/RPMS/hello-1.0-1.i386.rpm ], @@ -80,9 +80,10 @@ AT_CLEANUP # Try to check "scripts" # * Gets rpmpopt-$(VERSION) involved AT_SETUP([rpm -q --scripts -p *.i386.rpm]) +AT_XFAIL_IF([test $RPM_XFAIL -gt 0]) AT_CHECK([ rpm \ - --rcfile=${RPMRC} \ + --rcfile="${RPMRC}" \ -q --scripts \ -p "${abs_srcdir}"/data/RPMS/hello-1.0-1.i386.rpm ], @@ -101,23 +102,20 @@ AT_CLEANUP # * 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} \ +RPMDB_CLEAR +RPMDB_INIT + +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]) +[0]) AT_CHECK([ -rpm --rcfile=${RPMRC} \ +rpm --rcfile="${RPMRC}" \ --root="${abs_builddir}"/testing \ -q hello ], @@ -133,7 +131,7 @@ ${abs_builddir}/testing/check/share/doc/hello-1.0/FAQ _ATEOF AT_CHECK([ -rpm --rcfile=${RPMRC} \ +rpm --rcfile="${RPMRC}" \ --root="${abs_builddir}"/testing \ -ql hello ], |