summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/data/SPECS/conflicttest.spec2
-rw-r--r--tests/rpmconflict.at38
2 files changed, 39 insertions, 1 deletions
diff --git a/tests/data/SPECS/conflicttest.spec b/tests/data/SPECS/conflicttest.spec
index 894b63210..bd1dd1c5f 100644
--- a/tests/data/SPECS/conflicttest.spec
+++ b/tests/data/SPECS/conflicttest.spec
@@ -20,4 +20,4 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
-%{_datadir}/my.version
+%{?fileattr} %{_datadir}/my.version
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
+