Upgrade to Test::Simple 0.60
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / 00signature.t
CommitLineData
30e302f8 1#!/usr/bin/perl
30e302f8 2
3use strict;
7483b81c 4use Test::More;
30e302f8 5
7483b81c 6if (!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}
11elsif ( !-e 'SIGNATURE' ) {
12 plan skip_all => "SIGNATURE not found";
13}
14elsif ( -s 'SIGNATURE' == 0 ) {
15 plan skip_all => "SIGNATURE file empty";
16}
17elsif (!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 21else {
22 plan tests => 1;
23}
24
25my $ret = Module::Signature::verify();
26SKIP: {
27 skip "Module::Signature cannot verify", 1
5143c659 28 if $ret eq Module::Signature::CANNOT_VERIFY() or
29 $ret eq Module::Signature::CIPHER_UNKNOWN();
30e302f8 30
7483b81c 31 cmp_ok $ret, '==', Module::Signature::SIGNATURE_OK(), "Valid signature";
32}
5143c659 33