From 63271bf65d7f6da74e832e16217bac5778d21d6b Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Wed, 22 Mar 2006 16:45:57 +0000 Subject: Added warning and critical response times (John Rouillard - 1343159) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1346 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/t/check_dns.t | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'plugins/t') diff --git a/plugins/t/check_dns.t b/plugins/t/check_dns.t index 5d750d3f..9a95e808 100644 --- a/plugins/t/check_dns.t +++ b/plugins/t/check_dns.t @@ -11,7 +11,7 @@ use NPTest; plan skip_all => "check_dns not compiled" unless (-x "check_dns"); -plan tests => 11; +plan tests => 13; my $successOutput = '/DNS OK: [\.0-9]+ seconds response time/'; @@ -50,6 +50,12 @@ $res = NPTest->testCmd("./check_dns -H $hostname_valid -t 5"); cmp_ok( $res->return_code, '==', 0, "Found $hostname_valid"); like ( $res->output, $successOutput, "Output OK" ); +$res = NPTest->testCmd("./check_dns -H $hostname_valid -t 5 -w 0 -c 0"); +cmp_ok( $res->return_code, '==', 2, "Critical threshold passed"); + +$res = NPTest->testCmd("./check_dns -H $hostname_valid -t 5 -w 0 -c 5"); +cmp_ok( $res->return_code, '==', 1, "Warning threshold passed"); + $res = NPTest->testCmd("./check_dns -H $hostname_invalid -t 1"); cmp_ok( $res->return_code, '==', 2, "Invalid $hostname_invalid"); -- cgit v1.2.3-74-g34f1