Branch Coverage

blib/lib/Captive/Portal/Role/Utils.pm
Criterion Covered Total %
branch 27 64 42.1


line true false branch
40 0 3 unless my $lookup_ip = shift()
43 3 0 if ($self->cfg->{'MOCK_MAC'})
50 0 0 unless open ARP, '<', '/proc/net/arp'
53 0 0 unless my(@proc_net_arp) =
79 0 0 unless defined $ip and defined $mac
87 0 0 if $mac
106 0 2 unless my $ip = shift()
124 0 6 unless my $ip = shift()
129 0 6 if scalar @octets != 4
148 0 5 unless my $user = $self->cfg->{'RUN_USER'}
151 0 5 unless my $group = $self->cfg->{'RUN_GROUP'}
160 0 5 if ($user =~ /^\d+$/) { }
169 0 5 unless (defined $uname and defined $uid)
177 0 5 if ($group =~ /^\d+$/) { }
186 0 5 unless (defined $gname and defined $gid)
192 5 0 if $> == $uid and $) == $gid
197 0 0 if $) != $gid
203 0 0 if $> != $uid
228 0 10 unless scalar @argv
237 2 8 if (ref $argv[-1] eq 'HASH')
253 0 10 unless open STDIN, '<&=0'
254 0 10 unless open STDOUT, '>>&=1'
255 0 10 unless open STDERR, '>>&=2'
274 3 6 if ($error)
285 2 4 if ($exit_code != 0)
288 0 2 unless grep {$exit_code == $_;} @{$$options{'ignore_exit_codes'};}
313 0 1 unless my(@hosts) = @_
320 0 1 if (not ref $host) { }
1 0 elsif (ref $host eq 'ARRAY') { }
336 0 0 if ($host =~ /^[.0-9]+$/)
344 0 0 unless ($hostent = gethost $host)
354 0 1 scalar @addr_list == 1 ? :