File: 00-signature.t

package info (click to toggle)
libdbd-pg-perl 1.49-2%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 680 kB
  • ctags: 381
  • sloc: perl: 3,921; ansic: 3,183; makefile: 99; sh: 22
file content (33 lines) | stat: -rw-r--r-- 825 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!perl -w

## Test that our SIGNATURE file is valid

use Test::More;
use strict;
$|=1;

if (!eval { require Module::Signature; 1 }) {
	plan skip_all => 
		"Please install Module::Signature so that you can verify ".
			"the integrity of this and other distributions.";
}
elsif ( !-e 'SIGNATURE' ) {
	plan skip_all => "SIGNATURE file was not found";
}
elsif ( -s 'SIGNATURE' == 0 ) {
	plan skip_all => "SIGNATURE file was empty";
}
elsif (!eval { require Socket; Socket::inet_aton('pgp.mit.edu') }) {
	plan skip_all => "Cannot connect to the keyserver to check module signature";
}
else {
	plan tests => 1;
}

my $ret = Module::Signature::verify();
SKIP: {
	skip "Module::Signature cannot verify", 1 
		if $ret eq Module::Signature::CANNOT_VERIFY();
	cmp_ok $ret, '==', Module::Signature::SIGNATURE_OK(), "Valid signature";
}