Code

[1185704] New Testing Infrastructure.
[nagiosplug.git] / plugins / t / check_mysql.t
1 #! /usr/bin/perl -w -I ..
2 #
3 # MySQL Database Server Tests via check_mysql
4 #
5 # $Id$
6 #
8 use strict;
9 use Test;
10 use NPTest;
12 use vars qw($tests);
14 BEGIN {$tests = 2; plan tests => $tests}
16 my $t;
18 my $failureOutput = '/Access denied for user: /';
20 if ( -x "./check_mysql" )
21 {
22   my $mysqlserver = getTestParameter( "mysql_server", "NP_MYSQL_SERVER", undef,
23                                       "A MySQL Server");
25   $t += checkCmd( "./check_mysql -H $mysqlserver -P 3306", 2, $failureOutput );
26 }
27 else
28 {
29   $t += skipMissingCmd( "./check_mysql", $tests );
30 }
32 exit(0) if defined($Test::Harness::VERSION);
33 exit($tests - $t);