Browse Source

check_load.t: consider new per CPU format

Marcel Telka 2 năm trước cách đây
mục cha
commit
aada3d0bb7
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      plugins/t/check_load.t

+ 2 - 1
plugins/t/check_load.t

@@ -13,6 +13,7 @@ my $res;
 my $loadValue = "[0-9]+\.?[0-9]+";
 my $loadValue = "[0-9]+\.?[0-9]+";
 my $successOutput = "/^OK - load average: $loadValue, $loadValue, $loadValue/";
 my $successOutput = "/^OK - load average: $loadValue, $loadValue, $loadValue/";
 my $failureOutput = "/^CRITICAL - load average: $loadValue, $loadValue, $loadValue/";
 my $failureOutput = "/^CRITICAL - load average: $loadValue, $loadValue, $loadValue/";
+my $failureOutputPerCPU = "/^CRITICAL - load average per CPU: $loadValue, $loadValue, $loadValue/";
 
 
 plan tests => 11;
 plan tests => 11;
 
 
@@ -26,7 +27,7 @@ like( $res->output, $failureOutput, "Output OK");
 
 
 $res = NPTest->testCmd( "./check_load -r -w 0,0,0 -c 0,0,0" );
 $res = NPTest->testCmd( "./check_load -r -w 0,0,0 -c 0,0,0" );
 cmp_ok( $res->return_code, 'eq', 2, "Load over 0 with per cpu division");
 cmp_ok( $res->return_code, 'eq', 2, "Load over 0 with per cpu division");
-like( $res->output, $failureOutput, "Output OK");
+like( $res->output, $failureOutputPerCPU, "Output OK");
 
 
 $res = NPTest->testCmd( "./check_load -w 100 -c 100,110" );
 $res = NPTest->testCmd( "./check_load -w 100 -c 100,110" );
 cmp_ok( $res->return_code, 'eq', 0, "Plugin can handle non-triplet-arguments");
 cmp_ok( $res->return_code, 'eq', 0, "Plugin can handle non-triplet-arguments");