summaryrefslogtreecommitdiffstats
path: root/t/superuser--suggests.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/superuser--suggests.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/superuser--suggests.t')
-rw-r--r--t/superuser--suggests.t75
1 files changed, 75 insertions, 0 deletions
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');
+}