summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-13 13:26:17 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-13 13:26:17 +0000
commit65ae16286178c9d7f3110b5fc4400805033bdace (patch)
treeed5e834907b87da3dc886eb880f42e251bc0467c
parent610bd9c091deeb2bef7becc82a410753068e0a10 (diff)
downloadurpmi-65ae16286178c9d7f3110b5fc4400805033bdace.tar
urpmi-65ae16286178c9d7f3110b5fc4400805033bdace.tar.gz
urpmi-65ae16286178c9d7f3110b5fc4400805033bdace.tar.bz2
urpmi-65ae16286178c9d7f3110b5fc4400805033bdace.tar.xz
urpmi-65ae16286178c9d7f3110b5fc4400805033bdace.zip
add a test case
-rw-r--r--t/superuser--split-transactions--promote.t39
1 files changed, 38 insertions, 1 deletions
diff --git a/t/superuser--split-transactions--promote.t b/t/superuser--split-transactions--promote.t
index a157efe3..cf8394f8 100644
--- a/t/superuser--split-transactions--promote.t
+++ b/t/superuser--split-transactions--promote.t
@@ -9,7 +9,7 @@
#
# e-2 conflicts with f-1
#
-# g-2 conflicts with h-1
+# h-1 conflicts with g-2
#
use strict;
use lib '.', 't';
@@ -25,6 +25,7 @@ urpmi_addmedia("$name-2 $::pwd/media/$name-2");
test('--split-length 0');
test('--split-level 1');
+test_conflict();
sub test {
my ($split) = @_;
@@ -43,6 +44,10 @@ sub test {
#- below need the promotion of "h-2" (upgraded from "h-1") to work
test_gh("$split g");
}
+sub test_conflict {
+ test_conflict_ef();
+ test_conflict_gh();
+}
sub test_ab {
my ($para) = @_;
@@ -83,3 +88,35 @@ sub test_gh {
urpmi("--media $name-2 --auto $para");
check_installed_fullnames_and_remove('g-2-1', 'h-2-1');
}
+
+sub test_conflict_ef {
+ my ($para) = @_;
+
+ urpmi("--media $name-1 f");
+ check_installed_names('f');
+
+ my @reasons = run_urpmi_and_get_conflicts("--media $name-1 --auto media/$name-2/e-2-*.rpm");
+ $reasons[0] =~ s/\.\w+$//; # get rid of arch
+ my $wanted = 'e-2-1';
+ ok($reasons[0] eq $wanted, "$wanted in @reasons");
+ check_installed_fullnames_and_remove('e-2-1');
+}
+
+sub test_conflict_gh {
+ my ($para) = @_;
+
+ urpmi("--media $name-1 h");
+ check_installed_names('h');
+
+ my @reasons = run_urpmi_and_get_conflicts("--media $name-1 --auto media/$name-2/g-2-*.rpm");
+ my $wanted = 'g[> 1]';
+ ok($reasons[0] eq $wanted, "$wanted in @reasons");
+ check_installed_fullnames_and_remove('g-2-1');
+}
+
+sub run_urpmi_and_get_conflicts {
+ my ($para) = @_;
+ my $cmd = urpmi_cmd() . " $para";
+ my $output = `$cmd`;
+ $output =~ /\(due to conflicts with (.*)\)/g;
+}