Imported Upstream version 2.1
This commit is contained in:
		
							parent
							
								
									0841b5c7c7
								
							
						
					
					
						commit
						060ec72678
					
				
					 47 changed files with 1718 additions and 1420 deletions
				
			
		| 
						 | 
				
			
			@ -186,21 +186,21 @@ SKIP: {
 | 
			
		|||
 | 
			
		||||
	$result = NPTest->testCmd( "$command -p $port_https -S -C 14" );
 | 
			
		||||
	is( $result->return_code, 0, "$command -p $port_https -S -C 14" );
 | 
			
		||||
	is( $result->output, 'OK - Certificate \'Ton Voon\' will expire on 03/03/2019 21:41.', "output ok" );
 | 
			
		||||
	is( $result->output, 'OK - Certificate \'Ton Voon\' will expire on Sun Mar  3 21:41:00 2019.', "output ok" );
 | 
			
		||||
 | 
			
		||||
	$result = NPTest->testCmd( "$command -p $port_https -S -C 14000" );
 | 
			
		||||
	is( $result->return_code, 1, "$command -p $port_https -S -C 14000" );
 | 
			
		||||
	like( $result->output, '/WARNING - Certificate \'Ton Voon\' expires in \d+ day\(s\) \(03/03/2019 21:41\)./', "output ok" );
 | 
			
		||||
	like( $result->output, '/WARNING - Certificate \'Ton Voon\' expires in \d+ day\(s\) \(Sun Mar  3 21:41:00 2019\)./', "output ok" );
 | 
			
		||||
 | 
			
		||||
	# Expired cert tests
 | 
			
		||||
	$result = NPTest->testCmd( "$command -p $port_https -S -C 13960,14000" );
 | 
			
		||||
	is( $result->return_code, 2, "$command -p $port_https -S -C 13960,14000" );
 | 
			
		||||
	like( $result->output, '/CRITICAL - Certificate \'Ton Voon\' expires in \d+ day\(s\) \(03/03/2019 21:41\)./', "output ok" );
 | 
			
		||||
	like( $result->output, '/CRITICAL - Certificate \'Ton Voon\' expires in \d+ day\(s\) \(Sun Mar  3 21:41:00 2019\)./', "output ok" );
 | 
			
		||||
 | 
			
		||||
	$result = NPTest->testCmd( "$command -p $port_https_expired -S -C 7" );
 | 
			
		||||
	is( $result->return_code, 2, "$command -p $port_https_expired -S -C 7" );
 | 
			
		||||
	is( $result->output,
 | 
			
		||||
		'CRITICAL - Certificate \'Ton Voon\' expired on 03/05/2009 00:13.',
 | 
			
		||||
		'CRITICAL - Certificate \'Ton Voon\' expired on Thu Mar  5 00:13:00 2009.',
 | 
			
		||||
		"output ok" );
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,7 +20,16 @@ if ($@) {
 | 
			
		|||
	plan skip_all => "Missing required module for test: $@";
 | 
			
		||||
} else {
 | 
			
		||||
	if (-x "./check_snmp") {
 | 
			
		||||
		plan tests => $tests;
 | 
			
		||||
        # check if snmpd has perl support
 | 
			
		||||
        my $test = `snmpd -c tests/conf/snmpd.conf -C -r -H 2>&1`;
 | 
			
		||||
        if(!defined $test) {
 | 
			
		||||
	        plan skip_all => "snmpd required";
 | 
			
		||||
        }
 | 
			
		||||
        elsif($test =~ m/Warning: Unknown token: perl/) {
 | 
			
		||||
	        plan skip_all => "snmpd has no perl support";
 | 
			
		||||
        } else {
 | 
			
		||||
		    plan tests => $tests;
 | 
			
		||||
        }
 | 
			
		||||
	} else {
 | 
			
		||||
		plan skip_all => "No check_snmp compiled";
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue