summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2021-11-03 15:42:58 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2022-12-10 14:11:08 +0100
commit1649c8dbfa545e267393ffa68c20ff667fff4b47 (patch)
treec0ffc99d0bfc3b23040f13f234116539047e7ce2 /t
parentfa689572df831565082fe78e17003f0b2d3f062e (diff)
downloadurpmi-1649c8dbfa545e267393ffa68c20ff667fff4b47.tar
urpmi-1649c8dbfa545e267393ffa68c20ff667fff4b47.tar.gz
urpmi-1649c8dbfa545e267393ffa68c20ff667fff4b47.tar.bz2
urpmi-1649c8dbfa545e267393ffa68c20ff667fff4b47.tar.xz
urpmi-1649c8dbfa545e267393ffa68c20ff667fff4b47.zip
Skip mirrorlist tests if there's only one broken mirror
such as on mga[1-6]
Diffstat (limited to 't')
-rw-r--r--t/superuser--mirrorlist.t12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/superuser--mirrorlist.t b/t/superuser--mirrorlist.t
index cc3a8be6..b1d9deb3 100644
--- a/t/superuser--mirrorlist.t
+++ b/t/superuser--mirrorlist.t
@@ -16,6 +16,8 @@ BEGIN {
BEGIN { use_ok 'urpm::cfg' }
+need_one_valid_mirror();
+
need_root_and_prepare();
need_downloader();
@@ -32,3 +34,13 @@ if ($ENV{AUTHOR_TESTING}) {
is(`rpm -q --qf '%{name}' --root $::pwd/root $name`, $name, "$name is installed");
}
urpmi_removemedia('-a');
+
+sub need_one_valid_mirror() {
+ require urpm;
+ require urpm::mirrors;
+ my @mirrors = urpm::mirrors::_list(urpm->new, urpm::mirrors::_MIRRORLIST());
+ if ($#mirrors == 0 && $mirrors[0]->{url} =~ m!mageia.fis.unb.br/distrib/!) {
+ warn ">> Only one unusable mirrors\n";
+ exit(0);
+ }
+}