summaryrefslogtreecommitdiffstats
path: root/plugins/t
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/t')
-rw-r--r--plugins/t/check_http.t19
1 files changed, 17 insertions, 2 deletions
diff --git a/plugins/t/check_http.t b/plugins/t/check_http.t
index 3154151..4e3c06c 100644
--- a/plugins/t/check_http.t
+++ b/plugins/t/check_http.t
@@ -9,7 +9,7 @@ use strict;
9use Test::More; 9use Test::More;
10use NPTest; 10use NPTest;
11 11
12plan tests => 14; 12plan tests => 21;
13 13
14my $successOutput = '/OK.*HTTP.*second/'; 14my $successOutput = '/OK.*HTTP.*second/';
15 15
@@ -79,4 +79,19 @@ $res = NPTest->testCmd(
79 ); 79 );
80cmp_ok( $res->return_code, "==", 0, "Can read https for www.e-paycobalt.com (uses AES certificate)" ); 80cmp_ok( $res->return_code, "==", 0, "Can read https for www.e-paycobalt.com (uses AES certificate)" );
81 81
82 82$res = NPTest->testCmd( "./check_http -H altinity.com -r 'nagios'" );
83cmp_ok( $res->return_code, "==", 0, "Got a reference to 'nagios'");
84
85$res = NPTest->testCmd( "./check_http -H altinity.com -r 'nAGiOs'" );
86cmp_ok( $res->return_code, "==", 2, "Not got 'nAGiOs'");
87like ( $res->output, "/pattern not found/", "Error message says 'pattern not found'");
88
89$res = NPTest->testCmd( "./check_http -H altinity.com -R 'nAGiOs'" );
90cmp_ok( $res->return_code, "==", 0, "But case insensitive doesn't mind 'nAGiOs'");
91
92$res = NPTest->testCmd( "./check_http -H altinity.com -r 'nagios' --invert-regex" );
93cmp_ok( $res->return_code, "==", 2, "Invert results work when found");
94like ( $res->output, "/pattern found/", "Error message says 'pattern found'");
95
96$res = NPTest->testCmd( "./check_http -H altinity.com -r 'nAGiOs' --invert-regex" );
97cmp_ok( $res->return_code, "==", 0, "And also when not found");