diff options
author | Anssi Hannula <anssi@mandriva.org> | 2009-07-07 13:35:45 +0000 |
---|---|---|
committer | Anssi Hannula <anssi@mandriva.org> | 2009-07-07 13:35:45 +0000 |
commit | b45de639ca142eb46ecce6dc8c82a87e6908c79c (patch) | |
tree | da99e7e69f38ca3ed20ff68861a663b2d75e0aad | |
parent | 2edd019a9c08fd91322f13eced6dafa15a18e263 (diff) | |
download | urpmi-b45de639ca142eb46ecce6dc8c82a87e6908c79c.tar urpmi-b45de639ca142eb46ecce6dc8c82a87e6908c79c.tar.gz urpmi-b45de639ca142eb46ecce6dc8c82a87e6908c79c.tar.bz2 urpmi-b45de639ca142eb46ecce6dc8c82a87e6908c79c.tar.xz urpmi-b45de639ca142eb46ecce6dc8c82a87e6908c79c.zip |
add testcase for bug #52105
-rw-r--r-- | MANIFEST | 5 | ||||
-rw-r--r-- | t/02create_pkgs.t | 3 | ||||
-rw-r--r-- | t/data/SPECS/backtrack-promotion/a-i586.spec | 13 | ||||
-rw-r--r-- | t/data/SPECS/backtrack-promotion/a-x86_64.spec | 14 | ||||
-rw-r--r-- | t/data/SPECS/backtrack-promotion/c.spec | 14 | ||||
-rw-r--r-- | t/data/SPECS/backtrack-promotion/d.spec | 14 | ||||
-rw-r--r-- | t/superuser--backtrack-promotion.t | 33 |
7 files changed, 95 insertions, 1 deletions
@@ -112,6 +112,10 @@ t/data/SPECS/arch_to_noarch_1.spec t/data/SPECS/arch_to_noarch_2.spec t/data/SPECS/arch_to_noarch_3.spec t/data/SPECS/arch_to_noarch_4.spec +t/data/SPECS/backtrack-promotion/a-i586.spec +t/data/SPECS/backtrack-promotion/a-x86_64.spec +t/data/SPECS/backtrack-promotion/c.spec +t/data/SPECS/backtrack-promotion/d.spec t/data/SPECS/best-versioned-provide/a1.spec t/data/SPECS/best-versioned-provide/a_cc.spec t/data/SPECS/best-versioned-provide/a_dd.spec @@ -397,6 +401,7 @@ t/README t/simple-httpd t/superuser--addmedia.t t/superuser--arch_to_noarch.t +t/superuser--backtrack-promotion.t t/superuser--best-versioned-provide.t t/superuser--buggy-rpms.t t/superuser--dropped-provides.t diff --git a/t/02create_pkgs.t b/t/02create_pkgs.t index 81f282d6..507af0c4 100644 --- a/t/02create_pkgs.t +++ b/t/02create_pkgs.t @@ -62,7 +62,8 @@ sub rpmbuild { my ($spec, $o_medium_name) = @_; my $dir = getcwd(); - system_("rpmbuild --quiet --define 'rpm_version %(rpm -q --queryformat \"%{VERSION}\" rpm|sed -e \"s/\\\\.//g\")' --define '_topdir $dir/tmp' --define '_tmppath $dir/tmp' -bb --clean --nodeps $spec"); + my ($target) = $spec =~ m!-(i586|x86_64)\.spec$!; + system_("rpmbuild --quiet --define 'rpm_version %(rpm -q --queryformat \"%{VERSION}\" rpm|sed -e \"s/\\\\.//g\")' --define '_topdir $dir/tmp' --define '_tmppath $dir/tmp' -bb --clean --nodeps ".($target ? "--target $target" : "")." $spec"); my ($name) = $spec =~ m!([^/]*)\.spec$!; diff --git a/t/data/SPECS/backtrack-promotion/a-i586.spec b/t/data/SPECS/backtrack-promotion/a-i586.spec new file mode 100644 index 00000000..f75c94d2 --- /dev/null +++ b/t/data/SPECS/backtrack-promotion/a-i586.spec @@ -0,0 +1,13 @@ +Summary: x +Name: a +Version: 1 +Release: 1 +License: x +Group: x +Url: x +BuildRoot: %{_tmppath}/%{name} + +%description +x + +%files diff --git a/t/data/SPECS/backtrack-promotion/a-x86_64.spec b/t/data/SPECS/backtrack-promotion/a-x86_64.spec new file mode 100644 index 00000000..19dd247d --- /dev/null +++ b/t/data/SPECS/backtrack-promotion/a-x86_64.spec @@ -0,0 +1,14 @@ +Summary: x +Name: a +Version: 1 +Release: 1 +License: x +Group: x +Url: x +Provides: b +BuildRoot: %{_tmppath}/%{name} + +%description +x + +%files diff --git a/t/data/SPECS/backtrack-promotion/c.spec b/t/data/SPECS/backtrack-promotion/c.spec new file mode 100644 index 00000000..ca0c8476 --- /dev/null +++ b/t/data/SPECS/backtrack-promotion/c.spec @@ -0,0 +1,14 @@ +Summary: x +Name: c +Version: 1 +Release: 1 +License: x +Group: x +Url: x +Conflicts: b +BuildRoot: %{_tmppath}/%{name} + +%description +x + +%files diff --git a/t/data/SPECS/backtrack-promotion/d.spec b/t/data/SPECS/backtrack-promotion/d.spec new file mode 100644 index 00000000..c5093137 --- /dev/null +++ b/t/data/SPECS/backtrack-promotion/d.spec @@ -0,0 +1,14 @@ +Summary: x +Name: d +Version: 1 +Release: 1 +License: x +Group: x +Url: x +Requires: a +BuildRoot: %{_tmppath}/%{name} + +%description +x + +%files diff --git a/t/superuser--backtrack-promotion.t b/t/superuser--backtrack-promotion.t new file mode 100644 index 00000000..99825cf0 --- /dev/null +++ b/t/superuser--backtrack-promotion.t @@ -0,0 +1,33 @@ +#!/usr/bin/perl +# +# testcase for bug #52105 +# +# a.x86_64 provides b +# a.i586 does not provide b +# c conflicts with b +# d requires a +# +# user has a.x86_64, d installed +# trying to install c has to remove a, d +# +# Original problem: +# urpmi tries to promote a.i586 for d, but strict-arch does not allow it; +# backtracking finds a.i586 as well and tries it again; it still does not +# work, but urpmi already forgot the promotion and does not remove d +# +use strict; +use lib '.', 't'; +use helper; +use urpm::util; +use Test::More 'no_plan'; + +need_root_and_prepare(); + +my $name = 'backtrack-promotion'; +urpmi_addmedia("$name $::pwd/media/$name"); + +urpmi("--auto --ignorearch a-1-1.x86_64 d"); +check_installed_fullnames("a-1-1", "d-1-1"); +urpmi("--auto --ignorearch c"); +check_installed_fullnames("c-1-1"); + |