summaryrefslogtreecommitdiffstats
path: root/plugins/t/check_mysql.t
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/t/check_mysql.t')
-rw-r--r--plugins/t/check_mysql.t33
1 files changed, 20 insertions, 13 deletions
diff --git a/plugins/t/check_mysql.t b/plugins/t/check_mysql.t
index 0fae65fe..ad423595 100644
--- a/plugins/t/check_mysql.t
+++ b/plugins/t/check_mysql.t
@@ -1,26 +1,33 @@
1#! /usr/bin/perl -w 1#! /usr/bin/perl -w -I ..
2#
3# MySQL Database Server Tests via check_mysql
4#
5# $Id$
6#
2 7
3use strict; 8use strict;
4use Helper;
5use Cache;
6use Test; 9use Test;
10use NPTest;
11
7use vars qw($tests); 12use vars qw($tests);
8 13
9BEGIN {$tests = 2; plan tests => $tests} 14BEGIN {$tests = 2; plan tests => $tests}
10 15
11exit(0) unless (-x "./check_mysql");
12
13my $null = '';
14my $cmd;
15my $str;
16my $t; 16my $t;
17 17
18my $mysqlserver = get_option("mysqlserver","host for MYSQL tests"); 18my $failureOutput = '/Access denied for user: /';
19
20if ( -x "./check_mysql" )
21{
22 my $mysqlserver = getTestParameter( "mysql_server", "NP_MYSQL_SERVER", undef,
23 "A MySQL Server");
19 24
20$cmd = "./check_mysql -H $mysqlserver -P 3306"; 25 $t += checkCmd( "./check_mysql -H $mysqlserver -P 3306", 2, $failureOutput );
21$str = `$cmd`; 26}
22$t += ok $?>>8,2; 27else
23$t += ok $str, '/Access denied for user: /'; 28{
29 $t += skipMissingCmd( "./check_mysql", $tests );
30}
24 31
25exit(0) if defined($Test::Harness::VERSION); 32exit(0) if defined($Test::Harness::VERSION);
26exit($tests - $t); 33exit($tests - $t);