diff options
author | Greg Sabino Mullane | 2009-05-03 17:08:46 +0000 |
---|---|---|
committer | Greg Sabino Mullane | 2009-05-03 17:08:46 +0000 |
commit | 6407539a72fed483853a1c8b85ed30d83ad98e87 (patch) | |
tree | b16e6ade7beaa4c8b55bb9d4fdd411fd4d7c16f4 | |
parent | 8be996184a1cc1885148d4cf69255949b7bdebd3 (diff) |
Support both signature styles.
-rw-r--r-- | Makefile.PL | 5 | ||||
-rw-r--r-- | t/00_signature.t | 23 |
2 files changed, 26 insertions, 2 deletions
diff --git a/Makefile.PL b/Makefile.PL index 3190c482d..828c63870 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -53,7 +53,7 @@ my %opts = NO_META => 1, NORECURS => 1, MAN1PODS => {}, - clean => { FILES => 'test_database_check_postgres/', '/tmp/cptesting_socket' }, + clean => { FILES => 'test_database_check_postgres/ /tmp/cptesting_socket' }, ); { @@ -61,6 +61,9 @@ my %opts = sub clean { my $string = shift->SUPER::clean(@_); $string =~ s{\t}{\tperl t/99_cleanup\.t\n\t}; + $string .= qq{\nsignature_asc : \n}; + $string .= qq{\t@ gpg --yes -ba check_postgres.pl\n}; + $string .= qq{\t@ gpg --verify check_postgres.pl.asc\n}; return $string; } } diff --git a/t/00_signature.t b/t/00_signature.t index 358861407..74fbe7aaa 100644 --- a/t/00_signature.t +++ b/t/00_signature.t @@ -13,7 +13,7 @@ my $sigfile = 'check_postgres.pl.asc'; if (!$ENV{TEST_SIGNATURE} and !$ENV{TEST_EVERYTHING}) { plan skip_all => 'Set the environment variable TEST_SIGNATURE to enable this test'; } -plan tests => 1; +plan tests => 2; SKIP: { if ( !-e $sigfile ) { @@ -32,3 +32,24 @@ SKIP: { } } } + +SKIP: { + if (!eval { require Module::Signature; 1 }) { + skip ('Must have Module::Signature to test SIGNATURE file', 1); + } + elsif ( !-e 'SIGNATURE' ) { + fail ('SIGNATURE file was not found'); + } + elsif ( ! -s 'SIGNATURE') { + fail ('SIGNATURE file was empty'); + } + else { + my $ret = Module::Signature::verify(); + if ($ret eq Module::Signature::SIGNATURE_OK()) { + pass ('Valid SIGNATURE file'); + } + else { + fail ('Invalid SIGNATURE file'); + } + } +} |