blib/lib/Rex/Interface/Shell/Ilo.pm untested

filter: Statementstmt 0.0% 0 / 29 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 9 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 56 CC 2 SCAR 11.0
CC
2
Cov
0%
detect
6.0
new
2.0
exec
2.0
CRAP 3.0
1 #
2 # (c) adjust GmbH
3 #
4 # vim: set ts=2 sw=2 tw=0:
5 # vim: set expandtab:
6  
7 package Rex::Interface::Shell::Ilo;
8  
9 # ABSTRACT: Rex module to support iLO
10  
11 use strict;
12 use warnings;
13  
14 our $VERSION = 'v0.1.0';
15  
16 use Rex::Interface::Shell::Default;
17 use base qw(Rex::Interface::Shell::Default);
18  
19 sub new {
20 my $class = shift;
21 my $proto = ref($class) || $class;
22 my $self = $proto->SUPER::new(@_);
23  
24 bless $self, $class;
25  
26 return $self;
27 }
28  
29 sub detect {
30 my ( $self, $con ) = @_;
31  
32 my ($output);
33 eval {
34 ($output) = $con->direct_exec('version');
35 1;
36 } or do {
37 return 0;
38 };
39 if ( $output && $output =~ m/SM-CLP Version/msx ) {
40 return 1;
41 }
42  
43 return 0;
44 }
45  
46 sub exec {
47 my ( $self, $cmd, $option ) = @_;
48 return $cmd;
49 }
50  
51 1;
52  
53 __END__