File Coverage

blib/lib/Armadito/Agent/Antivirus/Kaspersky.pm
Criterion Covered Total %
statement 15 39 38.4
branch 0 2 0.0
condition n/a
subroutine 5 11 45.4
pod 4 6 66.6
total 24 58 41.3


line stmt bran cond sub pod time code
1             package Armadito::Agent::Antivirus::Kaspersky;
2              
3 1     1   3450997 use strict;
  1         2  
  1         46  
4 1     1   10 use warnings;
  1         1  
  1         68  
5 1     1   3 use base 'Armadito::Agent::Antivirus';
  1         25  
  1         409  
6 1     1   5 use UNIVERSAL::require;
  1         1  
  1         10  
7 1     1   21 use English qw(-no_match_vars);
  1         1  
  1         4  
8              
9             sub new {
10 0     0 1   my ( $class, %params ) = @_;
11              
12 0           my $self = $class->SUPER::new(%params);
13              
14 0           $self->{name} = "Kaspersky";
15 0           $self->{program_path} = $self->getProgramPath();
16 0           $self->{scancli_path} = $self->{program_path} . "\\avp.com";
17 0           $self->{version} = $self->getVersion();
18              
19 0           return $self;
20             }
21              
22             sub getJobj {
23 0     0 1   my ($self) = @_;
24              
25             return {
26             name => $self->{name},
27             version => $self->{version},
28             os_info => $self->{os_info},
29             scancli_path => $self->{scancli_path}
30 0           };
31             }
32              
33             sub getVersion {
34 0     0 1   my ($self) = @_;
35              
36 0 0         if ( $self->{program_path} =~ m/Kaspersky Anti-Virus (.*)$/ ) {
37 0           return $1;
38             }
39              
40 0           return "unknown";
41             }
42              
43             sub getProgramPath {
44 0     0 1   my ($self) = @_;
45              
46 0           my $osclass = $self->getOSClass();
47 0           return $osclass->getProgramPath();
48             }
49              
50             sub getDataPath {
51 0     0 0   my ($self) = @_;
52              
53 0           my $osclass = $self->getOSClass();
54 0           return $osclass->getDataPath();
55             }
56              
57             sub getOSClass {
58 0     0 0   my ($self) = @_;
59              
60 0           my $class = "Armadito::Agent::Antivirus::Kaspersky::" . $self->{os_info}->{libpath};
61 0           $class->require();
62 0           my $osclass = $class->new( logger => $self->{logger}, antivirus => $self );
63              
64 0           return $osclass;
65             }
66              
67             1;
68              
69             __END__
70              
71             =head1 NAME
72              
73             Armadito::Agent::Kapersky - Kaspersky Antivirus' class.
74              
75             =head1 DESCRIPTION
76              
77             This is a base class for all stuff specific to Kaspersky Antivirus.
78              
79             =head1 FUNCTIONS
80              
81             =head2 new ( $self, %params )
82              
83             Instanciate module. Set task's default logger.
84              
85             =head2 getJobj ( $self )
86              
87             Return unblessed object for json encapsulation.
88              
89             =head2 getVersion ( $self )
90              
91             Return Antivirus' Version.
92              
93             =head2 getProgramPath ( $self )
94              
95             Return Antivirus' Program path.
96              
97