| 1 | #!/usr/bin/env perl -w -I .. | ||||||||||||||||||||||||||||
| 2 | # | ||||||||||||||||||||||||||||
| 3 | # ... Tests via check_template-ftp.pl | ||||||||||||||||||||||||||||
| 4 | # | ||||||||||||||||||||||||||||
| 5 | # $Id: check_template-ftp.t, v 1.0 2006/02/01 Alex Peeters Exp $ | ||||||||||||||||||||||||||||
| 6 | # | ||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use Test; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use ASNMTAP::Asnmtap::Plugins::NPTest; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use vars qw($tests); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 1 | ▶ | BEGIN {$tests = 12; plan tests => $tests} | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 1 | my ($module, $version, $installed); | |||||||||||||||||||||||||||
| 16 | 1 | $module = 'Net::FTP'; | |||||||||||||||||||||||||||
| 17 | 1 | $version = '2.75'; | |||||||||||||||||||||||||||
| 18 | 1 | $installed = eval ( "require $module; Exporter::require_version ( '$module', $version );" ); | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 1 | my $t; | |||||||||||||||||||||||||||
| 21 | 1 | my $prefix = '../plugins/nagios/templates'; | |||||||||||||||||||||||||||
| 22 | 1 | my $plugin = 'check_template-ftp.pl'; | |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 1 | ▶ | if ( $installed and -x "$prefix/$plugin" ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$installed and -x "$prefix/$plugin"
MC/DC0%0/2
$installed and -x "$prefix/$plugin"
$installed
-x "$prefix/$plugin"
Truth table33%1/3
A and B
A= $installedB= -x "$prefix/$plugin"
| |||||||||||||||||||||||||||||
| 25 | 1 | $t += checkCmd( "$prefix/$plugin -V", 3, "/$plugin/"); | |||||||||||||||||||||||||||
| 26 | 1 | $t += checkCmd( "$prefix/$plugin -h", 3); | |||||||||||||||||||||||||||
| 27 | 1 | $t += checkCmd( "$prefix/$plugin", 3, "/Missing command line argument environment/"); | |||||||||||||||||||||||||||
| 28 | 1 | $t += checkCmd( "$prefix/$plugin -e L", 3, "/Missing command line argument host/"); | |||||||||||||||||||||||||||
| 29 | 1 | $t += checkCmd( "$prefix/$plugin -e L -H ftp.citap.com", 3, "/Missing command line argument username/"); | |||||||||||||||||||||||||||
| 30 | 1 | $t += checkCmd( "$prefix/$plugin -e L -H ftp.citap.com -u username", 3, "/Missing command line argument password/"); | |||||||||||||||||||||||||||
| 31 | 1 | $t += checkCmd( "$prefix/$plugin -e L -H ftp.citap.com -u username -p password", 2); | |||||||||||||||||||||||||||
| 32 | } else { | ||||||||||||||||||||||||||||
| 33 | 0 | $t += skipMissingCmd( "$prefix/$plugin", $tests ); | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 1 | ▶ | exit(0) if defined($Test::Harness::VERSION); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 37 | 1 | exit($tests - $t); | |||||||||||||||||||||||||||