diff options
Diffstat (limited to 'plugins/t/check_mysql.t')
| -rw-r--r-- | plugins/t/check_mysql.t | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/t/check_mysql.t b/plugins/t/check_mysql.t index a383bc99..9114cccc 100644 --- a/plugins/t/check_mysql.t +++ b/plugins/t/check_mysql.t | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | # mysql -u$user -p$password -h$host $db | 11 | # mysql -u$user -p$password -h$host $db |
| 12 | 12 | ||
| 13 | use strict; | 13 | use strict; |
| 14 | use warnings; | ||
| 14 | use Test::More; | 15 | use Test::More; |
| 15 | use NPTest; | 16 | use NPTest; |
| 16 | 17 | ||
| @@ -40,7 +41,7 @@ SKIP: { | |||
| 40 | 41 | ||
| 41 | $result = NPTest->testCmd("./check_mysql -S -H $mysqlserver $mysql_login_details"); | 42 | $result = NPTest->testCmd("./check_mysql -S -H $mysqlserver $mysql_login_details"); |
| 42 | cmp_ok( $result->return_code, "==", 1, "No replicas defined" ); | 43 | cmp_ok( $result->return_code, "==", 1, "No replicas defined" ); |
| 43 | like( $result->output, "/No replicas defined/", "Correct error message"); | 44 | like( $result->output, "/no replicas defined/", "Correct error message"); |
| 44 | } | 45 | } |
| 45 | 46 | ||
| 46 | SKIP: { | 47 | SKIP: { |
| @@ -54,7 +55,7 @@ SKIP: { | |||
| 54 | 55 | ||
| 55 | $result = NPTest->testCmd("./check_mysql -S -s $mysqlsocket $mysql_login_details"); | 56 | $result = NPTest->testCmd("./check_mysql -S -s $mysqlsocket $mysql_login_details"); |
| 56 | cmp_ok( $result->return_code, "==", 1, "No replicas defined" ); | 57 | cmp_ok( $result->return_code, "==", 1, "No replicas defined" ); |
| 57 | like( $result->output, "/No replicas defined/", "Correct error message"); | 58 | like( $result->output, "/no replicas defined/", "Correct error message"); |
| 58 | } | 59 | } |
| 59 | 60 | ||
| 60 | SKIP: { | 61 | SKIP: { |
| @@ -70,5 +71,5 @@ SKIP: { | |||
| 70 | 71 | ||
| 71 | $result = NPTest->testCmd("./check_mysql -S -H $with_replica $with_replica_login -w 60:"); | 72 | $result = NPTest->testCmd("./check_mysql -S -H $with_replica $with_replica_login -w 60:"); |
| 72 | cmp_ok( $result->return_code, '==', 1, 'Alert warning if < 60 seconds behind'); | 73 | cmp_ok( $result->return_code, '==', 1, 'Alert warning if < 60 seconds behind'); |
| 73 | like( $result->output, "/^SLOW_REPLICA WARNING:/", "Output okay"); | 74 | like( $result->output, "/^slow_replica/", "Output okay"); |
| 74 | } | 75 | } |
