0-signature.t 735 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/perl
  2. use strict;
  3. print "1..1\n";
  4. if (!$ENV{TEST_SIGNATURE}) {
  5. print "ok 1 # skip set the environment variable TEST_SIGNATURE to enable this test\n";
  6. }
  7. elsif (!-s 'SIGNATURE') {
  8. print "ok 1 # skip No signature file found\n";
  9. }
  10. elsif (!eval { require Module::Signature; 1 }) {
  11. print "ok 1 # skip ",
  12. "Next time around, consider install Module::Signature, ",
  13. "so you can verify the integrity of this distribution.\n";
  14. }
  15. elsif (!eval { require Socket; Socket::inet_aton('pgp.mit.edu') }) {
  16. print "ok 1 # skip ",
  17. "Cannot connect to the keyserver\n";
  18. }
  19. else {
  20. (Module::Signature::verify() == Module::Signature::SIGNATURE_OK())
  21. or print "not ";
  22. print "ok 1 # Valid signature\n";
  23. }
  24. __END__