summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/helper.pm16
-rw-r--r--t/superuser--mirrorlist.t13
2 files changed, 17 insertions, 12 deletions
diff --git a/t/helper.pm b/t/helper.pm
index 6057a825..8cfdb35d 100644
--- a/t/helper.pm
+++ b/t/helper.pm
@@ -2,7 +2,7 @@ package helper;
use Test::More;
use base 'Exporter';
-our @EXPORT = qw(need_root_and_prepare
+our @EXPORT = qw(need_root_and_prepare need_downloader
start_httpd httpd_port
urpmi_addmedia urpmi_removemedia urpmi_update
urpm_cmd run_urpm_cmd urpmi_cmd urpmi urpmi_partial test_urpmi_fail urpme
@@ -29,6 +29,20 @@ sub need_root_and_prepare() {
$ENV{LC_ALL} = 'C';
}
+sub need_downloader() {
+ 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;
+ }
+}
+
+
my $server_pid;
sub httpd_port() { 6969 }
sub start_httpd() {
diff --git a/t/superuser--mirrorlist.t b/t/superuser--mirrorlist.t
index 0a0d877a..3e064afd 100644
--- a/t/superuser--mirrorlist.t
+++ b/t/superuser--mirrorlist.t
@@ -5,20 +5,11 @@ 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();
+need_downloader();
+
urpmi_addmedia('--mirrorlist \$MIRRORLIST core media/core/release');
is(run_urpm_cmd('urpmq sed'), "sed\n");
urpmi_removemedia('core');