summaryrefslogtreecommitdiffstats
path: root/t/npg03
diff options
context:
space:
mode:
authorGavin Carr <gonzai@users.sourceforge.net>2007-03-21 00:52:56 +0000
committerGavin Carr <gonzai@users.sourceforge.net>2007-03-21 00:52:56 +0000
commitdc31f1cd3841d486e920e59ce42e888ca94e4289 (patch)
tree14bcc87e8349b99b01a649f27429690321fc21f9 /t/npg03
parentc6cbf050974c8f6642fa1d7bde309710b66cbfa0 (diff)
downloadmonitoring-plugin-perl-dc31f1cd3841d486e920e59ce42e888ca94e4289.tar.gz
Finished initial --extra-opts support; added Getopt spec-to-help and multiline help support.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1643 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 't/npg03')
-rw-r--r--t/npg03/README18
-rw-r--r--t/npg03/expected/00_noextra1
-rw-r--r--t/npg03/expected/05_disk11
-rw-r--r--t/npg03/expected/05_disk21
-rw-r--r--t/npg03/expected/05_disk31
-rw-r--r--t/npg03/expected/05_disk41
-rw-r--r--t/npg03/expected/05_disk51
-rw-r--r--t/npg03/expected/05_disk61
-rw-r--r--t/npg03/expected/05_singlechar11
-rw-r--r--t/npg03/expected/06_singlechar21
-rw-r--r--t/npg03/expected/07_singlechar31
-rw-r--r--t/npg03/input/00_basic2
-rw-r--r--t/npg03/input/00_noextra1
-rw-r--r--t/npg03/input/01_override12
-rw-r--r--t/npg03/input/02_override22
-rw-r--r--t/npg03/input/05_disk11
-rw-r--r--t/npg03/input/05_disk21
-rw-r--r--t/npg03/input/05_disk31
-rw-r--r--t/npg03/input/05_disk41
-rw-r--r--t/npg03/input/05_disk51
-rw-r--r--t/npg03/input/05_disk61
-rw-r--r--t/npg03/input/05_singlechar11
-rw-r--r--t/npg03/input/06_singlechar21
-rw-r--r--t/npg03/input/07_singlechar31
-rw-r--r--t/npg03/input/09_funnystuff2
-rw-r--r--t/npg03/input/13_nosection_explicit_dies2
-rw-r--r--t/npg03/input/14_badsection_dies2
-rw-r--r--t/npg03/plugins.ini (renamed from t/npg03/plugins.cfg)9
28 files changed, 39 insertions, 20 deletions
diff --git a/t/npg03/README b/t/npg03/README
index a19f263..3dbdaf8 100644
--- a/t/npg03/README
+++ b/t/npg03/README
@@ -1,13 +1,15 @@
1Nagios-Plugin-Getopt-03.t automatically tests all cases defined in the 'input' directory 1Nagios-Plugin-Getopt-03.t automatically tests all cases defined in
2and expects the output to match the corresponding file in the 'expected' directory. To 2the 'input' directory and expects the output to match the
3define a new test case, just create a new file in the 'input' directory containing the 3corresponding file in the 'expected' directory. To define a new test
4input command line, and a corresponding file in the 'expected' directory containing 4case, just create a new file in the 'input' directory containing the
5what you think the expanded command line should be. Note that this expansion is normalised 5input command line, and a corresponding file in the 'expected'
6as follows: 6directory containing what you think the expanded command line should
7be. Note that this expansion is normalised as follows:
7 8
8- command line arguments are reported in alphabetical order 9- command line arguments are reported in alphabetical order
9- extraneous white space is removed 10- extraneous white space is removed
10 11
11Also, if you use a completely new argument than those defined in Nagios-Plugin-Getopt-03.t 12Also, if you use a completely new argument than those currently
12you will need to define it there as well. 13defined in Nagios-Plugin-Getopt-03.t you will need to define it
14there as well.
13 15
diff --git a/t/npg03/expected/00_noextra b/t/npg03/expected/00_noextra
new file mode 100644
index 0000000..d649587
--- /dev/null
+++ b/t/npg03/expected/00_noextra
@@ -0,0 +1 @@
check_mysql -H localhost -S
diff --git a/t/npg03/expected/05_disk1 b/t/npg03/expected/05_disk1
new file mode 100644
index 0000000..5570904
--- /dev/null
+++ b/t/npg03/expected/05_disk1
@@ -0,0 +1 @@
check_disk -p /tmp -p /home
diff --git a/t/npg03/expected/05_disk2 b/t/npg03/expected/05_disk2
new file mode 100644
index 0000000..692890b
--- /dev/null
+++ b/t/npg03/expected/05_disk2
@@ -0,0 +1 @@
check_disk -p /tmp -p /home -p /users
diff --git a/t/npg03/expected/05_disk3 b/t/npg03/expected/05_disk3
new file mode 100644
index 0000000..5252b4e
--- /dev/null
+++ b/t/npg03/expected/05_disk3
@@ -0,0 +1 @@
check_disk -p /tmp -p /var
diff --git a/t/npg03/expected/05_disk4 b/t/npg03/expected/05_disk4
new file mode 100644
index 0000000..34b382e
--- /dev/null
+++ b/t/npg03/expected/05_disk4
@@ -0,0 +1 @@
check_disk -p /tmp -p /var -p /home
diff --git a/t/npg03/expected/05_disk5 b/t/npg03/expected/05_disk5
new file mode 100644
index 0000000..ae61e62
--- /dev/null
+++ b/t/npg03/expected/05_disk5
@@ -0,0 +1 @@
check_disk -p /var -p /tmp -p /home
diff --git a/t/npg03/expected/05_disk6 b/t/npg03/expected/05_disk6
new file mode 100644
index 0000000..dc4870a
--- /dev/null
+++ b/t/npg03/expected/05_disk6
@@ -0,0 +1 @@
check_disk2 --critical=5% --path=/var --path=/home --path=/usr --units=GB --warning=10%
diff --git a/t/npg03/expected/05_singlechar1 b/t/npg03/expected/05_singlechar1
deleted file mode 100644
index 13a3f9b..0000000
--- a/t/npg03/expected/05_singlechar1
+++ /dev/null
@@ -1 +0,0 @@
1check_disk -p /home
diff --git a/t/npg03/expected/06_singlechar2 b/t/npg03/expected/06_singlechar2
deleted file mode 100644
index 8f9df5e..0000000
--- a/t/npg03/expected/06_singlechar2
+++ /dev/null
@@ -1 +0,0 @@
1check_disk -p /var
diff --git a/t/npg03/expected/07_singlechar3 b/t/npg03/expected/07_singlechar3
deleted file mode 100644
index f4e6ed7..0000000
--- a/t/npg03/expected/07_singlechar3
+++ /dev/null
@@ -1 +0,0 @@
1check_disk -p /home -p /users
diff --git a/t/npg03/input/00_basic b/t/npg03/input/00_basic
index 4c16788..f35f3c7 100644
--- a/t/npg03/input/00_basic
+++ b/t/npg03/input/00_basic
@@ -1 +1 @@
check_mysql -S --default-opts= --default-opts=more_options -H localhost check_mysql -S --extra-opts= --extra-opts=more_options -H localhost
diff --git a/t/npg03/input/00_noextra b/t/npg03/input/00_noextra
new file mode 100644
index 0000000..4d8a8fc
--- /dev/null
+++ b/t/npg03/input/00_noextra
@@ -0,0 +1 @@
check_mysql -S -H localhost
diff --git a/t/npg03/input/01_override1 b/t/npg03/input/01_override1
index 9e051e9..f3cd232 100644
--- a/t/npg03/input/01_override1
+++ b/t/npg03/input/01_override1
@@ -1 +1 @@
check_mysql --username=admin --default-opts=more_options --warning=5 check_mysql --username=admin --extra-opts=more_options --warning=5
diff --git a/t/npg03/input/02_override2 b/t/npg03/input/02_override2
index ceabe55..fa96ff7 100644
--- a/t/npg03/input/02_override2
+++ b/t/npg03/input/02_override2
@@ -1 +1 @@
check_mysql --default-opts= -u admin check_mysql --extra-opts= -u admin
diff --git a/t/npg03/input/05_disk1 b/t/npg03/input/05_disk1
new file mode 100644
index 0000000..5ccfe23
--- /dev/null
+++ b/t/npg03/input/05_disk1
@@ -0,0 +1 @@
check_disk --extra-opts= -p /home
diff --git a/t/npg03/input/05_disk2 b/t/npg03/input/05_disk2
new file mode 100644
index 0000000..53e36d9
--- /dev/null
+++ b/t/npg03/input/05_disk2
@@ -0,0 +1 @@
check_disk --extra-opts= -p /home -p /users
diff --git a/t/npg03/input/05_disk3 b/t/npg03/input/05_disk3
new file mode 100644
index 0000000..441accb
--- /dev/null
+++ b/t/npg03/input/05_disk3
@@ -0,0 +1 @@
check_disk --extra-opts=check_2_disks
diff --git a/t/npg03/input/05_disk4 b/t/npg03/input/05_disk4
new file mode 100644
index 0000000..da9d810
--- /dev/null
+++ b/t/npg03/input/05_disk4
@@ -0,0 +1 @@
check_disk -p /home --extra-opts=check_2_disks
diff --git a/t/npg03/input/05_disk5 b/t/npg03/input/05_disk5
new file mode 100644
index 0000000..9ba2d40
--- /dev/null
+++ b/t/npg03/input/05_disk5
@@ -0,0 +1 @@
check_disk -p /home --extra-opts=check_2_disks_reprise
diff --git a/t/npg03/input/05_disk6 b/t/npg03/input/05_disk6
new file mode 100644
index 0000000..c240d9c
--- /dev/null
+++ b/t/npg03/input/05_disk6
@@ -0,0 +1 @@
check_disk2 --warning=10% --critical=5% --extra-opts= --path=/usr
diff --git a/t/npg03/input/05_singlechar1 b/t/npg03/input/05_singlechar1
deleted file mode 100644
index 1edb8bf..0000000
--- a/t/npg03/input/05_singlechar1
+++ /dev/null
@@ -1 +0,0 @@
1check_disk --default-opts= -p /home
diff --git a/t/npg03/input/06_singlechar2 b/t/npg03/input/06_singlechar2
deleted file mode 100644
index 24965c7..0000000
--- a/t/npg03/input/06_singlechar2
+++ /dev/null
@@ -1 +0,0 @@
1check_disk --default-opts=check_2_disks
diff --git a/t/npg03/input/07_singlechar3 b/t/npg03/input/07_singlechar3
deleted file mode 100644
index 0abc70f..0000000
--- a/t/npg03/input/07_singlechar3
+++ /dev/null
@@ -1 +0,0 @@
1check_disk --default-opts= -p /home -p /users
diff --git a/t/npg03/input/09_funnystuff b/t/npg03/input/09_funnystuff
index c2d6160..ab279d9 100644
--- a/t/npg03/input/09_funnystuff
+++ b/t/npg03/input/09_funnystuff
@@ -1 +1 @@
check_disk --default-opts=funny_stuff check_disk --extra-opts=funny_stuff
diff --git a/t/npg03/input/13_nosection_explicit_dies b/t/npg03/input/13_nosection_explicit_dies
index 90aab51..f18660e 100644
--- a/t/npg03/input/13_nosection_explicit_dies
+++ b/t/npg03/input/13_nosection_explicit_dies
@@ -1 +1 @@
check_no_section --default-opts= -H localhost check_no_section --extra-opts= -H localhost
diff --git a/t/npg03/input/14_badsection_dies b/t/npg03/input/14_badsection_dies
index 70815a9..6b1c20a 100644
--- a/t/npg03/input/14_badsection_dies
+++ b/t/npg03/input/14_badsection_dies
@@ -1 +1 @@
check_no_section --default-opts=bad_section check_no_section --extra-opts=bad_section
diff --git a/t/npg03/plugins.cfg b/t/npg03/plugins.ini
index f893a21..2d3c551 100644
--- a/t/npg03/plugins.cfg
+++ b/t/npg03/plugins.ini
@@ -14,6 +14,15 @@ p=/tmp
14p=/tmp 14p=/tmp
15p=/var 15p=/var
16 16
17[check_2_disks_reprise]
18p=/var
19p=/tmp
20
21[check_disk2]
22path=/var
23path=/home
24units=GB
25
17[funny_stuff] 26[funny_stuff]
18username="Ton Voon" 27username="Ton Voon"
19p= 28p=