Skip to content

Commit

Permalink
update xt\00-sign to try multiple keyservers
Browse files Browse the repository at this point in the history
  • Loading branch information
pryrt committed Sep 11, 2021
1 parent 11917aa commit a31fef6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion xt/00-sign.t
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,23 @@ 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";
}
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
Expand Down

0 comments on commit a31fef6

Please sign in to comment.