From 1649c8dbfa545e267393ffa68c20ff667fff4b47 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 3 Nov 2021 15:42:58 +0100 Subject: Skip mirrorlist tests if there's only one broken mirror such as on mga[1-6] --- Changes | 3 +++ t/superuser--mirrorlist.t | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/Changes b/Changes index fcb26e7a..3b127df4 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +- cpan_testers: + o Skip mirrorlist tests if there's only one broken mirror such as on mga[1-6] + Version 8.128 - 5 November 2022 - library: 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); + } +} -- cgit v1.2.1