blib/lib/Tapper/Action/Plugin/resume/OSRC.pm

filter: Statementstmt 100% 21 / 21 Branchbran 66.6% 4 / 6 Conditioncond 40.0% 2 / 5 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 81.5% 31 / 38 CC 6 SCAR 16.1
CC
6
Cov
84%
execute
6.4
BEGIN
1.0
BEGIN
1.0
CRAP 5.0
« blib/lib/Tapper/Action/Plugin/updategrub/OSRC.pm ↑ Summary blib/lib/Tapper/Action.pm »
1 package Tapper::Action::Plugin::resume::OSRC;
2 3 our $AUTHORITY = 'cpan:TAPPER';
3 3 $Tapper::Action::Plugin::resume::OSRC::VERSION = '5.0.0';
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7  
8 sub execute
9 2 ▶{
Subroutine execute: called CC=6 SCAR=18.5
Pod documented
10 2 my ($action, $message, $options) = @_;
11  
12 2 $SIG{CHLD} = 'IGNORE';
13 2 my $pid = fork();
14  
15 2 ▶ die ("Can not fork in __PACKAGE__: $!") if not defined $pid;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $pid 0 2 2
16 2 ▶ if ($pid == 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($pid == 0) 1 1 2
17 1 my $host = $message->{host};
18 1 ▶ sleep( $message->{after} || $action->cfg->{action}{resume}{default_sleeptime} || 0);
Condition40%2/5
$message->{'after'} || $action->cfg->{'action'}{'resume'}{'default_sleeptime'} || 0
l!l
01
$message->{"after"} or $action->cfg->{"action"}{"resume"}{"default_sleeptime"}
l!l&&r!l&&!r
001
MC/DC0%0/2
$message->{'after'} || $action->cfg->{'action'}{'resume'}{'default_sleeptime'} || 0
$message->{"after"} $action->cfg->{"action"}{"resume"}{"default_sleeptime"}
Truth table33%1/3
A or B
A= $message->{"after"}B= $action->cfg->{"action"}{"resume"}{"default_sleeptime"}
ABresult
1X1
011
000
19 1 my $cmd = $options->{cmd} . " $host";
20 1 my ($error, $retval) = $action->log_and_exec($cmd);
21 1 ▶ $action->log->error($retval) if $error;
Branch: 1 branch
BranchTrueFalseTotal
if $error 1 0 1
22 1 exit 0;
23 }
24 1 return;
25 }
26  
27  
28 3 1; # End of Tapper::Action::Plugin::resume::OSRC
29  
30 __END__
« blib/lib/Tapper/Action/Plugin/updategrub/OSRC.pm ↑ Summary blib/lib/Tapper/Action.pm »