check_mysql.t 589 B

123456789101112131415161718192021222324252627282930313233
  1. #! /usr/bin/perl -w -I ..
  2. #
  3. # MySQL Database Server Tests via check_mysql
  4. #
  5. # $Id$
  6. #
  7. use strict;
  8. use Test;
  9. use NPTest;
  10. use vars qw($tests);
  11. BEGIN {$tests = 2; plan tests => $tests}
  12. my $t;
  13. my $failureOutput = '/Access denied for user: /';
  14. if ( -x "./check_mysql" )
  15. {
  16. my $mysqlserver = getTestParameter( "mysql_server", "NP_MYSQL_SERVER", undef,
  17. "A MySQL Server");
  18. $t += checkCmd( "./check_mysql -H $mysqlserver -P 3306", 2, $failureOutput );
  19. }
  20. else
  21. {
  22. $t += skipMissingCmd( "./check_mysql", $tests );
  23. }
  24. exit(0) if defined($Test::Harness::VERSION);
  25. exit($tests - $t);