diff options
Diffstat (limited to 'plugins/t')
-rw-r--r-- | plugins/t/check_mysql.t | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/t/check_mysql.t b/plugins/t/check_mysql.t index e961106b..78413c6e 100644 --- a/plugins/t/check_mysql.t +++ b/plugins/t/check_mysql.t | |||
@@ -19,7 +19,7 @@ use vars qw($tests); | |||
19 | 19 | ||
20 | plan skip_all => "check_mysql not compiled" unless (-x "check_mysql"); | 20 | plan skip_all => "check_mysql not compiled" unless (-x "check_mysql"); |
21 | 21 | ||
22 | plan tests => 7; | 22 | plan tests => 10; |
23 | 23 | ||
24 | my $bad_login_output = '/Access denied for user /'; | 24 | my $bad_login_output = '/Access denied for user /'; |
25 | my $mysqlserver = getTestParameter( | 25 | my $mysqlserver = getTestParameter( |
@@ -58,10 +58,17 @@ SKIP: { | |||
58 | } | 58 | } |
59 | 59 | ||
60 | SKIP: { | 60 | SKIP: { |
61 | skip "No mysql server with slaves defined", 2 unless $with_slave; | 61 | skip "No mysql server with slaves defined", 5 unless $with_slave; |
62 | $result = NPTest->testCmd("./check_mysql -H $with_slave $with_slave_login"); | 62 | $result = NPTest->testCmd("./check_mysql -H $with_slave $with_slave_login"); |
63 | cmp_ok( $result->return_code, '==', 0, "Login okay"); | 63 | cmp_ok( $result->return_code, '==', 0, "Login okay"); |
64 | 64 | ||
65 | $result = NPTest->testCmd("./check_mysql -S -H $with_slave $with_slave_login"); | 65 | $result = NPTest->testCmd("./check_mysql -S -H $with_slave $with_slave_login"); |
66 | cmp_ok( $result->return_code, "==", 0, "Slaves okay" ); | 66 | cmp_ok( $result->return_code, "==", 0, "Slaves okay" ); |
67 | |||
68 | $result = NPTest->testCmd("./check_mysql -S -H $with_slave $with_slave_login -w 60"); | ||
69 | cmp_ok( $result->return_code, '==', 0, 'Slaves are not > 60 seconds behind'); | ||
70 | |||
71 | $result = NPTest->testCmd("./check_mysql -S -H $with_slave $with_slave_login -w 60:"); | ||
72 | cmp_ok( $result->return_code, '==', 1, 'Alert warning if < 60 seconds behind'); | ||
73 | like( $result->output, "/^SLOW_SLAVE WARNING:/", "Output okay"); | ||
67 | } | 74 | } |