From f5f7b1c738fcee4290e164da3a43d11903ba5f07 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Wed, 7 Jan 2009 17:46:43 +0000 Subject: Add new testcase for bug #46874 --- t/data/SPECS/prefer2/a.spec | 15 +++++++++++++++ t/data/SPECS/prefer2/b1.spec | 14 ++++++++++++++ t/data/SPECS/prefer2/b2.spec | 14 ++++++++++++++ t/data/SPECS/prefer2/c1.spec | 14 ++++++++++++++ t/data/SPECS/prefer2/c2.spec | 14 ++++++++++++++ t/data/SPECS/prefer2/d.spec | 15 +++++++++++++++ t/superuser--prefer2.t | 30 ++++++++++++++++++++++++++++++ 7 files changed, 116 insertions(+) create mode 100644 t/data/SPECS/prefer2/a.spec create mode 100644 t/data/SPECS/prefer2/b1.spec create mode 100644 t/data/SPECS/prefer2/b2.spec create mode 100644 t/data/SPECS/prefer2/c1.spec create mode 100644 t/data/SPECS/prefer2/c2.spec create mode 100644 t/data/SPECS/prefer2/d.spec create mode 100644 t/superuser--prefer2.t diff --git a/t/data/SPECS/prefer2/a.spec b/t/data/SPECS/prefer2/a.spec new file mode 100644 index 00000000..83975633 --- /dev/null +++ b/t/data/SPECS/prefer2/a.spec @@ -0,0 +1,15 @@ +Summary: x +Name: a +Version: 1 +Release: 1 +License: x +Group: x +Url: x +BuildRoot: %{_tmppath}/%{name} +Requires: bb +Requires: b2 + +%description +x + +%files diff --git a/t/data/SPECS/prefer2/b1.spec b/t/data/SPECS/prefer2/b1.spec new file mode 100644 index 00000000..72eb8d53 --- /dev/null +++ b/t/data/SPECS/prefer2/b1.spec @@ -0,0 +1,14 @@ +Summary: x +Name: b1 +Version: 1 +Release: 1 +License: x +Group: x +Url: x +BuildRoot: %{_tmppath}/%{name} +Provides: bb + +%description +x + +%files diff --git a/t/data/SPECS/prefer2/b2.spec b/t/data/SPECS/prefer2/b2.spec new file mode 100644 index 00000000..80c2f48e --- /dev/null +++ b/t/data/SPECS/prefer2/b2.spec @@ -0,0 +1,14 @@ +Summary: x +Name: b2 +Version: 1 +Release: 1 +License: x +Group: x +Url: x +BuildRoot: %{_tmppath}/%{name} +Provides: bb + +%description +x + +%files diff --git a/t/data/SPECS/prefer2/c1.spec b/t/data/SPECS/prefer2/c1.spec new file mode 100644 index 00000000..97aee3e0 --- /dev/null +++ b/t/data/SPECS/prefer2/c1.spec @@ -0,0 +1,14 @@ +Summary: x +Name: c1 +Version: 1 +Release: 1 +License: x +Group: x +Url: x +BuildRoot: %{_tmppath}/%{name} +Provides: cc + +%description +x + +%files diff --git a/t/data/SPECS/prefer2/c2.spec b/t/data/SPECS/prefer2/c2.spec new file mode 100644 index 00000000..5080b244 --- /dev/null +++ b/t/data/SPECS/prefer2/c2.spec @@ -0,0 +1,14 @@ +Summary: x +Name: c2 +Version: 1 +Release: 1 +License: x +Group: x +Url: x +BuildRoot: %{_tmppath}/%{name} +Provides: cc + +%description +x + +%files diff --git a/t/data/SPECS/prefer2/d.spec b/t/data/SPECS/prefer2/d.spec new file mode 100644 index 00000000..fecd13c8 --- /dev/null +++ b/t/data/SPECS/prefer2/d.spec @@ -0,0 +1,15 @@ +Summary: x +Name: d +Version: 1 +Release: 1 +License: x +Group: x +Url: x +BuildRoot: %{_tmppath}/%{name} +Requires: cc +Requires: c1 + +%description +x + +%files diff --git a/t/superuser--prefer2.t b/t/superuser--prefer2.t new file mode 100644 index 00000000..b92a11b8 --- /dev/null +++ b/t/superuser--prefer2.t @@ -0,0 +1,30 @@ +#!/usr/bin/perl + +# testcase for bug #46874 +# a requires both bb and b2 +# bb is provided by both b1 and b2 +# => b1 must be picked over b2 +# +# d is the same as a with b1 => c2 and b2 => c1 +# (needed to ensure both ordering works) +# +use strict; +use lib '.', 't'; +use helper; +use urpm::util; +use Test::More 'no_plan'; + +need_root_and_prepare(); + +my $name = 'prefer2'; +urpmi_addmedia("$name $::pwd/media/$name"); + +test('a', ['a', 'b2']); +test('d', ['d', 'c1']); + +sub test { + my ($pkg, $result) = @_; + + urpmi("--auto $pkg"); + check_installed_and_remove(@$result); +} -- cgit v1.2.1