summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-08-09 14:04:25 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-08-09 14:04:25 +0000
commitdc5524b0906cf3111c49cd16396b22668b6d7ee2 (patch)
tree9e1774b16d2f4ce3b4f764b4ba25853e9db2b526 /t
parentb07ef84b0bef0bb8ae4a2bea7bd7211fcceffe96 (diff)
downloadurpmi-dc5524b0906cf3111c49cd16396b22668b6d7ee2.tar
urpmi-dc5524b0906cf3111c49cd16396b22668b6d7ee2.tar.gz
urpmi-dc5524b0906cf3111c49cd16396b22668b6d7ee2.tar.bz2
urpmi-dc5524b0906cf3111c49cd16396b22668b6d7ee2.tar.xz
urpmi-dc5524b0906cf3111c49cd16396b22668b6d7ee2.zip
- urpmi
o explicit error when using "urpmi ---install-src" as user with remote media o add support for "suggests": a newly suggested package is installed as if required, but one can remove it afterwards, or use --no-suggests - urpmf o handle --suggests all the work is done in perl-URPM 1.69
Diffstat (limited to 't')
-rw-r--r--t/data/SPECS/suggests/a-1.spec14
-rw-r--r--t/data/SPECS/suggests/a-2.spec15
-rw-r--r--t/data/SPECS/suggests/a-3.spec14
-rw-r--r--t/data/SPECS/suggests/b.spec14
-rw-r--r--t/data/SPECS/suggests/bb.spec14
-rw-r--r--t/data/SPECS/suggests/c.spec14
-rw-r--r--t/data/SPECS/suggests/cc.spec14
-rw-r--r--t/data/SPECS/suggests/suggested_b.spec13
-rw-r--r--t/data/SPECS/suggests/suggested_c.spec13
-rw-r--r--t/data/SPECS/suggests/with-invalid.spec14
-rw-r--r--t/superuser--suggests.t75
11 files changed, 214 insertions, 0 deletions
diff --git a/t/data/SPECS/suggests/a-1.spec b/t/data/SPECS/suggests/a-1.spec
new file mode 100644
index 00000000..b31038b9
--- /dev/null
+++ b/t/data/SPECS/suggests/a-1.spec
@@ -0,0 +1,14 @@
+Summary: a
+Name: a
+Version: 1
+Release: 1
+License: x
+Group: x
+Url: x
+Suggests: suggested_b
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/suggests/a-2.spec b/t/data/SPECS/suggests/a-2.spec
new file mode 100644
index 00000000..2431bd9c
--- /dev/null
+++ b/t/data/SPECS/suggests/a-2.spec
@@ -0,0 +1,15 @@
+Summary: a
+Name: a
+Version: 2
+Release: 1
+License: x
+Group: x
+Url: x
+Suggests: suggested_b
+Suggests: suggested_c
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/suggests/a-3.spec b/t/data/SPECS/suggests/a-3.spec
new file mode 100644
index 00000000..43d51a36
--- /dev/null
+++ b/t/data/SPECS/suggests/a-3.spec
@@ -0,0 +1,14 @@
+Summary: a
+Name: a
+Version: 3
+Release: 1
+License: x
+Group: x
+Url: x
+Suggests: suggested_b
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/suggests/b.spec b/t/data/SPECS/suggests/b.spec
new file mode 100644
index 00000000..da1ee869
--- /dev/null
+++ b/t/data/SPECS/suggests/b.spec
@@ -0,0 +1,14 @@
+Summary: b
+Name: b
+Version: 1
+Release: 1
+License: x
+Group: x
+Url: x
+Requires: bb
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/suggests/bb.spec b/t/data/SPECS/suggests/bb.spec
new file mode 100644
index 00000000..4319c755
--- /dev/null
+++ b/t/data/SPECS/suggests/bb.spec
@@ -0,0 +1,14 @@
+Summary: bb
+Name: bb
+Version: 1
+Release: 1
+License: x
+Group: x
+Url: x
+Suggests: suggested_b
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/suggests/c.spec b/t/data/SPECS/suggests/c.spec
new file mode 100644
index 00000000..96e34787
--- /dev/null
+++ b/t/data/SPECS/suggests/c.spec
@@ -0,0 +1,14 @@
+Summary: c
+Name: c
+Version: 1
+Release: 1
+License: x
+Group: x
+Url: x
+Suggests: cc
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/suggests/cc.spec b/t/data/SPECS/suggests/cc.spec
new file mode 100644
index 00000000..170cffb9
--- /dev/null
+++ b/t/data/SPECS/suggests/cc.spec
@@ -0,0 +1,14 @@
+Summary: cc
+Name: cc
+Version: 1
+Release: 1
+License: x
+Group: x
+Url: x
+Requires: b
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/suggests/suggested_b.spec b/t/data/SPECS/suggests/suggested_b.spec
new file mode 100644
index 00000000..11c48863
--- /dev/null
+++ b/t/data/SPECS/suggests/suggested_b.spec
@@ -0,0 +1,13 @@
+Summary: suggested_b
+Name: suggested_b
+Version: 1
+Release: 1
+License: x
+Group: x
+Url: x
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/suggests/suggested_c.spec b/t/data/SPECS/suggests/suggested_c.spec
new file mode 100644
index 00000000..1c721384
--- /dev/null
+++ b/t/data/SPECS/suggests/suggested_c.spec
@@ -0,0 +1,13 @@
+Summary: suggested_c
+Name: suggested_c
+Version: 1
+Release: 1
+License: x
+Group: x
+Url: x
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/data/SPECS/suggests/with-invalid.spec b/t/data/SPECS/suggests/with-invalid.spec
new file mode 100644
index 00000000..781f7988
--- /dev/null
+++ b/t/data/SPECS/suggests/with-invalid.spec
@@ -0,0 +1,14 @@
+Summary: x
+Name: with-invalid
+Version: 1
+Release: 1
+License: x
+Group: x
+Url: x
+Suggests: invalid
+BuildRoot: %{_tmppath}/%{name}
+
+%description
+x
+
+%files
diff --git a/t/superuser--suggests.t b/t/superuser--suggests.t
new file mode 100644
index 00000000..b3e897cc
--- /dev/null
+++ b/t/superuser--suggests.t
@@ -0,0 +1,75 @@
+#!/usr/bin/perl
+
+use strict;
+use lib '.', 't';
+use helper;
+use Expect;
+use urpm::util;
+use Test::More 'no_plan';
+
+need_root_and_prepare();
+
+my $medium_name = 'suggests';
+
+urpmi_addmedia("$medium_name $::pwd/media/$medium_name");
+
+test_b();
+test_c();
+test_invalid();
+test_upgrade();
+
+sub test_b {
+ test('b', ['bb'], ['suggested_b']);
+ test_2('bb', [], 'b', [], []);
+}
+
+sub test_c {
+ test('c', [], ['cc', 'b', 'bb', 'suggested_b']);
+ test_2('b', ['bb'], 'c', [], ['cc']);
+ test_2('bb', [], 'c', [], ['cc', 'b']);
+}
+
+sub test_invalid {
+ urpmi("--auto with-invalid");
+ check_installed_and_remove('with-invalid');
+}
+
+sub test {
+ my ($name, $required, $suggested) = @_;
+ urpmi("--no-suggests --auto $name");
+ check_installed_and_remove($name, @$required);
+ urpmi("--auto $name");
+ check_installed_names($name, @$required, @$suggested);
+ urpme("$name @$required");
+ check_installed_and_remove(@$suggested);
+}
+
+sub test_2 {
+ my ($name1, $required1, $name2, $required2, $suggested2) = @_;
+
+ urpmi("--no-suggests --auto $name1");
+ check_installed_names($name1, @$required1);
+ urpmi("--no-suggests --auto $name2");
+ check_installed_and_remove($name1, @$required1, $name2, @$required2);
+
+ urpmi("--no-suggests --auto $name1");
+ check_installed_names($name1, @$required1);
+ urpmi("--auto $name2");
+ check_installed_and_remove($name1, @$required1, $name2, @$required2, @$suggested2);
+}
+
+sub test_upgrade {
+ urpmi(" --auto a-1");
+ check_installed_names('a', 'suggested_b');
+ urpmi(" --auto a-2");
+ check_installed_names('a', 'suggested_b', 'suggested_c');
+ urpmi(" --auto a-3");
+ check_installed_and_remove('a', 'suggested_b', 'suggested_c');
+
+ urpmi("--no-suggests --auto a-1");
+ check_installed_names('a');
+ urpmi(" --auto a-2");
+ check_installed_names('a', 'suggested_c');
+ urpmi(" --auto a-3");
+ check_installed_and_remove('a', 'suggested_c');
+}