New upstream version 2.3.2
This commit is contained in:
		
							parent
							
								
									09f4277f49
								
							
						
					
					
						commit
						21323d25dd
					
				
					 104 changed files with 34386 additions and 7430 deletions
				
			
		| 
						 | 
				
			
			@ -5,7 +5,7 @@
 | 
			
		|||
#
 | 
			
		||||
 | 
			
		||||
use strict;
 | 
			
		||||
use Test::More tests => 40;
 | 
			
		||||
use Test::More tests => 42;
 | 
			
		||||
use NPTest;
 | 
			
		||||
 | 
			
		||||
my $result;
 | 
			
		||||
| 
						 | 
				
			
			@ -45,30 +45,36 @@ $result = NPTest->testCmd(
 | 
			
		|||
cmp_ok( $result->return_code, '==', 2, "Uptime higher than 2 seconds" );
 | 
			
		||||
like  ( $result->output, '/Running since \d+/', "Output for the s parameter correct" );
 | 
			
		||||
 | 
			
		||||
$result = NPTest->testCmd(
 | 
			
		||||
	"./check_uptime -d -w 1 -c 2"
 | 
			
		||||
	);
 | 
			
		||||
cmp_ok( $result->return_code, '==', 2, "Uptime higher than 2 seconds" );
 | 
			
		||||
like  ( $result->output, '/CRITICAL: Uptime is \d+ days/', "Output for the d parameter correct" );
 | 
			
		||||
 | 
			
		||||
$result = NPTest->testCmd(
 | 
			
		||||
	"./check_uptime -w 1 -c 2"
 | 
			
		||||
	);
 | 
			
		||||
cmp_ok( $result->return_code, '==', 2, "Uptime higher than 2 seconds" );
 | 
			
		||||
like  ( $result->output, '/^CRITICAL: uptime is \d+ seconds/', "Output for uptime higher than 2 seconds correct" );
 | 
			
		||||
like  ( $result->output, '/^CRITICAL: Uptime is \d+ seconds/', "Output for uptime higher than 2 seconds correct" );
 | 
			
		||||
 | 
			
		||||
$result = NPTest->testCmd(
 | 
			
		||||
	"./check_uptime -w 1 -c 9999w"
 | 
			
		||||
	);
 | 
			
		||||
cmp_ok( $result->return_code, '==', 1, "Uptime lower than 9999 weeks" );
 | 
			
		||||
like  ( $result->output, '/^WARNING: uptime is \d+ seconds/', "Output for uptime lower than 9999 weeks correct" );
 | 
			
		||||
like  ( $result->output, '/^WARNING: Uptime is \d+ seconds/', "Output for uptime lower than 9999 weeks correct" );
 | 
			
		||||
 | 
			
		||||
$result = NPTest->testCmd(
 | 
			
		||||
	"./check_uptime -w 9998w -c 9999w"
 | 
			
		||||
	);
 | 
			
		||||
cmp_ok( $result->return_code, '==', 0, "Uptime lower than 9998 weeks" );
 | 
			
		||||
like  ( $result->output, '/^OK: uptime is \d+ seconds/', "Output for uptime lower than 9998 weeks correct" );
 | 
			
		||||
like  ( $result->output, '/^OK: Uptime is \d+ seconds/', "Output for uptime lower than 9998 weeks correct" );
 | 
			
		||||
like  ( $result->output, '/\|uptime=[0-9]+s;6046790400;6047395200;/', "Checking for performance output" );
 | 
			
		||||
 | 
			
		||||
$result = NPTest->testCmd(
 | 
			
		||||
	"./check_uptime -w 111222d -c 222333d"
 | 
			
		||||
	);
 | 
			
		||||
cmp_ok( $result->return_code, '==', 0, "Uptime lower than 111222 days" );
 | 
			
		||||
like  ( $result->output, '/^OK: uptime is \d+ seconds/', "Output for uptime lower than 111222 days correct" );
 | 
			
		||||
like  ( $result->output, '/^OK: Uptime is \d+ seconds/', "Output for uptime lower than 111222 days correct" );
 | 
			
		||||
like  ( $result->output, '/\|uptime=[0-9]+s;9609580800;19209571200;/', "Checking for performance output" );
 | 
			
		||||
 | 
			
		||||
# Same as before, hopefully uptime is higher than 2 seconds so no warning
 | 
			
		||||
| 
						 | 
				
			
			@ -76,7 +82,7 @@ $result = NPTest->testCmd(
 | 
			
		|||
	"./check_uptime -w 2:111222d -c 1:222333d"
 | 
			
		||||
	);
 | 
			
		||||
cmp_ok( $result->return_code, '==', 0, "Uptime lower than 111222 days, and higher 2 seconds" );
 | 
			
		||||
like  ( $result->output, '/^OK: uptime is \d+ seconds/', "Output for uptime lower than 111222 days, and higher 2 seconds correct" );
 | 
			
		||||
like  ( $result->output, '/^OK: Uptime is \d+ seconds/', "Output for uptime lower than 111222 days, and higher 2 seconds correct" );
 | 
			
		||||
like  ( $result->output, '/\|uptime=[0-9]+s;9609580800;19209571200;/', "Checking for performance output" );
 | 
			
		||||
 | 
			
		||||
# Same as before, now the low warning should trigger
 | 
			
		||||
| 
						 | 
				
			
			@ -84,7 +90,7 @@ $result = NPTest->testCmd(
 | 
			
		|||
	"./check_uptime -w 111221d:111222d -c 1:222333d"
 | 
			
		||||
	);
 | 
			
		||||
cmp_ok( $result->return_code, '==', 1, "Uptime lower than 111221 days raises warning" );
 | 
			
		||||
like  ( $result->output, '/^WARNING: uptime is \d+ seconds/', "Output for uptime lower than 111221 days correct" );
 | 
			
		||||
like  ( $result->output, '/^WARNING: Uptime is \d+ seconds/', "Output for uptime lower than 111221 days correct" );
 | 
			
		||||
like  ( $result->output, '/Exceeds lower warn threshold/', "Exceeds text correct" );
 | 
			
		||||
like  ( $result->output, '/\|uptime=[0-9]+s;9609580800;19209571200;/', "Checking for performance output" );
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -93,7 +99,7 @@ $result = NPTest->testCmd(
 | 
			
		|||
	"./check_uptime -w 111221d:111222d -c 111220d:222333d"
 | 
			
		||||
	);
 | 
			
		||||
cmp_ok( $result->return_code, '==', 2, "Uptime lower than 111220 days raises critical" );
 | 
			
		||||
like  ( $result->output, '/^CRITICAL: uptime is \d+ seconds/', "Output for uptime lower than 111220 days correct" );
 | 
			
		||||
like  ( $result->output, '/^CRITICAL: Uptime is \d+ seconds/', "Output for uptime lower than 111220 days correct" );
 | 
			
		||||
like  ( $result->output, '/Exceeds lower crit threshold/', "Exceeds text correct" );
 | 
			
		||||
like  ( $result->output, '/\|uptime=[0-9]+s;9609580800;19209571200;/', "Checking for performance output" );
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue