summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-28 10:56:40 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-28 10:56:40 +0000
commit2ea968316bc0cd2d83ffa165221ed59d4d6ef8d0 (patch)
tree80a5492157013e28821c9f4a3842a3e8ad6f8c72 /t
parent17c508725574d481533bf691a4840693e7d52356 (diff)
downloadurpmi-2ea968316bc0cd2d83ffa165221ed59d4d6ef8d0.tar
urpmi-2ea968316bc0cd2d83ffa165221ed59d4d6ef8d0.tar.gz
urpmi-2ea968316bc0cd2d83ffa165221ed59d4d6ef8d0.tar.bz2
urpmi-2ea968316bc0cd2d83ffa165221ed59d4d6ef8d0.tar.xz
urpmi-2ea968316bc0cd2d83ffa165221ed59d4d6ef8d0.zip
add a test which currently triggers a big transaction
Diffstat (limited to 't')
-rw-r--r--t/data/SPECS/split-transactions--strict-require-1/a.spec14
-rw-r--r--t/data/SPECS/split-transactions--strict-require-1/b.spec14
-rw-r--r--t/data/SPECS/split-transactions--strict-require-1/c.spec13
-rw-r--r--t/data/SPECS/split-transactions--strict-require-2/a.spec14
-rw-r--r--t/data/SPECS/split-transactions--strict-require-2/c.spec13
-rw-r--r--t/superuser--split-transactions--strict-require.t42
6 files changed, 110 insertions, 0 deletions
diff --git a/t/data/SPECS/split-transactions--strict-require-1/a.spec b/t/data/SPECS/split-transactions--strict-require-1/a.spec
new file mode 100644
index 00000000..b9d1643b
--- /dev/null
+++ b/t/data/SPECS/split-transactions--strict-require-1/a.spec
@@ -0,0 +1,14 @@
+Summary: x
+Name: a
+Version: 1
+Release: 1
+License: x
+Group: x
+Url: x
+Requires: b = 1
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/split-transactions--strict-require-1/b.spec b/t/data/SPECS/split-transactions--strict-require-1/b.spec
new file mode 100644
index 00000000..3256ac6a
--- /dev/null
+++ b/t/data/SPECS/split-transactions--strict-require-1/b.spec
@@ -0,0 +1,14 @@
+Summary: x
+Name: b
+Version: 1
+Release: 1
+License: x
+Group: x
+Url: x
+Requires: c = 1
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/split-transactions--strict-require-1/c.spec b/t/data/SPECS/split-transactions--strict-require-1/c.spec
new file mode 100644
index 00000000..21381cf9
--- /dev/null
+++ b/t/data/SPECS/split-transactions--strict-require-1/c.spec
@@ -0,0 +1,13 @@
+Summary: x
+Name: c
+Version: 1
+Release: 1
+License: x
+Group: x
+Url: x
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/split-transactions--strict-require-2/a.spec b/t/data/SPECS/split-transactions--strict-require-2/a.spec
new file mode 100644
index 00000000..66387902
--- /dev/null
+++ b/t/data/SPECS/split-transactions--strict-require-2/a.spec
@@ -0,0 +1,14 @@
+Summary: x
+Name: a
+Version: 2
+Release: 1
+License: x
+Group: x
+Url: x
+Requires: c = 2
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/split-transactions--strict-require-2/c.spec b/t/data/SPECS/split-transactions--strict-require-2/c.spec
new file mode 100644
index 00000000..3ede1e1e
--- /dev/null
+++ b/t/data/SPECS/split-transactions--strict-require-2/c.spec
@@ -0,0 +1,13 @@
+Summary: x
+Name: c
+Version: 2
+Release: 1
+License: x
+Group: x
+Url: x
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/superuser--split-transactions--strict-require.t b/t/superuser--split-transactions--strict-require.t
new file mode 100644
index 00000000..7ccfeff3
--- /dev/null
+++ b/t/superuser--split-transactions--strict-require.t
@@ -0,0 +1,42 @@
+#!/usr/bin/perl
+
+# a-1 requires b-1
+# b-1 requires c-1
+# a-2 requires c-2, no b-2
+#
+use strict;
+use lib '.', 't';
+use helper;
+use urpm::util;
+use Test::More 'no_plan';
+
+need_root_and_prepare();
+
+my $name = 'split-transactions--strict-require';
+urpmi_addmedia("$name-1 $::pwd/media/$name-1");
+urpmi_addmedia("$name-2 $::pwd/media/$name-2");
+
+test('--split-length 0');
+test('--split-level 1'); # ERROR: should not use a big transaction
+
+test_c('--split-level 1');
+
+sub test {
+ my ($option) = @_;
+
+ urpmi("--media $name-1 --auto a");
+ check_installed_fullnames('a-1-1', 'b-1-1', 'c-1-1');
+
+ urpmi("--media $name-2 --auto $option --auto-select");
+ check_installed_fullnames_and_remove('a-2-1', 'c-2-1');
+}
+
+sub test_c {
+ my ($option) = @_;
+
+ urpmi("--media $name-1 --auto a");
+ check_installed_fullnames('a-1-1', 'b-1-1', 'c-1-1');
+
+ urpmi("--media $name-2 --auto $option c");
+ check_installed_fullnames_and_remove('c-2-1'); # WARNING: a-2 could be promoted
+}