Branch Coverage

blib/lib/FusionInventory/Agent/Tools/Unix.pm
Criterion Covered Total %
branch 40 64 62.5


line true false branch
30 0 0 unless $params{'device'}
33 0 0 getFirstLine('command', '/sbin/fdisk -v') =~ /^GNU/ ? :
42 0 0 if $capacity
52 0 0 unless $dhcpLeaseFile
70 0 0 unless -d $directory
79 0 0 unless @files
97 0 2 unless $handle
103 4 56 if ($line =~ /^lease/i)
107 4 52 if ($line =~ /^}/)
112 0 52 unless $lease
115 4 48 if ($line =~ /interface\s+"([^"]+)"/)
120 0 48 unless $dhcp
122 4 44 if ($line =~ /option \s+ dhcp-server-identifier \s+ (\d{1,3}(?:\.\d{1,3}){3})/x) { }
4 40 elsif ($line =~ m[expire \s+ \d \s+ (\d+)/(\d+)/(\d+) \s+ (\d+):(\d+):(\d+)]x) { }
141 0 2 unless $expiration_time
145 2 0 $current_time <= $expiration_time ? :
156 0 5 unless $line
169 8 16 if ($headers[1] eq 'Type') { }
182 1 23 if not $total =~ /^\d+$/ or $total == 0
183 3 20 if not $free =~ /^\d+$/ or $free == 0
206 0 3 unless $handle
212 5 12 if ($line =~ /^\S+ on \S+ \((\w+)/)
218 8 4 if ($line =~ /^\S+ on \S+ type (\w+)/)
252 0 149 unless $line =~ /^ \s* (\S+) \s+ (\S+) \s+ (\S+) \s+ ... \s+ (\S.+) /x
279 0 2 $FusionInventory::Agent::Tools::Unix::OSNAME eq 'solaris' ? :
298 0 166 unless $line =~ /^ \s* (\S+) \s+ (\S+) \s+ (\S+) \s+ (\S+) \s+ (\S+) \s+ (\S+) \s+ (\S+) \s+ (\S.*\S) /x
373 0 166 unless defined $psec and defined $pmin
376 148 18 $phour ? :
44 122 $pday ? :
399 0 10 unless $handle
405 10 16 if $line =~ /^Destination/
410 23 102 unless $line =~ /^ ( $FusionInventory::Agent::Tools::Unix::ip_address_pattern | $FusionInventory::Agent::Tools::Unix::network_pattern | default ) \s+ ( $FusionInventory::Agent::Tools::Unix::ip_address_pattern | $FusionInventory::Agent::Tools::Unix::mac_address_pattern | link\#\d+ ) /x