From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.1 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLACK shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 9C0DC1F524; Thu, 29 Sep 2022 17:50:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1664473832; bh=8JZQyyEtcWOWJeQ7h4SH6miKOcM9l/iFuHBIO925Xcw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w4+KJCjG06r2wBTuHMf02IvCWYnNNID2V1kOSjgoRt58tXTIFCVjqJFsZOo+wIdgi lw30EHDd9pFzkiI98J66OpyvUbBzPOOwTn6cqI4VbbtKFCQYOZI8PbgZ3rsr8dzscK F05vwENsWpg5diIG6Outqj1xixvL3l12G+ZQJbgw= From: Eric Wong To: meta@public-inbox.org Cc: Konstantin Ryabitsev Subject: [PATCH 4/4] tests: no IPv6 on old Net::NNTP, Mail::IMAPClient, HTTP::Tiny Date: Thu, 29 Sep 2022 17:48:31 +0000 Message-Id: <20220929174831.2919939-5-e@80x24.org> In-Reply-To: <20220929174831.2919939-1-e@80x24.org> References: <20220929174831.2919939-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: The versions of these modules which ship with CentOS 7.x did not support IPv6 properly. --- lib/PublicInbox/TestCommon.pm | 9 +++++++++ t/extsearch.t | 4 ++-- t/nntpd.t | 3 +-- t/v2writable.t | 2 +- 4 files changed, 13 insertions(+), 5 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"; diff --git a/t/extsearch.t b/t/extsearch.t index 2d7375d6..6cbe5262 100644 --- a/t/extsearch.t +++ b/t/extsearch.t @@ -13,8 +13,6 @@ require PublicInbox::Search; use_ok 'PublicInbox::ExtSearch'; use_ok 'PublicInbox::ExtSearchIdx'; use_ok 'PublicInbox::OverIdx'; -my $sock = tcp_server(); -my $host_port = tcp_host_port($sock); my ($home, $for_destroy) = tmpdir(); local $ENV{HOME} = $home; mkdir "$home/.public-inbox" or BAIL_OUT $!; @@ -125,6 +123,8 @@ EOF SKIP: { require_mods(qw(Net::NNTP), 1); + my $sock = tcp_server(); + my $host_port = tcp_host_port($sock); my ($out, $err) = ("$home/nntpd.out.log", "$home/nntpd.err.log"); my $cmd = [ '-nntpd', '-W0', "--stdout=$out", "--stderr=$err" ]; my $td = start_script($cmd, undef, { 3 => $sock }); diff --git a/t/nntpd.t b/t/nntpd.t index 34e9e1b4..d352c3c1 100644 --- a/t/nntpd.t +++ b/t/nntpd.t @@ -2,10 +2,9 @@ # Copyright (C) all contributors # License: AGPL-3.0+ use strict; use v5.10.1; use PublicInbox::TestCommon; -require_mods(qw(DBD::SQLite)); +require_mods(qw(DBD::SQLite Net::NNTP)); use PublicInbox::Eml; use Socket qw(IPPROTO_TCP TCP_NODELAY); -use Net::NNTP; use Sys::Hostname; use POSIX qw(_exit); use Digest::SHA; diff --git a/t/v2writable.t b/t/v2writable.t index 477621e2..ad946338 100644 --- a/t/v2writable.t +++ b/t/v2writable.t @@ -149,7 +149,7 @@ SELECT COUNT(*) FROM over WHERE num > 0 } { - use Net::NNTP; + require_mods('Net::NNTP', 1); my $err = "$inboxdir/stderr.log"; my $out = "$inboxdir/stdout.log"; my $group = 'inbox.comp.test.v2writable';