summaryrefslogtreecommitdiffstats
path: root/t/superuser--README-urpmi.t
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-04-24 19:34:32 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-04-24 19:34:32 +0000
commit4df7583caa71a35d6d68c373fc0c62d1be6d955b (patch)
treebddf36169b314d82ff20036dea7e47fa4fec5bcd /t/superuser--README-urpmi.t
parent7a606ec3537b2f465f8e06e99b445c756bfcca8f (diff)
downloadurpmi-4df7583caa71a35d6d68c373fc0c62d1be6d955b.tar
urpmi-4df7583caa71a35d6d68c373fc0c62d1be6d955b.tar.gz
urpmi-4df7583caa71a35d6d68c373fc0c62d1be6d955b.tar.bz2
urpmi-4df7583caa71a35d6d68c373fc0c62d1be6d955b.tar.xz
urpmi-4df7583caa71a35d6d68c373fc0c62d1be6d955b.zip
re-sync after the big svn loss
Diffstat (limited to 't/superuser--README-urpmi.t')
-rw-r--r--t/superuser--README-urpmi.t52
1 files changed, 52 insertions, 0 deletions
diff --git a/t/superuser--README-urpmi.t b/t/superuser--README-urpmi.t
new file mode 100644
index 00000000..70633c9c
--- /dev/null
+++ b/t/superuser--README-urpmi.t
@@ -0,0 +1,52 @@
+#!/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 = 'README-urpmi';
+
+urpmi_addmedia("$medium_name $::pwd/media/$medium_name");
+
+test_a();
+test_b();
+test_c();
+test_d();
+
+sub test_a {
+ test_urpmi('a', 'installing/upgrading a');
+ check_installed_and_remove('a');
+}
+
+sub test_b {
+ system_("rpm --root $::pwd/root -i media/$medium_name/b-1-*.rpm");
+ test_urpmi('b', 'upgrading b');
+ check_installed_and_remove('b');
+}
+
+sub test_c {
+ test_urpmi('c', 'installing c');
+ check_installed_and_remove('c');
+}
+
+sub test_d {
+ test_urpmi('d', 'installing/upgrading d');
+ test_urpmi('d_', 'installing d_'); # what is the valid answer?
+ check_installed_and_remove('d_');
+}
+
+sub test_urpmi {
+ my ($para, $wanted) = @_;
+ my $urpmi = urpmi_cmd();
+ print "# $urpmi $para\n";
+ my $s = `$urpmi $para`;
+ print $s;
+ my ($msg) = $s =~ /\nMore information on package[^\n]*\n(.*?)\n-{70}/ms;
+
+ ok($msg eq $wanted, "wanted:$wanted, got:$msg");
+}