Просмотр исходного кода

added test case for certificate checs with both warning and critical values

William Leibzon 13 лет назад
Родитель
Сommit
181260d636
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      plugins/tests/check_http.t

+ 4 - 0
plugins/tests/check_http.t

@@ -188,6 +188,10 @@ SKIP: {
 	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" );
 
+        $result = NPTest->testCmd( "$command -p $port_https -S -C 13960,14000" );
+        is( $result->return_code, 1, "$command -p $port_https -S -C 139600,14000" );
+        like( $result->output, '/CRITICAL - Certificate \'Ton Voon\' expires in \d+ day\(s\) \(03/03/2019 21:41\)./', "output ok" );
+
 	# Expired cert tests
 	$result = NPTest->testCmd( "$command -p $port_https_expired -S -C 7" );
 	is( $result->return_code, 2, "$command -p $port_https_expired -S -C 7" );