summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-04-30 13:37:54 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-04-30 13:37:54 +0000
commit94183c05f962e39c18ed56ce083124a0327a8284 (patch)
treef365c3a9f6d11b8223e1e75bc42709e90a13f9b8
parent4e4ad2677c430f39e67bfe61f3d37351650a8a88 (diff)
downloadurpmi-94183c05f962e39c18ed56ce083124a0327a8284.tar
urpmi-94183c05f962e39c18ed56ce083124a0327a8284.tar.gz
urpmi-94183c05f962e39c18ed56ce083124a0327a8284.tar.bz2
urpmi-94183c05f962e39c18ed56ce083124a0327a8284.tar.xz
urpmi-94183c05f962e39c18ed56ce083124a0327a8284.zip
add a simple test case on split transactions
-rw-r--r--t/data/SPECS/split-transactions/a.spec14
-rw-r--r--t/data/SPECS/split-transactions/b.spec14
-rw-r--r--t/data/SPECS/split-transactions/c.spec14
-rw-r--r--t/data/SPECS/split-transactions/d.spec13
-rw-r--r--t/superuser--split-transactions.t40
5 files changed, 95 insertions, 0 deletions
diff --git a/t/data/SPECS/split-transactions/a.spec b/t/data/SPECS/split-transactions/a.spec
new file mode 100644
index 00000000..8a997f9e
--- /dev/null
+++ b/t/data/SPECS/split-transactions/a.spec
@@ -0,0 +1,14 @@
+Summary: a
+Name: a
+Version: 1
+Release: 1
+License: x
+Group: x
+Url: x
+Requires: b
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/split-transactions/b.spec b/t/data/SPECS/split-transactions/b.spec
new file mode 100644
index 00000000..ef1bcdad
--- /dev/null
+++ b/t/data/SPECS/split-transactions/b.spec
@@ -0,0 +1,14 @@
+Summary: b
+Name: b
+Version: 1
+Release: 1
+License: x
+Group: x
+Url: x
+Requires: a
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/split-transactions/c.spec b/t/data/SPECS/split-transactions/c.spec
new file mode 100644
index 00000000..1a71d1cf
--- /dev/null
+++ b/t/data/SPECS/split-transactions/c.spec
@@ -0,0 +1,14 @@
+Summary: c
+Name: c
+Version: 1
+Release: 1
+License: x
+Group: x
+Url: x
+Requires: a
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/split-transactions/d.spec b/t/data/SPECS/split-transactions/d.spec
new file mode 100644
index 00000000..d608b35e
--- /dev/null
+++ b/t/data/SPECS/split-transactions/d.spec
@@ -0,0 +1,13 @@
+Summary: d
+Name: d
+Version: 1
+Release: 1
+License: x
+Group: x
+Url: x
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/superuser--split-transactions.t b/t/superuser--split-transactions.t
new file mode 100644
index 00000000..1f1c54b6
--- /dev/null
+++ b/t/superuser--split-transactions.t
@@ -0,0 +1,40 @@
+#!/usr/bin/perl
+
+# packages "a" and "b" require each other, and so must installed in same transaction
+# package "c" requires "a" and can be installed later on
+# package "d" has no deps and can be installed alone in its transaction, with no particular timing
+use strict;
+use lib '.', 't';
+use helper;
+use Expect;
+use urpm::util;
+use Test::More 'no_plan';
+
+need_root_and_prepare();
+
+my $name = 'split-transactions';
+urpmi_addmedia("$name $::pwd/media/$name");
+
+test_urpmi("--auto --split-level 1 c d", <<'EOF');
+Preparing...
+ 1/4: a
+ 2/4: b
+Preparing...
+ 3/4: c
+Preparing...
+ 4/4: d
+EOF
+check_installed_names('a', 'b', 'c', 'd');
+
+sub test_urpmi {
+ my ($para, $wanted) = @_;
+ my $urpmi = urpmi_cmd();
+ my $s = `$urpmi $para`;
+ print $s;
+
+ $s =~ s/\s*#{40}#*//g;
+ $s =~ s/^installing .*//gm;
+ $s =~ s/^\n//gm;
+
+ ok($s eq $wanted, "$wanted in $s");
+}