summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-08-24 12:51:26 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-08-24 12:51:26 +0300
commit0bbcbb050d3a1d93eafa5ee353d4b89a9946b68f (patch)
tree5bcaf6527bb691857001988bc95aab8f39549e76 /tests
parentfb0d4f643a21b7d1fcb23ee705e309c394927055 (diff)
downloadlibrpm-tizen-0bbcbb050d3a1d93eafa5ee353d4b89a9946b68f.tar.gz
librpm-tizen-0bbcbb050d3a1d93eafa5ee353d4b89a9946b68f.tar.bz2
librpm-tizen-0bbcbb050d3a1d93eafa5ee353d4b89a9946b68f.zip
Add pile of new test-cases for file type changes in upgrades
- Of particular interest is directory changing to something else (including the infamous symlink case), which we miserably fail currently. Until we can somehow manage them someday, we should abort early (by conflicts) instead of barfing up garbage in middle of transaction.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/data/SPECS/replacetest.spec47
-rw-r--r--tests/rpmconflict.at9
-rw-r--r--tests/rpmreplace.at575
-rw-r--r--tests/rpmtests.at1
5 files changed, 628 insertions, 5 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d8fe0f376..f817d08dc 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -26,6 +26,7 @@ TESTSUITE_AT += rpmconflict.at
TESTSUITE_AT += rpmconfig.at
TESTSUITE_AT += rpmconfig2.at
TESTSUITE_AT += rpmconfig3.at
+TESTSUITE_AT += rpmreplace.at
TESTSUITE_AT += rpmmacro.at
TESTSUITE_AT += rpmpython.at
TESTSUITE_AT += rpmdepmatch.at
diff --git a/tests/data/SPECS/replacetest.spec b/tests/data/SPECS/replacetest.spec
new file mode 100644
index 000000000..e8a64e803
--- /dev/null
+++ b/tests/data/SPECS/replacetest.spec
@@ -0,0 +1,47 @@
+%{!?filetype: %global filetype file}
+%{?fixit: %global havepretrans 1}
+
+Name: replacetest%{?sub:-%{sub}}
+Version: %{ver}
+Release: 1
+Summary: Testing file replacement behavior
+
+Group: Testing
+License: GPL
+BuildArch: noarch
+
+%description
+%{summary}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT/opt
+case %{filetype} in
+file)
+ echo "%{filedata}" > $RPM_BUILD_ROOT/opt/foo
+ ;;
+link)
+ ln -s "%{filedata}" $RPM_BUILD_ROOT/opt/foo
+ ;;
+dir)
+ mkdir -p $RPM_BUILD_ROOT/opt/foo
+ ;;
+datadir)
+ mkdir -p $RPM_BUILD_ROOT/opt/foo
+ echo WOOT > $RPM_BUILD_ROOT/opt/foo/%{filedata}
+ ;;
+esac
+mkdir -p $RPM_BUILD_ROOT/opt/zoo
+echo FOO > $RPM_BUILD_ROOT/opt/goo
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if 0%{?havepretrans}
+%pretrans -p <lua>
+%{fixit}
+%endif
+
+%files
+%defattr(-,root,root,-)
+/opt/*
diff --git a/tests/rpmconflict.at b/tests/rpmconflict.at
index 13ad17423..220af631d 100644
--- a/tests/rpmconflict.at
+++ b/tests/rpmconflict.at
@@ -235,9 +235,10 @@ runroot rpm -U --ignoreos --ignorearch --nodeps \
AT_CLEANUP
# ------------------------------
-# Replace directory with symlink, this is expected to fail
+# Removal conflict on directory -> symlink change
AT_SETUP([rpm -U replacing directory with symlink])
AT_KEYWORDS([install])
+AT_XFAIL_IF([test $RPM_XFAIL -ne 2])
AT_CHECK([
RPMDB_CLEAR
RPMDB_INIT
@@ -252,11 +253,9 @@ runroot rpmbuild --quiet -bb \
runroot rpm -U "${TOPDIR}"/RPMS/noarch/symlinktest-1.0-1.noarch.rpm
runroot rpm -U "${TOPDIR}"/RPMS/noarch/symlinktest-1.0-2.noarch.rpm
],
-[1],
+[2],
[],
-[error: unpacking of archive failed on file /usr/share/symlinktest: cpio: rename failed - Is a directory
-error: symlinktest-1.0-2.noarch: install failed
-error: symlinktest-1.0-1.noarch: erase skipped
+[ file /usr/share/symlinktest from install of symlinktest-1.0-2.noarch conflicts with file from package symlinktest-1.0-1.noarch
])
AT_CLEANUP
diff --git a/tests/rpmreplace.at b/tests/rpmreplace.at
new file mode 100644
index 000000000..eebf90ead
--- /dev/null
+++ b/tests/rpmreplace.at
@@ -0,0 +1,575 @@
+
+AT_BANNER([RPM file replacement])
+
+AT_SETUP([upgrade to/from regular file])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+tf="${RPMTEST}"/opt/foo
+rm -rf "${tf}" "${tf}".rpm*
+rm -rf "${TOPDIR}"
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 1.0" \
+ --define "filetype file" \
+ --define "filedata foo" \
+ /data/SPECS/replacetest.spec
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 2.0" \
+ --define "filetype file" \
+ --define "filedata bar" \
+ /data/SPECS/replacetest.spec
+
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+cat "${tf}"
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm
+cat "${tf}"
+runroot rpm -U --oldpackage "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+cat "${tf}"
+],
+[0],
+[foo
+bar
+foo
+],
+[])
+AT_CLEANUP
+
+AT_SETUP([upgrade regular file to/from broken link])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+tf="${RPMTEST}"/opt/foo
+rm -rf "${RPMTEST}"/opt/*
+rm -rf "${TOPDIR}"
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 1.0" \
+ --define "filetype file" \
+ --define "filedata foo" \
+ /data/SPECS/replacetest.spec
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 2.0" \
+ --define "filetype link" \
+ --define "filedata stuff" \
+ /data/SPECS/replacetest.spec
+
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+cat "${tf}"
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm
+readlink "${tf}"
+runroot rpm -U --oldpackage "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+cat "${tf}"
+],
+[0],
+[foo
+stuff
+foo
+],
+[])
+AT_CLEANUP
+
+AT_SETUP([upgrade regular file to/from file link])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+tf="${RPMTEST}"/opt/foo
+rm -rf "${RPMTEST}"/opt/*
+rm -rf "${TOPDIR}"
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 1.0" \
+ --define "filetype file" \
+ --define "filedata foo" \
+ /data/SPECS/replacetest.spec
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 2.0" \
+ --define "filetype link" \
+ --define "filedata goo" \
+ /data/SPECS/replacetest.spec
+
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+cat "${tf}"
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm
+readlink "${tf}"
+runroot rpm -U --oldpackage "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+cat "${tf}"
+],
+[0],
+[foo
+goo
+foo
+],
+[])
+AT_CLEANUP
+
+AT_SETUP([upgrade broken link to broken link])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+tf="${RPMTEST}"/opt/foo
+rm -rf "${RPMTEST}"/opt/*
+rm -rf "${TOPDIR}"
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 1.0" \
+ --define "filetype link" \
+ --define "filedata stiff" \
+ /data/SPECS/replacetest.spec
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 2.0" \
+ --define "filetype link" \
+ --define "filedata stuff" \
+ /data/SPECS/replacetest.spec
+
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+readlink "${tf}"
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm
+readlink "${tf}"
+],
+[0],
+[stiff
+stuff
+],
+[])
+AT_CLEANUP
+
+AT_SETUP([upgrade file link to file link])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+tf="${RPMTEST}"/opt/foo
+rm -rf "${RPMTEST}"/opt/*
+rm -rf "${TOPDIR}"
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 1.0" \
+ --define "filetype link" \
+ --define "filedata goo" \
+ /data/SPECS/replacetest.spec
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 2.0" \
+ --define "filetype link" \
+ --define "filedata goo" \
+ /data/SPECS/replacetest.spec
+
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+readlink "${tf}"
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm
+readlink "${tf}"
+],
+[0],
+[goo
+goo
+],
+[])
+AT_CLEANUP
+
+AT_SETUP([upgrade directory link to directory link])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+tf="${RPMTEST}"/opt/foo
+rm -rf "${RPMTEST}"/opt/*
+rm -rf "${TOPDIR}"
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 1.0" \
+ --define "filetype link" \
+ --define "filedata zoo" \
+ /data/SPECS/replacetest.spec
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 2.0" \
+ --define "filetype link" \
+ --define "filedata zoo" \
+ /data/SPECS/replacetest.spec
+
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+readlink "${tf}"
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm
+readlink "${tf}"
+],
+[0],
+[zoo
+zoo
+],
+[])
+AT_CLEANUP
+
+AT_SETUP([upgrade regular file to directory])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+tf="${RPMTEST}"/opt/foo
+rm -rf "${RPMTEST}"/opt/*
+rm -rf "${TOPDIR}"
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 1.0" \
+ --define "filetype file" \
+ --define "filedata foo" \
+ /data/SPECS/replacetest.spec
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 2.0" \
+ --define "filetype dir" \
+ /data/SPECS/replacetest.spec
+
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+cat "${tf}"
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm
+test -d "${tf}"
+],
+[0],
+[foo
+],
+[])
+AT_CLEANUP
+
+AT_SETUP([upgrade broken link to directory])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+tf="${RPMTEST}"/opt/foo
+rm -rf "${RPMTEST}"/opt/*
+rm -rf "${TOPDIR}"
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 1.0" \
+ --define "filetype link" \
+ --define "filedata other" \
+ /data/SPECS/replacetest.spec
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 2.0" \
+ --define "filetype dir" \
+ /data/SPECS/replacetest.spec
+
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+readlink "${tf}"
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm
+test -d "${tf}"
+],
+[0],
+[other
+],
+[])
+AT_CLEANUP
+
+AT_SETUP([upgrade file link to directory])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+tf="${RPMTEST}"/opt/foo
+rm -rf "${RPMTEST}"/opt/*
+rm -rf "${TOPDIR}"
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 1.0" \
+ --define "filetype link" \
+ --define "filedata goo" \
+ /data/SPECS/replacetest.spec
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 2.0" \
+ --define "filetype dir" \
+ /data/SPECS/replacetest.spec
+
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+readlink "${tf}"
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm
+test -d "${tf}"
+],
+[0],
+[goo
+],
+[])
+AT_CLEANUP
+
+# XXX: this "succeeds" but with bogus results
+AT_SETUP([upgrade directory link to directory])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+tf="${RPMTEST}"/opt/foo
+rm -rf "${RPMTEST}"/opt/*
+rm -rf "${TOPDIR}"
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 1.0" \
+ --define "filetype link" \
+ --define "filedata zoo" \
+ /data/SPECS/replacetest.spec
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 2.0" \
+ --define "filetype dir" \
+ /data/SPECS/replacetest.spec
+
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+readlink "${tf}"
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm
+test -d "${tf}"
+],
+[0],
+[zoo
+],
+[])
+AT_CLEANUP
+
+AT_SETUP([upgrade empty directory to empty directory])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+tf="${RPMTEST}"/opt/foo
+rm -rf "${RPMTEST}"/opt/*
+rm -rf "${TOPDIR}"
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 1.0" \
+ --define "filetype dir" \
+ /data/SPECS/replacetest.spec
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 2.0" \
+ --define "filetype dir" \
+ /data/SPECS/replacetest.spec
+
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+test -d "${tf}" && runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm
+test -d "${tf}"
+],
+[0],
+[],
+[])
+AT_CLEANUP
+
+AT_SETUP([upgrade empty directory to regular file])
+AT_XFAIL_IF([test $RPM_XFAIL -ne 2])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+tf="${RPMTEST}"/opt/foo
+rm -rf "${RPMTEST}"/opt/*
+rm -rf "${TOPDIR}"
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 1.0" \
+ --define "filetype dir" \
+ /data/SPECS/replacetest.spec
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 2.0" \
+ --define "filetype file" \
+ --define "filedata woot" \
+ /data/SPECS/replacetest.spec
+
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+test -d "${tf}" && runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm
+],
+[2],
+[],
+[ file /opt/foo from install of replacetest-2.0-1.noarch conflicts with file from package replacetest-1.0-1.noarch
+])
+AT_CLEANUP
+
+AT_SETUP([upgrade locally symlinked directory])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+tf="${RPMTEST}"/opt/foo
+rm -rf "${RPMTEST}"/opt/*
+rm -rf "${TOPDIR}"
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 1.0" \
+ --define "filetype datadir" \
+ --define "filedata README1" \
+ /data/SPECS/replacetest.spec
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 2.0" \
+ --define "filetype datadir" \
+ --define "filedata README2" \
+ /data/SPECS/replacetest.spec
+
+mkdir "${RPMTEST}"/opt/f00f
+ln -s f00f "${RPMTEST}"/opt/foo
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+test -L "${tf}" && test -d "${tf}" && runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm
+test -L "${tf}" && test -d "${tf}"
+],
+[0],
+[],
+[])
+AT_CLEANUP
+
+AT_SETUP([upgrade empty directory to broken link])
+AT_XFAIL_IF([test $RPM_XFAIL -ne 2])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+tf="${RPMTEST}"/opt/foo
+rm -rf "${RPMTEST}"/opt/*
+rm -rf "${TOPDIR}"
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 1.0" \
+ --define "filetype dir" \
+ /data/SPECS/replacetest.spec
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 2.0" \
+ --define "filetype link" \
+ --define "filedata woot" \
+ /data/SPECS/replacetest.spec
+
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+test -d "${tf}" && runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm
+],
+[2],
+[],
+[ file /opt/foo from install of replacetest-2.0-1.noarch conflicts with file from package replacetest-1.0-1.noarch
+])
+AT_CLEANUP
+
+AT_SETUP([upgrade empty directory to file link])
+AT_XFAIL_IF([test $RPM_XFAIL -ne 2])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+tf="${RPMTEST}"/opt/foo
+rm -rf "${RPMTEST}"/opt/*
+rm -rf "${TOPDIR}"
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 1.0" \
+ --define "filetype dir" \
+ /data/SPECS/replacetest.spec
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 2.0" \
+ --define "filetype link" \
+ --define "filedata woot" \
+ /data/SPECS/replacetest.spec
+
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+test -d "${tf}" && runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm
+],
+[2],
+[],
+[ file /opt/foo from install of replacetest-2.0-1.noarch conflicts with file from package replacetest-1.0-1.noarch
+])
+AT_CLEANUP
+
+AT_SETUP([upgrade removed empty directory to file link])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+tf="${RPMTEST}"/opt/foo
+rm -rf "${RPMTEST}"/opt/*
+rm -rf "${TOPDIR}"
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 1.0" \
+ --define "filetype dir" \
+ /data/SPECS/replacetest.spec
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 2.0" \
+ --define "filetype link" \
+ --define "filedata goo" \
+ /data/SPECS/replacetest.spec
+
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+test -d "${tf}" && rmdir "${tf}" && runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm
+readlink "${tf}"
+],
+[0],
+[goo
+],
+[])
+AT_CLEANUP
+
+AT_SETUP([upgrade replaced empty directory to file link])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+tf="${RPMTEST}"/opt/foo
+rm -rf "${RPMTEST}"/opt/*
+rm -rf "${TOPDIR}"
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 1.0" \
+ --define "filetype dir" \
+ /data/SPECS/replacetest.spec
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 2.0" \
+ --define "filetype link" \
+ --define "filedata goo" \
+ /data/SPECS/replacetest.spec
+
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+test -d "${tf}" && rmdir "${tf}" && ln -sf goo "${tf}" && runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm
+readlink "${tf}"
+],
+[0],
+[goo
+],
+[])
+AT_CLEANUP
+
+AT_SETUP([upgrade empty directory to file link with pretrans])
+AT_KEYWORDS([install])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+tf="${RPMTEST}"/opt/foo
+rm -rf "${RPMTEST}"/opt/*
+rm -rf "${TOPDIR}"
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 1.0" \
+ --define "filetype dir" \
+ /data/SPECS/replacetest.spec
+
+runroot rpmbuild --quiet -bb \
+ --define "ver 2.0" \
+ --define "filetype link" \
+ --define "filedata goo" \
+ --define "fixit posix.rmdir('/opt/foo')" \
+ /data/SPECS/replacetest.spec
+
+runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-1.0-1.noarch.rpm
+test -d "${tf}" && runroot rpm -U --test "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm && runroot rpm -U "${TOPDIR}"/RPMS/noarch/replacetest-2.0-1.noarch.rpm
+readlink "${tf}"
+],
+[0],
+[goo
+],
+[])
+AT_CLEANUP
diff --git a/tests/rpmtests.at b/tests/rpmtests.at
index fcb9e5dd0..b51266a2d 100644
--- a/tests/rpmtests.at
+++ b/tests/rpmtests.at
@@ -8,6 +8,7 @@ m4_include([rpmscript.at])
m4_include([rpmvercmp.at])
m4_include([rpmdeps.at])
m4_include([rpmconflict.at])
+m4_include([rpmreplace.at])
m4_include([rpmconfig.at])
m4_include([rpmconfig2.at])
m4_include([rpmconfig3.at])