summaryrefslogtreecommitdiff
path: root/tests/rpmconflict.at
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2013-01-30 13:52:23 +0200
committerPanu Matilainen <pmatilai@redhat.com>2013-01-30 14:01:07 +0200
commit0485eab2c96173d1e34e4edb3570e58a693e255e (patch)
tree2fa2d8404b54c303d3521e5a7d7851ca4c3d973d /tests/rpmconflict.at
parent5121ea2151f13e58740b7b4e7dc20cff5f2475fb (diff)
downloadrpm-0485eab2c96173d1e34e4edb3570e58a693e255e.tar.gz
Add testcase for %ghost shared with a real file
- Further parametrize conflicttest.spec to allow for different attributes - Verify that the real file gets created without conflicts, that it doesn't get removed when ghost is removed and gets normally removed on erase. - This is the case commit a712252392eca75443ca45c10a72873cabec7963 was supposed to fix (which it does but with, ahem, "slight" side-effects)
Diffstat (limited to 'tests/rpmconflict.at')
-rw-r--r--tests/rpmconflict.at38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/rpmconflict.at b/tests/rpmconflict.at
index 385fed184..90d077d61 100644
--- a/tests/rpmconflict.at
+++ b/tests/rpmconflict.at
@@ -393,3 +393,41 @@ runroot rpm -U "${TOPDIR}"/RPMS/noarch/symlinktest-1.0-2.noarch.rpm
[ file /usr/share/symlinktest from install of symlinktest-1.0-2.noarch conflicts with file from package symlinktest-1.0-1.noarch
])
AT_CLEANUP
+
+# ------------------------------
+# Regular file shared with a ghost, does not conflict
+# Regular file should be created and not removed when the ghost is removed
+AT_SETUP([real file with shared ghost])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+fn="${RPMTEST}"/usr/share/my.version
+rm -rf "${TOPDIR}" "${fn}"
+
+runroot rpmbuild --quiet -bb \
+ --define "pkg one" --define "filedata one" \
+ /data/SPECS/conflicttest.spec
+runroot rpmbuild --quiet -bb \
+ --define "pkg two" --define "filedata two" --define "fileattr %ghost"\
+ /data/SPECS/conflicttest.spec
+
+test ! -f "${fn}" && echo OK
+runroot rpm -U \
+ "${TOPDIR}"/RPMS/noarch/conflictone-1.0-1.noarch.rpm \
+ "${TOPDIR}"/RPMS/noarch/conflicttwo-1.0-1.noarch.rpm
+cat "${fn}"
+runroot rpm -e conflicttwo
+cat "${fn}"
+runroot rpm -e conflictone
+test ! -f "${fn}" && echo OK
+],
+[],
+[OK
+one
+one
+OK
+],
+[])
+AT_CLEANUP
+