diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2013-01-30 13:52:23 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2013-01-30 14:33:05 +0200 |
commit | dd4c04b82e8a140895a4c3162c4f8df1f887c7a0 (patch) | |
tree | cab0a57435ba684ac5c076720ba90b93d5a2b2bb /tests | |
parent | 3de09d5e5092ddb9682b1fc2b01bcbab8ac5eeca (diff) | |
download | rpm-dd4c04b82e8a140895a4c3162c4f8df1f887c7a0.tar.gz rpm-dd4c04b82e8a140895a4c3162c4f8df1f887c7a0.tar.bz2 rpm-dd4c04b82e8a140895a4c3162c4f8df1f887c7a0.zip |
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)
(cherry picked from commit 0485eab2c96173d1e34e4edb3570e58a693e255e)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/data/SPECS/conflicttest.spec | 2 | ||||
-rw-r--r-- | tests/rpmconflict.at | 38 |
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 + |