t/Templates/Plugins/Nagios/check_template-ftp.t

filter: Statementstmt 97.1% 34 / 35 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 86.0% 43 / 50 CC 1 SCAR 0.0
CC
1
Cov
88%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« t/Asnmtap/Plugins.t ↑ Summary t/Asnmtap/Plugins/Mail.t »
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
BranchTrueFalseTotal
if ($installed and -x "$prefix/$plugin") { } 1 0 1
Condition33%1/3
$installed and -x "$prefix/$plugin"
!ll&&!rl&&r
001
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"
ABresult
0X0
100
111
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
BranchTrueFalseTotal
if defined $Test::Harness::VERSION 0 1 1
37 1 exit($tests - $t);
« t/Asnmtap/Plugins.t ↑ Summary t/Asnmtap/Plugins/Mail.t »