diff options
Diffstat (limited to 'tests/rpmdb.at')
-rw-r--r-- | tests/rpmdb.at | 92 |
1 files changed, 87 insertions, 5 deletions
diff --git a/tests/rpmdb.at b/tests/rpmdb.at index 5b10ac67a..e1893c7cd 100644 --- a/tests/rpmdb.at +++ b/tests/rpmdb.at @@ -103,7 +103,7 @@ AT_CLEANUP # ------------------------------ # reinstall a noarch package (with no files) -AT_SETUP([rpm -U --replacepkgs]) +AT_SETUP([rpm -U --replacepkgs 1]) AT_KEYWORDS([rpmdb install]) AT_CHECK([ @@ -124,6 +124,49 @@ runroot rpm -i "${tpkg}" && AT_CLEANUP # ------------------------------ +# reinstall a package with different file policies +AT_SETUP([rpm -U --replacepkgs 2]) +AT_KEYWORDS([rpmdb install]) + +AT_CHECK([ +AT_XFAIL_IF([test $RPM_XFAIL -ne 0]) +RPMDB_CLEAR +RPMDB_INIT + +tpkg="/data/RPMS/hello-2.0-1.i686.rpm" + +runroot rpm -U --nodeps --ignorearch "${tpkg}" && + runroot rpm -U --nodeps --ignorearch --nodocs --replacepkgs "${tpkg}" && + runroot rpm -e hello +test -d "${RPMTEST}"/usr/share/doc/hello-2.0 +], +[1], +[], +[]) +AT_CLEANUP + +# ------------------------------ +# reinstall a package with different file policies +AT_SETUP([rpm --reinstall 1]) +AT_KEYWORDS([rpmdb install]) + +AT_CHECK([ +RPMDB_CLEAR +RPMDB_INIT + +tpkg="/data/RPMS/hello-2.0-1.i686.rpm" + +runroot rpm -U --nodeps --ignorearch "${tpkg}" && + runroot rpm --reinstall --nodeps --ignorearch --nodocs "${tpkg}" && + runroot rpm -e hello +test -d "${RPMTEST}"/usr/share/doc/hello-2.0 +], +[1], +[], +[]) +AT_CLEANUP + +# ------------------------------ # install a package into a local rpmdb # * Shall only work with relocation # * Use --ignorearch because we don't know the arch @@ -162,6 +205,44 @@ runroot rpm -i \ AT_CLEANUP +AT_SETUP([rpmdb --rebuilddb]) +AT_KEYWORDS([rpmdb]) +AT_CHECK([ +RPMDB_CLEAR +RPMDB_INIT + +runroot rpm -U --noscripts --nodeps --ignorearch \ + /data/RPMS/hello-1.0-1.i386.rpm +runroot rpm -qa --qf "%{nevra} %{dbinstance}\n" +runroot rpm -U --noscripts --nodeps --ignorearch \ + /data/RPMS/hello-2.0-1.i686.rpm +runroot rpm -qa --qf "%{nevra} %{dbinstance}\n" +runroot rpmdb --rebuilddb +runroot rpm -qa --qf "%{nevra} %{dbinstance}\n" +], +[], +[hello-1.0-1.i386 1 +hello-2.0-1.i686 2 +hello-2.0-1.i686 1 +], +[]) +AT_CLEANUP + +# ------------------------------ +# Attempt to initialize, rebuild and verify a db +AT_SETUP([rpmdb --rebuilddb and verify empty database]) +AT_KEYWORDS([rpmdb]) +AT_CHECK([ +RPMDB_CLEAR +RPMDB_INIT +runroot rpmdb --rebuilddb +runroot rpmdb --verifydb +], +[0], +[], +[]) +AT_CLEANUP + # ------------------------------ # Install and verify status AT_SETUP([rpm -U and verify status]) @@ -176,7 +257,7 @@ runroot rpmbuild --quiet -bb \ --define "filedata same_stuff" \ /data/SPECS/conflicttest.spec -runroot rpm -U "${TOPDIR}"/RPMS/noarch/conflictstatus-1.0-1.noarch.rpm +runroot rpm -U /build/RPMS/noarch/conflictstatus-1.0-1.noarch.rpm runroot rpm -qls conflictstatus ], [0], @@ -197,11 +278,12 @@ rm -rf "${TOPDIR}" runroot rpmbuild --quiet -bb \ /data/SPECS/flangtest.spec -runroot rpm -U --define "_install_langs de:fi" "${TOPDIR}"/RPMS/noarch/flangtest-1.0-1.noarch.rpm +runroot rpm -U --define "_install_langs de:fi" /build/RPMS/noarch/flangtest-1.0-1.noarch.rpm runroot rpm -qls flangtest ], [0], [normal /usr/share/flangtest/de.txt +normal /usr/share/flangtest/empty.txt not installed /usr/share/flangtest/en.txt normal /usr/share/flangtest/fi.txt normal /usr/share/flangtest/none.txt @@ -221,7 +303,7 @@ rm -rf "${TOPDIR}" rm -rf "${RPMTEST}"/opt/* runroot rpmbuild --quiet -bb /data/SPECS/selfconflict.spec -runroot rpm -U "${TOPDIR}"/RPMS/noarch/selfconflict-1.0-1.noarch.rpm +runroot rpm -U /build/RPMS/noarch/selfconflict-1.0-1.noarch.rpm find "${RPMTEST}"/opt | wc -l ], [0], @@ -242,7 +324,7 @@ rm -rf "${TOPDIR}" rm -rf "${RPMTEST}"/opt/* runroot rpmbuild --quiet -bb /data/SPECS/selfconflict.spec -runroot rpm -U "${TOPDIR}"/RPMS/noarch/selfconflict-1.0-1.noarch.rpm +runroot rpm -U /build/RPMS/noarch/selfconflict-1.0-1.noarch.rpm runroot rpm -e selfconflict find "${RPMTEST}"/opt | wc -l ], |