From: Russ Allbery Date: Thu, 10 Jan 2013 04:17:50 +0000 (-0800) Subject: Add simple test suite infrastructure and test POD X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=e3c714294a41b0b30a4f618068e6e364ba40a0cc;p=packages%2Fa%2Fafs-monitor.git Add simple test suite infrastructure and test POD --- diff --git a/Makefile b/Makefile index 71e7760..721b33d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ -# This Makefile contains only a dist rule to generate a distribution -# tarball, and isn't included in the distribution. The software doesn't -# need any compilation, so there are no other rules. +# This Makefile contains only a dist rule to generate a distribution tarball +# and a check rule for convenience, and isn't included in the distribution. +# The software doesn't need any compilation, so there are no other rules. VERSION := $(shell grep '^afs-monitor' NEWS | head -1 | cut -d' ' -f 2) DATE := $(shell grep '^afs-monitor' NEWS | head -1 | cut -d' ' -f 3) @@ -23,3 +23,6 @@ dist: tar cf afs-monitor-$(VERSION).tar afs-monitor-$(VERSION) gzip -9 afs-monitor-$(VERSION).tar rm -r afs-monitor-$(VERSION) + +check test: + prove t/ diff --git a/check_afs_bos b/check_afs_bos index 3a368e3..10d303d 100755 --- a/check_afs_bos +++ b/check_afs_bos @@ -11,7 +11,7 @@ our $VERSION = '@VERSION@ @DATE@'; # # Written by Russ Allbery # Based on an earlier script by Neil Crellin -# Copyright 2003, 2004, 2010 +# Copyright 2003, 2004, 2010, 2013 # The Board of Trustees of the Leland Stanford Junior University # # This program is free software; you may redistribute it and/or modify it @@ -166,6 +166,9 @@ exit 0; # Documentation ############################################################################## +=for stopwords +AFS Crellin Nagios afs-monitor bos bosserver -hV salvager util + =head1 NAME check_afs_bos - Monitor AFS bos output for problems in Nagios @@ -193,7 +196,7 @@ restarted if it happens to be up and running normally each time the probe runs; it doesn't pay any attention to the last start time, the last error exit status, the presence of core files, and the like. It mostly just looks for the "running normally" part of the B output and makes sure -the auxilliary status is also "running normally" for a file server +the auxiliary status is also "running normally" for a file server process. =head1 OPTIONS @@ -260,8 +263,8 @@ output, instead just scanning it for acceptable lines. =head1 COPYRIGHT AND LICENSE -Copyright 2003, 2004, 2010 The Board of Trustees of the Leland Stanford -Junior University. +Copyright 2003, 2004, 2010, 2013 The Board of Trustees of the Leland +Stanford Junior University This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. diff --git a/check_afs_quotas b/check_afs_quotas index 5e6dd09..ab7ac64 100755 --- a/check_afs_quotas +++ b/check_afs_quotas @@ -238,6 +238,9 @@ if (defined ($volume)) { # Documentation ############################################################################## +=for stopwords +AFS Crellin Nagios Rader afs-monitor -hV util -vv + =head1 NAME check_afs_quotas - Monitor AFS quota usage under Nagios @@ -252,7 +255,7 @@ B [B<-hV>] [B<-c> I] [B<-w> I] B is a Nagios plugin for checking free space in AFS volumes based on the allocated quota for the volume. It uses either C or C to obtain the quota and current usage for -either a single volume or all volumes on a server or server parittion and +either a single volume or all volumes on a server or server partition and will return an alert if the percentage of quota used is over a threshold. By default, it returns a critical error if the used quota is over 90% and a warning if it is over 85% (changeable with the B<-c> and B<-w> options). @@ -358,8 +361,8 @@ Written by Russ Allbery based on a similar script by Steve Rader. =head1 COPYRIGHT AND LICENSE -Copyright 2010 The Board of Trustees of the Leland Stanford Junior -University. +Copyright 2010, 2013 The Board of Trustees of the Leland Stanford Junior +University This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. diff --git a/check_afs_rxdebug b/check_afs_rxdebug index 5434fd8..f6ebd57 100755 --- a/check_afs_rxdebug +++ b/check_afs_rxdebug @@ -11,7 +11,7 @@ our $VERSION = '@VERSION@ @DATE@'; # # Written by Quanah Gibson-Mount based on work by Neil Crellin # Updated by Russ Allbery -# Copyright 2003, 2004, 2005, 2010 +# Copyright 2003, 2004, 2005, 2010, 2013 # The Board of Trustees of the Leland Stanford Junior University # # This program is free software; you may redistribute it and/or modify it @@ -129,6 +129,9 @@ if ($blocked >= $CRITICAL) { # Documentation ############################################################################## +=for stopwords +AFS Crellin Nagios Quanah afs-monitor -hV rxdebug util + =head1 NAME check_afs_rxdebug - Check AFS servers for blocked connections in Nagios @@ -226,8 +229,8 @@ options and to use a more uniform coding style. =head1 COPYRIGHT AND LICENSE -Copyright 2003, 2004, 2005, 2010 The Board of Trustees of the Leland -Stanford Junior University. +Copyright 2003, 2004, 2005, 2010, 2013 The Board of Trustees of the Leland +Stanford Junior University This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. diff --git a/check_afs_space b/check_afs_space index 0a49042..3b106b5 100755 --- a/check_afs_space +++ b/check_afs_space @@ -10,7 +10,7 @@ our $VERSION = '@VERSION@ @DATE@'; # # Written by Susan Feng # Updated by Russ Allbery -# Copyright 2003, 2004, 2010 +# Copyright 2003, 2004, 2010, 2013 # The Board of Trustees of the Leland Stanford Junior University # # This program is free software; you may redistribute it and/or modify it @@ -172,6 +172,9 @@ if (@critical) { # Documentation ############################################################################## +=for stopwords +AFS Feng Nagios Quanah Rader afs-monitor -dhV mon --perfdata util -vv + =head1 NAME check_afs_space - Monitor AFS disk space usage under Nagios @@ -187,7 +190,7 @@ B is a Nagios plugin for checking free space on AFS server partitions. It uses C to obtain the free space on the partitions on an AFS server and will return an alert if the percentage of used space exceeds a threshold. By default, it returns a critical error -if the used space is over 90% and a warning if it is over 85% (changaable +if the used space is over 90% and a warning if it is over 85% (changeable with the B<-c> and B<-w> options). If C doesn't return within the timeout, B @@ -298,8 +301,8 @@ work by Steve Rader. =head1 COPYRIGHT AND LICENSE -Copyright 2003, 2004, 2010 The Board of Trustees of the Leland Stanford -Junior University. +Copyright 2003, 2004, 2010, 2013 The Board of Trustees of the Leland +Stanford Junior University This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. diff --git a/check_afs_udebug b/check_afs_udebug index df816c9..cd29884 100755 --- a/check_afs_udebug +++ b/check_afs_udebug @@ -9,7 +9,7 @@ our $VERSION = '@VERSION@ @DATE@'; # any of the servers don't believe there is a sync site. # # Written by Russ Allbery -# Copyright 2004, 2010 +# Copyright 2004, 2010, 2013 # The Board of Trustees of the Leland Stanford Junior University # # This program is free software; you may redistribute it and/or modify it @@ -117,6 +117,9 @@ if ($issync && !$recovery) { # Documentation ############################################################################## +=for stopwords +AFS Nagios Ubik afs-monitor -hV kaserver ptserver udebug util vlserver + =head1 NAME check_afs_udebug - Check AFS servers for blocked connections in Nagios @@ -206,8 +209,8 @@ Russ Allbery =head1 COPYRIGHT AND LICENSE -Copyright 2004, 2010 The Board of Trustees of the Leland Stanford Junior -University. +Copyright 2004, 2010, 2013 The Board of Trustees of the Leland Stanford +Junior University This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. diff --git a/t/pod-spelling.t b/t/pod-spelling.t new file mode 100755 index 0000000..3f5b87b --- /dev/null +++ b/t/pod-spelling.t @@ -0,0 +1,36 @@ +#!/usr/bin/perl +# +# Check for spelling errors in POD documentation. +# +# Checks all POD files in a Perl distribution using Test::Spelling. This test +# is disabled unless RRA_MAINTAINER_TESTS is set, since spelling dictionaries +# vary too much between environments. +# +# Written by Russ Allbery +# +# The authors hereby relinquish any claim to any copyright that they may have +# in this work, whether granted under contract or by operation of law or +# international treaty, and hereby commit to the public, at large, that they +# shall not, at any time in the future, seek to enforce any copyright in this +# work against any person or entity, or prevent any person or entity from +# copying, publishing, distributing or creating derivative works of this work. + +use strict; +use warnings; + +use Test::More; + +# Skip tests unless we're running the test suite in maintainer mode. +if (!$ENV{RRA_MAINTAINER_TESTS}) { + plan skip_all => 'Spelling tests only run for maintainer'; +} + +# Skip tests if Test::Spelling is not installed. +if (!eval { require Test::Spelling }) { + plan skip_all => 'Test::Spelling required to test POD spelling'; +} +Test::Spelling->import; + +# Check all POD in the distribution. +my @files = glob 'check_afs_*'; +all_pod_files_spelling_ok(@files); diff --git a/t/pod.t b/t/pod.t new file mode 100755 index 0000000..87a4c89 --- /dev/null +++ b/t/pod.t @@ -0,0 +1,27 @@ +#!/usr/bin/perl +# +# Check all POD documents for POD formatting errors. +# +# Written by Russ Allbery +# +# The authors hereby relinquish any claim to any copyright that they may have +# in this work, whether granted under contract or by operation of law or +# international treaty, and hereby commit to the public, at large, that they +# shall not, at any time in the future, seek to enforce any copyright in this +# work against any person or entity, or prevent any person or entity from +# copying, publishing, distributing or creating derivative works of this work. + +use strict; +use warnings; + +use Test::More; + +# Skip tests if Test::Pod is not installed. +if (!eval { require Test::Pod }) { + plan skip_all => 'Test::Pod required to test POD syntax'; +} +Test::Pod->import; + +# Check all POD in the distribution. +my @files = glob 'check_afs_*'; +all_pod_files_ok(@files);