about summary refs log tree commit homepage
path: root/lib/PublicInbox/TestCommon.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-09-29 17:48:31 +0000
committerEric Wong <e@80x24.org>2022-09-29 18:05:57 +0000
commit6da44a6151dfb59147d8a114548de1951909f9d1 (patch)
tree0f43c7545392f9acd6c460bb7418bd71bc8f4805 /lib/PublicInbox/TestCommon.pm
parent33f2cbeeca73c35dffcbfba53a614c0516f55cdc (diff)
downloadpublic-inbox-6da44a6151dfb59147d8a114548de1951909f9d1.tar.gz
The versions of these modules which ship with CentOS 7.x did not
support IPv6 properly.
Diffstat (limited to 'lib/PublicInbox/TestCommon.pm')
-rw-r--r--lib/PublicInbox/TestCommon.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm
index 55d82fc0..333791b4 100644
--- a/lib/PublicInbox/TestCommon.pm
+++ b/lib/PublicInbox/TestCommon.pm
@@ -117,6 +117,12 @@ sub require_git ($;$) {
         1;
 }
 
+my %IPv6_VERSION = (
+        'Net::NNTP' => 3.00,
+        'Mail::IMAPClient' => 3.40,
+        'HTTP::Tiny' => 0.042,
+);
+
 sub require_mods {
         my @mods = @_;
         my $maybe = pop @mods if $mods[-1] =~ /\A[0-9]+\z/;
@@ -167,6 +173,9 @@ sub require_mods {
                                 !eval{ IO::Socket::SSL->VERSION(2.007); 1 }) {
                         push @need, $@;
                 }
+                if (defined(my $v = $IPv6_VERSION{$mod})) {
+                        $ENV{TEST_IPV4_ONLY} = 1 if !eval { $mod->VERSION($v) };
+                }
         }
         return unless @need;
         my $m = join(', ', @need)." missing for $0";