X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fhttpd-https.t;h=a2166ce60a0e48d9ac261a315780828151c2d20e;hb=af0b0fb7a454470a32c452119d0392e0dedb3fe1;hp=1d2e4d5c25e0aa51da150d5985808b9277865c1c;hpb=3c313f9034aac96182e2efdc2f92c40803626f32;p=public-inbox.git diff --git a/t/httpd-https.t b/t/httpd-https.t index 1d2e4d5c..a2166ce6 100644 --- a/t/httpd-https.t +++ b/t/httpd-https.t @@ -1,14 +1,12 @@ -# Copyright (C) 2019 all contributors +# Copyright (C) 2019-2021 all contributors # License: AGPL-3.0+ use strict; use warnings; use Test::More; use Socket qw(SOCK_STREAM IPPROTO_TCP SOL_SOCKET); +use PublicInbox::TestCommon; # IO::Poll is part of the standard library, but distros may split them off... -foreach my $mod (qw(IO::Socket::SSL IO::Poll)) { - eval "require $mod"; - plan skip_all => "$mod missing for $0" if $@; -} +require_mods(qw(IO::Socket::SSL IO::Poll Plack::Util)); my $cert = 'certs/server-cert.pem'; my $key = 'certs/server-key.pem'; unless (-r $key && -r $cert) { @@ -17,7 +15,6 @@ unless (-r $key && -r $cert) { } use_ok 'PublicInbox::TLS'; use_ok 'IO::Socket::SSL'; -use PublicInbox::TestCommon; my $psgi = "./t/httpd-corner.psgi"; my ($tmpdir, $for_destroy) = tmpdir(); my $err = "$tmpdir/stderr.log"; @@ -90,7 +87,7 @@ for my $args ( SKIP: { skip 'TCP_DEFER_ACCEPT is Linux-only', 2 if $^O ne 'linux'; - my $var = Socket::TCP_DEFER_ACCEPT(); + my $var = eval { Socket::TCP_DEFER_ACCEPT() } // 9; defined(my $x = getsockopt($https, IPPROTO_TCP, $var)) or die; ok(unpack('i', $x) > 0, 'TCP_DEFER_ACCEPT set on https'); };