Branch Coverage

lib/Rex/Hardware/Network/Linux.pm
Criterion Covered Total %
branch 38 90 42.2


line true false branch
19 9 0 unless (can_run("brctl"))
32 0 0 if ($line =~ /^[A-Za-z0-9_.]+/u)
41 0 0 if ($dev)
51 9 0 can_run('ip') ? :
54 9 0 $command eq 'ip addr show' ? :
67 9 0 can_run('ip') ? :
72 9 0 $command eq 'ip addr show' ? :
78 0 27 if (exists $br_data->{$dev}) { }
96 6 43 if ($line =~ /^([a-zA-Z0-9:\._]+)/u)
98 3 3 if $new_dev =~ /:$/u
100 2 4 if ($cur_dev and $cur_dev ne $new_dev)
104 4 2 unless ($cur_dev)
115 4 45 if ($line =~ /(ether|HWaddr) (..:..:..:..:..:..)/u)
119 5 44 if ($line =~ /inet( addr:| )?(\d+\.\d+\.\d+\.\d+)/u)
123 5 44 if ($line =~ /(netmask |Mask:)(\d+\.\d+\.\d+\.\d+)/u)
127 3 46 if ($line =~ /(broadcast |Bcast:)(\d+\.\d+\.\d+\.\d+)/u)
144 45 146 if ($line =~ /^\d+:\s*([^\s]+):/u)
147 21 24 if ($cur_dev and $cur_dev ne $new_dev)
151 24 21 unless ($cur_dev)
163 23 123 if ($line =~ m[^\s*link/ether (..:..:..:..:..:..)]u)
174 45 101 if ($line =~ m[^\s*inet (\d+\.\d+\.\d+\.\d+)/(\d+) (brd (\d+\.\d+\.\d+\.\d+) )?scope ([^\s]+) (\w+\s)?(.+?)$]u)
185 19 26 if ($scope eq 'global' and $dev_name ne $cur_dev) { }
1 25 elsif ($dev_name eq $cur_dev and $dev->{$cur_dev}{'ip'}) { }
211 1 145 if ($line =~ m[^\s*inet (\d+\.\d+\.\d+\.\d+) peer (\d+\.\d+\.\d+\.\d+)/(\d+)]u)
227 0 0 if ($? != 0)
259 0 0 if ($new_default_gw) { }
260 0 0 if (default_gateway())
262 0 0 if ($? != 0)
268 0 0 if ($? != 0)
279 0 0 if $_->{'flags'} =~ /UG/u
281 0 0 if $default_route
289 0 0 if ($? != 0)
294 0 0 if ($in_inet == 1)
295 0 0 if ($in_unix == 1)
296 0 0 if ($line =~ /^Active Internet/u)
303 0 0 if ($line =~ /^Active UNIX/u)
310 0 0 if ($line =~ /^Active/u)
317 0 0 if ($in_unknown)
321 0 0 if ($in_inet)
325 0 0 if ($line =~ /^udp/u) { }
339 0 0 if ($pid =~ /^-/u)
363 0 0 if ($in_unix)
367 0 0 if ($line =~ m(^([a-z]+)\s+(\d+)\s+\[([^\]]+)\]\s+([a-z]+)\s+([a-z]+)?\s+(\d+)\s+(\d+)/([^\s]+)\s+(.*)$)iu) { }
386 0 0 if $state
387 0 0 if $flags