lib/App/MadEye/Plugin/Agent/WriteDisk.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 31 CC 2 SCAR 12.0
CC
2
Cov
0%
is_dead
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.3
1 package App::MadEye::Plugin::Agent::WriteDisk;
2 use strict;
3 use warnings;
4 use App::MadEye::Plugin::Agent::Base;
5  
6 use Net::SSH qw/ssh_cmd/;
7  
8 sub is_dead {
9 my ($self, $host) = @_;
10  
11 my $conf = $self->config->{config};
12 my $fname = $conf->{filename} or die "missing filename";
13  
14 my @result = split /\n/, ssh_cmd($host, "/bin/touch $fname && /bin/rm $fname");
15  
16 if (scalar(@result) == 0) {
17 return; # ok
18 } else {
19 return join("\n", @result);
20 }
21 }
22
23 1;
24 __END__