diff options
Diffstat (limited to 'plugins/t/check_disk.t')
-rw-r--r-- | plugins/t/check_disk.t | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/t/check_disk.t b/plugins/t/check_disk.t index 0fe87aa3..ec3d248c 100644 --- a/plugins/t/check_disk.t +++ b/plugins/t/check_disk.t | |||
@@ -10,9 +10,9 @@ use Test::More; | |||
10 | use NPTest; | 10 | use NPTest; |
11 | use POSIX qw(ceil floor); | 11 | use POSIX qw(ceil floor); |
12 | 12 | ||
13 | my $successOutput = '/^DISK OK - /'; | 13 | my $successOutput = '/^DISK OK/'; |
14 | my $failureOutput = '/^DISK CRITICAL - /'; | 14 | my $failureOutput = '/^DISK CRITICAL/'; |
15 | my $warningOutput = '/^DISK WARNING - /'; | 15 | my $warningOutput = '/^DISK WARNING/'; |
16 | 16 | ||
17 | my $result; | 17 | my $result; |
18 | 18 | ||
@@ -22,7 +22,7 @@ my $mountpoint2_valid = getTestParameter( "NP_MOUNTPOINT2_VALID", "Path to anoth | |||
22 | if ($mountpoint_valid eq "" or $mountpoint2_valid eq "") { | 22 | if ($mountpoint_valid eq "" or $mountpoint2_valid eq "") { |
23 | plan skip_all => "Need 2 mountpoints to test"; | 23 | plan skip_all => "Need 2 mountpoints to test"; |
24 | } else { | 24 | } else { |
25 | plan tests => 39; | 25 | plan tests => 42; |
26 | } | 26 | } |
27 | 27 | ||
28 | $result = NPTest->testCmd( | 28 | $result = NPTest->testCmd( |
@@ -55,6 +55,11 @@ if ($free_on_mp1 > $free_on_mp2) { | |||
55 | $result = NPTest->testCmd( "./check_disk -w 1 -c 1 -p $more_free" ); | 55 | $result = NPTest->testCmd( "./check_disk -w 1 -c 1 -p $more_free" ); |
56 | cmp_ok( $result->return_code, '==', 0, "At least 1 MB available on $more_free"); | 56 | cmp_ok( $result->return_code, '==', 0, "At least 1 MB available on $more_free"); |
57 | like ( $result->output, $successOutput, "OK output" ); | 57 | like ( $result->output, $successOutput, "OK output" ); |
58 | like ( $result->only_output, qr/free space/, "Have free space text"); | ||
59 | like ( $result->only_output, qr/$more_free/, "Have disk name in text"); | ||
60 | |||
61 | $result = NPTest->testCmd( "./check_disk -e -w 1 -c 1 -p $more_free" ); | ||
62 | is( $result->only_output, "DISK OK", "No print out of disks with -e for OKs"); | ||
58 | 63 | ||
59 | $result = NPTest->testCmd( "./check_disk 100 100 $more_free" ); | 64 | $result = NPTest->testCmd( "./check_disk 100 100 $more_free" ); |
60 | cmp_ok( $result->return_code, '==', 0, "Old syntax okay" ); | 65 | cmp_ok( $result->return_code, '==', 0, "Old syntax okay" ); |