diff --git a/xt/00-sign.t b/xt/00-sign.t index 7a29221..b014c43 100644 --- a/xt/00-sign.t +++ b/xt/00-sign.t @@ -17,7 +17,7 @@ elsif ( !-e 'SIGNATURE' ) { elsif ( -s 'SIGNATURE' == 0 ) { plan skip_all => "SIGNATURE file empty"; } -elsif (!eval { require Socket; Socket::inet_aton('pool.sks-keyservers.net') }) { +elsif (!eval { find_keyserver(); 1; }) { plan skip_all => "Cannot connect to the keyserver to check module ". "signature"; } @@ -25,6 +25,15 @@ else { plan tests => 1; } +sub find_keyserver { + require Socket; + for my $server ( 'pool.sks-keyservers.net' , 'hkps.pool.sks-keyservers.net', 'pgp.mit.edu') { + next unless Socket::inet_aton( $server ); + $Module::Signature::KeyServer = $server; + last; + } +} + my $ret = Module::Signature::verify(); SKIP: { skip "Module::Signature cannot verify", 1