Commit | Line | Data |
30e302f8 |
1 | #!/usr/bin/perl |
30e302f8 |
2 | |
3 | use strict; |
7483b81c |
4 | use Test::More; |
30e302f8 |
5 | |
7483b81c |
6 | if (!eval { require Module::Signature; 1 }) { |
7 | plan skip_all => |
8 | "Next time around, consider installing Module::Signature, ". |
9 | "so you can verify the integrity of this distribution."; |
10 | } |
11 | elsif ( !-e 'SIGNATURE' ) { |
12 | plan skip_all => "SIGNATURE not found"; |
13 | } |
14 | elsif ( -s 'SIGNATURE' == 0 ) { |
15 | plan skip_all => "SIGNATURE file empty"; |
16 | } |
17 | elsif (!eval { require Socket; Socket::inet_aton('pgp.mit.edu') }) { |
18 | plan skip_all => "Cannot connect to the keyserver to check module ". |
19 | "signature"; |
30e302f8 |
20 | } |
7483b81c |
21 | else { |
22 | plan tests => 1; |
23 | } |
24 | |
25 | my $ret = Module::Signature::verify(); |
26 | SKIP: { |
27 | skip "Module::Signature cannot verify", 1 |
28 | if $ret eq Module::Signature::CANNOT_VERIFY(); |
30e302f8 |
29 | |
7483b81c |
30 | cmp_ok $ret, '==', Module::Signature::SIGNATURE_OK(), "Valid signature"; |
31 | } |