]> git.michaelhowe.org Git - packages/a/afs-monitor.git/commitdiff
Add simple test suite infrastructure and test POD
authorRuss Allbery <rra@stanford.edu>
Thu, 10 Jan 2013 04:17:50 +0000 (20:17 -0800)
committerRuss Allbery <rra@stanford.edu>
Thu, 10 Jan 2013 04:17:50 +0000 (20:17 -0800)
Makefile
check_afs_bos
check_afs_quotas
check_afs_rxdebug
check_afs_space
check_afs_udebug
t/pod-spelling.t [new file with mode: 0755]
t/pod.t [new file with mode: 0755]

index 71e7760974792ad0f4f280da9ccb03c1b4d9ad10..721b33d42ae5c5b8c6c10664df485b726197f126 100644 (file)
--- 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/
index 3a368e35a342702789745846291b2eaa9801b604..10d303d68cb083c86181420c70a5076852f9935a 100755 (executable)
@@ -11,7 +11,7 @@ our $VERSION = '@VERSION@ @DATE@';
 #
 # Written by Russ Allbery <rra@stanford.edu>
 # Based on an earlier script by Neil Crellin <neilc@stanford.edu>
-# 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<bos> 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.
index 5e6dd096de27675a2e6832a03495d3a4e0b118f1..ab7ac64e267481ede3add4fd4f2927bb1e7e2439 100755 (executable)
@@ -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<check_afs_quotas> [B<-hV>] [B<-c> I<threshold>] [B<-w> I<threshold>]
 B<check_afs_quotas> is a Nagios plugin for checking free space in AFS
 volumes based on the allocated quota for the volume.  It uses either C<vos
 examine> or C<vos listvol> 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.
index 5434fd879fcdbbdf67ea3417bb0640a9e6219f5c..f6ebd574bd6abbf823401669683927c480d8c744 100755 (executable)
@@ -11,7 +11,7 @@ our $VERSION = '@VERSION@ @DATE@';
 #
 # Written by Quanah Gibson-Mount based on work by Neil Crellin
 # Updated by Russ Allbery <rra@stanford.edu>
-# 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.
index 0a490426cbdccac9b82726a3d78790c721b475e8..3b106b552e4694aae0a2a80feb9decee6e459261 100755 (executable)
@@ -10,7 +10,7 @@ our $VERSION = '@VERSION@ @DATE@';
 #
 # Written by Susan Feng <sfeng@stanford.edu>
 # Updated by Russ Allbery <rra@stanford.edu>
-# 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<check_afs_space> is a Nagios plugin for checking free space on AFS server
 partitions.  It uses C<vos partinfo> 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<vos partinfo> doesn't return within the timeout, B<check_afs_space>
@@ -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.
index df816c9d879d9bef4be6afc6083953cf16336b0b..cd2988498cfa4c0448574198b1b1c5c227d1c017 100755 (executable)
@@ -9,7 +9,7 @@ our $VERSION = '@VERSION@ @DATE@';
 # any of the servers don't believe there is a sync site.
 #
 # Written by Russ Allbery <rra@stanford.edu>
-# 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 <rra@stanford.edu>
 
 =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 (executable)
index 0000000..3f5b87b
--- /dev/null
@@ -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 <rra@stanford.edu>
+#
+# 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 (executable)
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 <rra@stanford.edu>
+#
+# 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);