summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-01-16 14:48:11 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-01-16 14:48:11 +0000
commit38e54730b01e3b10358bd0c82b575a2945cb0008 (patch)
tree45e0e1f8ca4d7575b615088dc76eed2a7352c98e /t
parent72b0fc7fd497dd094845e2bbd235cab016f9b229 (diff)
downloadurpmi-38e54730b01e3b10358bd0c82b575a2945cb0008.tar
urpmi-38e54730b01e3b10358bd0c82b575a2945cb0008.tar.gz
urpmi-38e54730b01e3b10358bd0c82b575a2945cb0008.tar.bz2
urpmi-38e54730b01e3b10358bd0c82b575a2945cb0008.tar.xz
urpmi-38e54730b01e3b10358bd0c82b575a2945cb0008.zip
test urpmq/urpmf correctly use info.xml.lzma with exotic medium name
Diffstat (limited to 't')
-rw-r--r--t/superuser--http.t38
1 files changed, 37 insertions, 1 deletions
diff --git a/t/superuser--http.t b/t/superuser--http.t
index 85ef1d1c..cd934242 100644
--- a/t/superuser--http.t
+++ b/t/superuser--http.t
@@ -11,10 +11,46 @@ my $url = start_httpd();
my $name = 'various';
-foreach my $medium_name ('various', 'various_no_subdir') {
+test($_) foreach 'various', 'various_no_subdir';
+test_exotic_medium_name();
+
+sub test {
+ my ($medium_name) = @_;
+
urpmi_addmedia("$medium_name $url/media/$medium_name");
urpmi($name);
is(`rpm -qa --root $::pwd/root`, "$name-1-1\n");
urpme($name);
urpmi_removemedia($medium_name);
}
+
+sub test_exotic_medium_name {
+ my $medium_name = 'the medium (+name+)';
+ urpmi_addmedia("'$medium_name' $url/media/various");
+
+ # test urpmf/urpmq using synthesis
+ is(run_urpm_cmd('urpmf --summary .'), "various:various\n");
+ is(run_urpm_cmd('urpmq --summary various'), "various : various ( 1-1 )\n");
+
+ # test urpmf/urpmq using info.xml.lzma as user
+ mkdir 'root/tmp'; chmod 0777, 'root/tmp';
+ is(run_urpm_cmd_as_user('urpmf --sourcerpm .'), "various:various-1-1.src.rpm\n");
+ is(run_urpm_cmd_as_user('urpmq --sourcerpm various'), "various: various-1-1.src.rpm\n");
+
+ # test urpmf/urpmq using info.xml.lzma as root
+ is(run_urpm_cmd('urpmf --sourcerpm .'), "various:various-1-1.src.rpm\n");
+ is(run_urpm_cmd('urpmq --sourcerpm various'), "various: various-1-1.src.rpm\n");
+
+ urpmi($name);
+ is(`rpm -qa --root $::pwd/root`, "$name-1-1\n");
+ urpme($name);
+
+ urpmi_removemedia("'$medium_name'");
+}
+
+sub run_urpm_cmd_as_user {
+ my ($cmd) = @_;
+ my $full_cmd = "su nobody -c '" . urpm_cmd($cmd). "'";
+ warn "# $full_cmd\n";
+ `$full_cmd`;
+}