Module/Build/Service/slapd.pm

filter: Statementstmt 61.1% 22 / 36 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 40.0% 4 / 10 Podpod n/a totaltotal 49.0% 26 / 53 CC 3 SCAR 14.3
CC
3
Cov
54%
_build_data
12.0
_build_command
2.0
_build_config
2.0
CRAP 4.2
« Module/Build/Service/Fork.pm ↑ Summary Module/Build/Service.pm »
1 package Module::Build::Service::slapd;
2 {
3 1 $Module::Build::Service::slapd::VERSION = '0.91';
4 }
5 # ABSTRACT: Service implementation for slapd
6  
7 1 ▶use File::Path qw{make_path remove_tree};
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use File::Temp;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Log::Any qw{$log};
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 extends 'Module::Build::Service::Base';
12 1 with 'Module::Build::Service::Fork';
13  
14  
15 0 ▶sub _build_command {
Subroutine _build_command: not called CC=1 SCAR=6.9
16 0 my ($self) = @_;
17 0 [$self->bin, "-f", $self->config, "-h", $self->listen, "-dfilter,stats"];
18 }
19  
20  
21 1 has 'config' => (is => 'lazy');
22 0 ▶sub _build_config {
Subroutine _build_config: not called CC=1 SCAR=6.9
23 0 my ($self) = @_;
24 0 File::Spec->catfile ($self->_builder->base_dir, "t", "etc", "slapd.conf");
25 }
26  
27  
28 1 has 'data' => (is => 'lazy');
29 0 ▶sub _build_data {
Subroutine _build_data: not called CC=3 SCAR=24.8
30 0 my ($self) = @_;
31 0 my $dir = File::Spec->catdir ($self->_builder->mbs_data_dir, "slapd");
32 0 $log->tracef ("%s creating data directory %s", $self->service_name, $dir);
33 0 ▶ -d $dir or make_path ($dir) or die "Couldn't create data directory " . $dir;
Branch: 1 branch
BranchTrueFalseTotal
-d $dir or make_path($dir) or die q[Couldn't create data directory ] . $dir 0 0 0
Condition0%0/3
-d $dir or make_path($dir)
l!l&&r!l&&!r
000
MC/DC0%0/2
-d $dir or make_path($dir)
-d $dir make_path($dir)
Truth table0%0/3
A or B
A= -d $dirB= make_path($dir)
ABresult
1X1
011
000
34 0 $dir
35 }
36  
37  
38 1 has 'dump' => (is => 'lazy');
39 0 ▶sub _build_dump {
Subroutine _build_dump: not called CC=1 SCAR=6.9
40 0 my ($self) = @_;
41 0 File::Spec->catfile ($self->_builder->mbs_log_dir, "slapd.ldif");
42 }
43  
44  
45 1 has 'listen' => (is => 'lazy');
46 0 ▶sub _build_listen { 'ldapi://slapd' }
Subroutine _build_listen: not called CC=1 SCAR=6.9
47  
48  
49 0 ▶before 'stop_service' => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
50 0 my ($self) = @_;
51 0 $self->run_process ("/usr/sbin/slapcat", "-f", $self->config, "-l", $self->dump);
52 1 };
53  
54 1 1;
55  
56 __END__
« Module/Build/Service/Fork.pm ↑ Summary Module/Build/Service.pm »