summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-09-24 11:56:34 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-09-24 11:56:34 +0300
commit25dbf52fe2968c1e118dc995c3045ee6666454ca (patch)
tree6344f8e42cfeedd7ac340643a14fb0467f62dc13 /tests
parentf7c1eb5ef041b9b06cbb81dac7d7972a602cad44 (diff)
downloadrpm-25dbf52fe2968c1e118dc995c3045ee6666454ca.tar.gz
rpm-25dbf52fe2968c1e118dc995c3045ee6666454ca.tar.bz2
rpm-25dbf52fe2968c1e118dc995c3045ee6666454ca.zip
Test obsoletions within the transaction set, both ways
- Similar to commit f7c1eb5ef041b9b06cbb81dac7d7972a602cad44 but on obsoletions
Diffstat (limited to 'tests')
-rw-r--r--tests/data/SPECS/deptest.spec1
-rw-r--r--tests/rpmi.at58
2 files changed, 59 insertions, 0 deletions
diff --git a/tests/data/SPECS/deptest.spec b/tests/data/SPECS/deptest.spec
index 343532554..7f2228f11 100644
--- a/tests/data/SPECS/deptest.spec
+++ b/tests/data/SPECS/deptest.spec
@@ -9,6 +9,7 @@ BuildArch: noarch
%{?reqs:Requires: %{reqs}}
%{?provs:Provides: %{provs}}
%{?cfls:Conflicts: %{cfls}}
+%{?obs:Obsoletes: %{obs}}
%description
%{summary}
diff --git a/tests/rpmi.at b/tests/rpmi.at
index 7e9c26cfb..04491c841 100644
--- a/tests/rpmi.at
+++ b/tests/rpmi.at
@@ -190,8 +190,66 @@ versiontest-2.0-1.noarch
],
[warning: package versiontest-2.0-1.noarch was already added, skipping versiontest-1.0-1.noarch
])
+AT_CLEANUP
+
+# Test upgrade of obsoleted package in same transaction
+AT_SETUP([rpm -U obsoleted package 1])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+
+runroot rpmbuild --quiet -bb \
+ --define "pkg one" \
+ --define "obs deptest-two" \
+ /data/SPECS/deptest.spec
+runroot rpmbuild --quiet -bb \
+ --define "pkg two" \
+ /data/SPECS/deptest.spec
+
+
+runroot rpm -Uv \
+ "${TOPDIR}"/RPMS/noarch/deptest-two-1.0-1.noarch.rpm \
+ "${TOPDIR}"/RPMS/noarch/deptest-one-1.0-1.noarch.rpm
+runroot rpm -q deptest-one
+],
+[0],
+[Preparing packages...
+deptest-one-1.0-1.noarch
+deptest-one-1.0-1.noarch
+],
+[warning: package deptest-two-1.0-1.noarch was already added, replacing with deptest-one-1.0-1.noarch
+])
+AT_CLEANUP
+
+# Test upgrade of obsoleted package in same transaction
+AT_SETUP([rpm -U obsoleted package 2])
+AT_CHECK([
+RPMDB_CLEAR
+RPMDB_INIT
+
+runroot rpmbuild --quiet -bb \
+ --define "pkg one" \
+ --define "obs deptest-two" \
+ /data/SPECS/deptest.spec
+runroot rpmbuild --quiet -bb \
+ --define "pkg two" \
+ /data/SPECS/deptest.spec
+
+runroot rpm -Uv \
+ "${TOPDIR}"/RPMS/noarch/deptest-one-1.0-1.noarch.rpm \
+ "${TOPDIR}"/RPMS/noarch/deptest-two-1.0-1.noarch.rpm
+runroot rpm -q deptest-one
+],
+[0],
+[Preparing packages...
+deptest-one-1.0-1.noarch
+deptest-one-1.0-1.noarch
+],
+[warning: package deptest-one-1.0-1.noarch was already added, skipping deptest-two-1.0-1.noarch
+])
AT_CLEANUP
+
# Test install of two different versions in same transaction
AT_SETUP([rpm -i two versions of same package])
AT_CHECK([