summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-07 11:29:03 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-07 11:29:03 +0000
commita50f282e577e45d929902d342554f9a3519b9901 (patch)
tree5b6c7191ec8912038a85ba9ef933b47bcd1e4118 /t
parente4179a5e22b5ddfa6ebbc5cbbb7abad0f0f149a9 (diff)
downloadurpmi-a50f282e577e45d929902d342554f9a3519b9901.tar
urpmi-a50f282e577e45d929902d342554f9a3519b9901.tar.gz
urpmi-a50f282e577e45d929902d342554f9a3519b9901.tar.bz2
urpmi-a50f282e577e45d929902d342554f9a3519b9901.tar.xz
urpmi-a50f282e577e45d929902d342554f9a3519b9901.zip
add a simple test case for promotion on conflict
Diffstat (limited to 't')
-rw-r--r--t/data/SPECS/split-transactions--promote-1/e.spec13
-rw-r--r--t/data/SPECS/split-transactions--promote-1/f.spec13
-rw-r--r--t/data/SPECS/split-transactions--promote-2/e.spec14
-rw-r--r--t/data/SPECS/split-transactions--promote-2/f.spec13
-rw-r--r--t/superuser--split-transactions--promote.t38
5 files changed, 82 insertions, 9 deletions
diff --git a/t/data/SPECS/split-transactions--promote-1/e.spec b/t/data/SPECS/split-transactions--promote-1/e.spec
new file mode 100644
index 00000000..fc55824e
--- /dev/null
+++ b/t/data/SPECS/split-transactions--promote-1/e.spec
@@ -0,0 +1,13 @@
+Summary: x
+Name: e
+Version: 1
+Release: 1
+License: x
+Group: x
+Url: x
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/split-transactions--promote-1/f.spec b/t/data/SPECS/split-transactions--promote-1/f.spec
new file mode 100644
index 00000000..33b16b57
--- /dev/null
+++ b/t/data/SPECS/split-transactions--promote-1/f.spec
@@ -0,0 +1,13 @@
+Summary: x
+Name: f
+Version: 1
+Release: 1
+License: x
+Group: x
+Url: x
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/split-transactions--promote-2/e.spec b/t/data/SPECS/split-transactions--promote-2/e.spec
new file mode 100644
index 00000000..c3252dce
--- /dev/null
+++ b/t/data/SPECS/split-transactions--promote-2/e.spec
@@ -0,0 +1,14 @@
+Summary: x
+Name: e
+Version: 2
+Release: 1
+License: x
+Group: x
+Url: x
+Conflicts: f <= 1
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/split-transactions--promote-2/f.spec b/t/data/SPECS/split-transactions--promote-2/f.spec
new file mode 100644
index 00000000..9b6d3347
--- /dev/null
+++ b/t/data/SPECS/split-transactions--promote-2/f.spec
@@ -0,0 +1,13 @@
+Summary: x
+Name: f
+Version: 2
+Release: 1
+License: x
+Group: x
+Url: x
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/superuser--split-transactions--promote.t b/t/superuser--split-transactions--promote.t
index d13ed470..bbee7f5b 100644
--- a/t/superuser--split-transactions--promote.t
+++ b/t/superuser--split-transactions--promote.t
@@ -6,6 +6,9 @@
# c requires d
# d1-1 provides d, but not d1-2
# d2-2 provides d, but not d2-1
+#
+# e-2 conflicts with f-1
+#
use strict;
use lib '.', 't';
use helper;
@@ -14,20 +17,27 @@ use Test::More 'no_plan';
need_root_and_prepare();
-my $name = 'split-transactions--strict-require';
+my $name = 'split-transactions--promote';
urpmi_addmedia("$name-1 $::pwd/media/$name-1");
urpmi_addmedia("$name-2 $::pwd/media/$name-2");
-#- below need the promotion of "a-2" (upgraded from "a-1")
-test_ab('--split-length 0 b');
-test_ab('--split-level 1 b');
+test('--split-length 0');
+test('--split-level 1');
+
+sub test {
+ my ($split) = @_;
-test_ab('--split-length 0 --auto-select');
-test_ab('--split-level 1 --auto-select');
+ test_ab("$split --auto-select");
-#- below need the promotion of "d2" (new package to install)
-test_cd('--split-length 0 d1');
-test_cd('--split-level 1 d1');
+ #- below need the promotion of "a-2" (upgraded from "a-1") to work
+ test_ab("$split b");
+
+ #- below need the promotion of "d2" (new installed package) to work
+ test_cd("$split d1");
+
+ #- below need the promotion of "f-2" (upgraded from "f-1") to work
+ test_ef("$split e");
+}
sub test_ab {
my ($para) = @_;
@@ -48,3 +58,13 @@ sub test_cd {
urpmi("--media $name-2 --auto $para");
check_installed_fullnames_and_remove('c-1-1', 'd1-2-1', 'd2-2-1');
}
+
+sub test_ef {
+ my ($para) = @_;
+
+ urpmi("--media $name-1 --auto e f");
+ check_installed_names('f', 'e');
+
+ urpmi("--media $name-2 --auto $para");
+ check_installed_fullnames_and_remove('e-2-1', 'f-2-1');
+}