Use a bit more complicated test for the install/remove file verification
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 17 Apr 2012 05:25:26 +0000 (08:25 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 17 Apr 2012 05:25:26 +0000 (08:25 +0300)
- Previous test only used a single file and no package-specific
  directories, now we have multiple files and multiple directories,
  some owned by the package and some not.
- This test fails right now due to previously unnoticed regression
  in commit 1845c1d711b88723e596c88e8a7730a360029089

tests/rpmdb.at

index 461bd9c..3d1ff07 100644 (file)
@@ -218,41 +218,36 @@ AT_CHECK([
 RPMDB_CLEAR
 RPMDB_INIT
 rm -rf "${TOPDIR}"
-rm -f "${RPMTEST}"/usr/share/my.version
+rm -rf "${RPMTEST}"/opt/mydir
 
-runroot rpmbuild --quiet -bb \
-        --define "pkg status" \
-       --define "filedata same_stuff" \
-          /data/SPECS/conflicttest.spec
-
-runroot rpm -U "${TOPDIR}"/RPMS/noarch/conflictstatus-1.0-1.noarch.rpm
-test -f "${RPMTEST}"/usr/share/my.version
+runroot rpmbuild --quiet -bb /data/SPECS/selfconflict.spec
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/selfconflict-1.0-1.noarch.rpm
+find "${RPMTEST}"/opt | wc -l
 ],
 [0],
-[],
+[6
+],
 [])
 AT_CLEANUP
 
 # ------------------------------
-# Install, erase and verify files removed from disk
+# Install, erase and oerify files removed from disk
+# Note /opt is not owned by the pkg so it gets left behind
 AT_SETUP([rpm -e and verify files removed])
 AT_KEYWORDS([install rpmdb])
 AT_CHECK([
 RPMDB_CLEAR
 RPMDB_INIT
 rm -rf "${TOPDIR}"
-rm -f "${RPMTEST}"/usr/share/my.version
-
-runroot rpmbuild --quiet -bb \
-        --define "pkg status" \
-       --define "filedata same_stuff" \
-          /data/SPECS/conflicttest.spec
+rm -rf "${RPMTEST}"/opt/mydir
 
-runroot rpm -U "${TOPDIR}"/RPMS/noarch/conflictstatus-1.0-1.noarch.rpm
-runroot rpm -e conflictstatus
-test -f "${RPMTEST}"/usr/share/my.version
+runroot rpmbuild --quiet -bb /data/SPECS/selfconflict.spec
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/selfconflict-1.0-1.noarch.rpm
+runroot rpm -e selfconflict
+find "${RPMTEST}"/opt | wc -l
+],
+[0],
+[1
 ],
-[1],
-[],
 [])
 AT_CLEANUP