diff options
Diffstat (limited to 'plugins/t/check_mysql_query.t')
-rw-r--r-- | plugins/t/check_mysql_query.t | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/plugins/t/check_mysql_query.t b/plugins/t/check_mysql_query.t index 407af88..c30245b 100644 --- a/plugins/t/check_mysql_query.t +++ b/plugins/t/check_mysql_query.t | |||
@@ -17,15 +17,8 @@ use vars qw($tests); | |||
17 | 17 | ||
18 | plan skip_all => "check_mysql_query not compiled" unless (-x "check_mysql_query"); | 18 | plan skip_all => "check_mysql_query not compiled" unless (-x "check_mysql_query"); |
19 | 19 | ||
20 | my $mysqlserver = getTestParameter( | 20 | my $mysqlserver = getTestParameter("NP_MYSQL_SERVER", "A MySQL Server with no slaves setup"); |
21 | "NP_MYSQL_SERVER", | 21 | my $mysql_login_details = getTestParameter("NP_MYSQL_LOGIN_DETAILS", "Command line parameters to specify login access", "-u user -ppw -d db"); |
22 | "A MySQL Server with no slaves setup" | ||
23 | ); | ||
24 | my $mysql_login_details = getTestParameter( | ||
25 | "MYSQL_LOGIN_DETAILS", | ||
26 | "Command line parameters to specify login access", | ||
27 | "-u user -ppw -d db", | ||
28 | ); | ||
29 | my $result; | 22 | my $result; |
30 | 23 | ||
31 | if (! $mysqlserver) { | 24 | if (! $mysqlserver) { |
@@ -38,7 +31,7 @@ $result = NPTest->testCmd("./check_mysql_query -q 'SELECT 1+1' -H $mysqlserver $ | |||
38 | cmp_ok( $result->return_code, '==', 0, "Can run query"); | 31 | cmp_ok( $result->return_code, '==', 0, "Can run query"); |
39 | 32 | ||
40 | $result = NPTest->testCmd("./check_mysql_query -H $mysqlserver $mysql_login_details"); | 33 | $result = NPTest->testCmd("./check_mysql_query -H $mysqlserver $mysql_login_details"); |
41 | cmp_ok( $result->return_code, '==', 3, "Missing query parmeter"); | 34 | cmp_ok( $result->return_code, '==', 3, "Missing query parameter"); |
42 | like( $result->output, "/Must specify a SQL query to run/", "Missing query error message"); | 35 | like( $result->output, "/Must specify a SQL query to run/", "Missing query error message"); |
43 | 36 | ||
44 | $result = NPTest->testCmd("./check_mysql_query -q 'SELECT 1+1' -H $mysqlserver -u dummy -d mysql"); | 37 | $result = NPTest->testCmd("./check_mysql_query -q 'SELECT 1+1' -H $mysqlserver -u dummy -d mysql"); |