Branch Coverage

blib/lib/Test/Rsyslog.pm
Criterion Covered Total %
branch 21 40 52.5


line true false branch
30 6 0 if ($handle) { }
0 0 elsif ($Test::Rsyslog::OS_ERROR == 2) { }
35 3 21 if ($line =~ /$quoted/msx)
57 0 4 unless mkdir $self->{'_root_directory'}, oct _USER_READ_WRITE_EXECUTE_PERMISSIONS()
68 0 4 unless my $config_handle = 'FileHandle'->new($self->{'_config_path'}, 193, oct _USER_READ_WRITE_PERMISSIONS())
73 0 4 unless $config_handle->print("\$ModLoad imuxsock\n\$InputUnixListenSocketCreatePath on\n\$AddUnixListenSocket $self->{'_socket_path'}\n\$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat\n\$OmitLocalLogging off\n*.* $self->{'_messages_path'}\n")
82 0 4 unless $config_handle->close
91 0 9 if (defined $self->{'_pid'} and kill 0, $self->{'_pid'})
95 6 3 if ($self->{'_pid'} = fork) { }
3 0 elsif (defined $self->{'_pid'}) { }
110 0 3 unless open STDERR, '>', $dev_null
112 0 3 unless open STDOUT, '>', $dev_null
117 0 0 unless exec {'rsyslogd';} 'rsyslogd', '-n', '-d', '-f', $self->{'_config_path'}, '-i', $self->{'_pid_path'}
118 0 0 unless (eval { do { local(%ENV) = %ENV; local $ENV{'PATH'} = '/usr/bin:/usr/sbin:/sbin:/bin:'; delete $ENV{'BASH_ENV'}; delete $ENV{'ENV'}; delete $ENV{'IFS'}; delete $ENV{'CDPATH'}; die "Failed to redirect STDERR:$Test::Rsyslog::OS_ERROR\n" unless open STDERR, '>', $dev_null; die "Failed to redirect STDOUT:$Test::Rsyslog::OS_ERROR\n" unless open STDOUT, '>', $dev_null; die "Failed to exec 'rsyslogd':$Test::Rsyslog::OS_ERROR\n" unless exec {'rsyslogd';} 'rsyslogd', '-n', '-d', '-f', $self->{'_config_path'}, '-i', $self->{'_pid_path'} } })
132 7 0 if ($self->{'_pid'})
141 6 1 if (kill $signals_by_name{'TERM'}, $self->{'_pid'}) { }
1 0 elsif ($Test::Rsyslog::OS_ERROR == 3) { }
157 4 2 if ($key =~ /_path$/msx)
158 0 4 unless unlink $self->{$key} or $Test::Rsyslog::OS_ERROR == 2
164 0 1 unless rmdir $self->{'_root_directory'} or $Test::Rsyslog::OS_ERROR == 2