Add a test-case for the shared file timestamp behavior
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 17 Aug 2012 11:14:46 +0000 (14:14 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 17 Aug 2012 11:15:04 +0000 (14:15 +0300)
- Prior to commit f7f5f88f9f3d6587e747b034ccb64a3f00ff4e1e, this
  would've failed: removing the last package to be installed would
  cause timestamp failure on all others. The order is arbitrary in
  this testcase but it matters in real-world situations such as
  secondary arch packages.

tests/rpmverify.at

index f863121..473ac49 100644 (file)
@@ -142,3 +142,32 @@ runroot rpm -V --nodeps verifyscript
 [],
 [])
 AT_CLEANUP
+
+# ------------------------------
+# shared file timestamp behavior
+AT_SETUP([shared file timestamp behavior])
+AT_KEYWORDS([verify])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+rm -rf "${TOPDIR}"
+
+# create packages sharing a file but with different timestamp
+for p in "one" "two"; do
+    runroot rpmbuild --quiet -bb \
+        --define "pkg $p" \
+       --define "filedata same_stuff" \
+          /data/SPECS/conflicttest.spec
+    sleep 1
+done
+
+# first instance of a shared file is the one that actually gets created,
+# force the order so we know what to expect as these dont depend on each other
+runroot rpm -U --noorder "${TOPDIR}"/RPMS/noarch/conflictone-1.0-1.noarch.rpm "${TOPDIR}"/RPMS/noarch/conflicttwo-1.0-1.noarch.rpm
+runroot rpm -e conflicttwo
+runroot rpm -Va --nouser --nogroup
+],
+[0],
+[],
+[])
+AT_CLEANUP