summaryrefslogtreecommitdiffstats
path: root/t/superuser--mirrorlist.t
blob: 0a0d877abc98e6862f314d8b3768518497d93826 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/perl

use strict;
use lib '.', 't';
use helper;
use Test::More 'no_plan';
BEGIN { use_ok 'urpm::cfg' }
my @dl_helpers = qw(wget curl prozilla aria2c);
my $found;
foreach (@dl_helpers) {
	-e "/bin/$_" and $found = 1;
}
if (!$found) {
        warn "SKIPing because we're missing a downloader. We need one of wget∕curl/prozilla/aria2c";
	#plan skip_all => "*BSD fails those";
	exit 0;
}


need_root_and_prepare();

urpmi_addmedia('--mirrorlist \$MIRRORLIST core media/core/release');
is(run_urpm_cmd('urpmq sed'), "sed\n");
urpmi_removemedia('core');

urpmi_addmedia('--distrib --mirrorlist \$MIRRORLIST');
is(run_urpm_cmd('urpmq sed'), "sed\n");
urpmi_removemedia('-a');