mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-02-20 00:10:09 -05:00
Adjust check_swap tests
This commit is contained in:
parent
9b4fab0664
commit
675f208476
1 changed files with 12 additions and 0 deletions
|
|
@ -14,6 +14,10 @@ my $warnOutput = '/^SWAP WARNING - [0-9]+\% free \([0-9]+MB out of [0-9]+MB\)
|
|||
|
||||
my $result;
|
||||
|
||||
$result = NPTest->testCmd( "./check_swap" ); # Always OK
|
||||
cmp_ok( $result->return_code, "==", 0, "Always OK" );
|
||||
like( $result->output, $successOutput, "Right output" );
|
||||
|
||||
$result = NPTest->testCmd( "./check_swap -w 1048576 -c 1048576" ); # 1 MB free
|
||||
cmp_ok( $result->return_code, "==", 0, "At least 1MB free" );
|
||||
like( $result->output, $successOutput, "Right output" );
|
||||
|
|
@ -29,3 +33,11 @@ like( $result->output, $failureOutput, "Right output" );
|
|||
$result = NPTest->testCmd( "./check_swap -w 100% -c 1%" ); # 100% (always warn)
|
||||
cmp_ok( $result->return_code, "==", 1, 'Get warning because not 100% free' );
|
||||
like( $result->output, $warnOutput, "Right output" );
|
||||
|
||||
$result = NPTest->testCmd( "./check_swap -w 100%" ); # 100% (single threshold, always warn)
|
||||
cmp_ok( $result->return_code, "==", 1, 'Get warning because not 100% free' );
|
||||
like( $result->output, $warnOutput, "Right output" );
|
||||
|
||||
$result = NPTest->testCmd( "./check_swap -c 100%" ); # 100% (single threshold, always critical)
|
||||
cmp_ok( $result->return_code, "==", 2, 'Get critical because not 100% free' );
|
||||
like( $result->output, $warnOutput, "Right output" );
|
||||
|
|
|
|||
Loading…
Reference in a new issue