diff options
author | Peter Bray <illumino@users.sourceforge.net> | 2005-07-25 01:47:15 +0000 |
---|---|---|
committer | Peter Bray <illumino@users.sourceforge.net> | 2005-07-25 01:47:15 +0000 |
commit | cdc06cc3e2c4670d3cd46b0a03adcf7e6958eff1 (patch) | |
tree | 62b074eaca618762fb03f94708ec3def50037697 /plugins/t/check_mysql.t | |
parent | 05853f47eb6e608de993cc59343c73b96b9b33e2 (diff) | |
download | monitoring-plugins-cdc06cc3e2c4670d3cd46b0a03adcf7e6958eff1.tar.gz |
[1185704] New Testing Infrastructure.
Complete rewrite of the original testing infrastructure and
all test cases (to use the new infrastructure)
See NPTest.pm and issue 1185704 for more details.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1207 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/t/check_mysql.t')
-rw-r--r-- | plugins/t/check_mysql.t | 33 |
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 | ||
3 | use strict; | 8 | use strict; |
4 | use Helper; | ||
5 | use Cache; | ||
6 | use Test; | 9 | use Test; |
10 | use NPTest; | ||
11 | |||
7 | use vars qw($tests); | 12 | use vars qw($tests); |
8 | 13 | ||
9 | BEGIN {$tests = 2; plan tests => $tests} | 14 | BEGIN {$tests = 2; plan tests => $tests} |
10 | 15 | ||
11 | exit(0) unless (-x "./check_mysql"); | ||
12 | |||
13 | my $null = ''; | ||
14 | my $cmd; | ||
15 | my $str; | ||
16 | my $t; | 16 | my $t; |
17 | 17 | ||
18 | my $mysqlserver = get_option("mysqlserver","host for MYSQL tests"); | 18 | my $failureOutput = '/Access denied for user: /'; |
19 | |||
20 | if ( -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; | 27 | else |
23 | $t += ok $str, '/Access denied for user: /'; | 28 | { |
29 | $t += skipMissingCmd( "./check_mysql", $tests ); | ||
30 | } | ||
24 | 31 | ||
25 | exit(0) if defined($Test::Harness::VERSION); | 32 | exit(0) if defined($Test::Harness::VERSION); |
26 | exit($tests - $t); | 33 | exit($tests - $t); |