X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fhttpd-https.t;h=ee5ced0f6df9dd9f7aee8f320062e9fcb22afffe;hb=9689c65f42c0acc9021953b29ce55730c4cd841d;hp=de74c20ee331e3b61cfc0db6da4100f5d068e97e;hpb=ad6f26f3b9f0e428020d05667987556f8fcbec2f;p=public-inbox.git diff --git a/t/httpd-https.t b/t/httpd-https.t index de74c20e..ee5ced0f 100644 --- a/t/httpd-https.t +++ b/t/httpd-https.t @@ -4,11 +4,9 @@ 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'; -require './t/common.perl'; 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'); };