From b8f0bf2c8511923aa38fc66124549bab81f40a89 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 2 Oct 2007 09:47:49 +0000 Subject: add a test showing rpm failure (for #34342) --- t/data/SPECS/suggests/c2.spec | 14 ++++++++++++++ t/superuser--suggests.t | 21 +++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 t/data/SPECS/suggests/c2.spec diff --git a/t/data/SPECS/suggests/c2.spec b/t/data/SPECS/suggests/c2.spec new file mode 100644 index 00000000..861d0688 --- /dev/null +++ b/t/data/SPECS/suggests/c2.spec @@ -0,0 +1,14 @@ +Summary: x +Name: c2 +Version: 1 +Release: 1 +License: x +Group: x +Url: x +Requires: cc +BuildRoot: %{_tmppath}/%{name} + +%description +x + +%files diff --git a/t/superuser--suggests.t b/t/superuser--suggests.t index c81d71bd..9517ca8a 100644 --- a/t/superuser--suggests.t +++ b/t/superuser--suggests.t @@ -8,6 +8,7 @@ # b suggests suggested_b # c suggests cc # cc requires b +# c2 requires cc # # with-invalid suggests invalid # @@ -23,6 +24,8 @@ my $medium_name = 'suggests'; urpmi_addmedia("$medium_name $::pwd/media/$medium_name"); +test_d(); +exit; test_b(); test_c(); test_invalid(); @@ -83,3 +86,21 @@ sub test_upgrade { urpmi(" --auto a-3"); check_installed_and_remove('a', 'suggested_c'); } + +sub test_d { + my @common = ('b', 'bb', 'suggested_b'); + + urpmi("--auto c"); + check_installed_names('c', 'cc', @common); + system_("rpm --root $::pwd/root -e cc"); + check_installed_and_remove('c', @common); + + foreach my $names ('c2', 'c2 c') { # ERROR: 'c c2' should work (#34342) + my @names = split(' ', $names); + urpmi("--auto $_") foreach @names; + check_installed_names(@names, 'cc', @common); + system_should_fail("rpm --root $::pwd/root -e cc"); + check_installed_and_remove(@names, 'cc', @common); + } +} + -- cgit v1.2.1