Branch Coverage

blib/lib/FusionInventory/Agent/Tools/Hardware.pm
Criterion Covered Total %
branch 0 378 0.0


line true false branch
250 0 0 if ($sysobjectid)
256 0 0 if $$match{'type'}
257 0 0 if $$match{'model'}
258 0 0 if $$match{'manufacturer'}
264 0 0 if ($sysdescr)
270 0 0 if ($result)
271 0 0 if $$result{'vendor'}
272 0 0 if $$result{'type'}
277 0 0 unless $sysdescr =~ /$$rule{'match'}/
278 0 0 if $$rule{'vendor'}
279 0 0 if $$rule{'type'}
286 0 0 unless (exists $$device{'TYPE'})
287 0 0 if ($snmp->get('.1.3.6.1.2.1.43.11.1.1.6.1.1') or $snmp->get('.1.3.6.1.2.1.25.3.2.1.3.1'))
296 0 0 unless (exists $$device{'MODEL'})
297 0 0 exists $$device{'TYPE'} && $$device{'TYPE'} eq 'PRINTER' ? :
300 0 0 if $model
304 0 0 unless (exists $$device{'MANUFACTURER'})
306 0 0 if $manufacturer
310 0 0 if (not exists $$device{'VENDOR'} and exists $$device{'MANUFACTURER'})
319 0 0 if (ref $$variable{'oid'} eq 'ARRAY') { }
322 0 0 if defined $raw_value
327 0 0 unless defined $raw_value
330 0 0 $type eq 'count' ? :
0 0 $type eq 'string' ? :
0 0 $type eq 'memory' ? :
336 0 0 if defined $value
340 0 0 if $mac
343 0 0 if $serial
346 0 0 if $firmware
350 0 0 if $results
359 0 0 unless $params{'id'}
361 0 0 unless %sysobjectid
372 0 0 unless ($manufacturer_id)
373 0 0 if $logger
378 0 0 unless ($device_id)
379 0 0 if $logger
388 0 0 if ($match)
389 0 0 if $logger
397 0 0 if ($match)
398 0 0 if $logger
407 0 0 if $logger
416 0 0 unless $params{'datadir'}
419 0 0 unless $handle
422 0 0 if $line =~ /^#/
423 0 0 if $line =~ /^$/
456 0 0 $type && $type eq 'PRINTER' ? :
0 0 $type && $type eq 'NETWORKING' ? :
463 0 0 unless $value
474 0 0 if ($entPhysicalSoftwareRev)
480 0 0 if $firmware
484 0 0 if ($entPhysicalFirmwareRev)
490 0 0 if $firmware
494 0 0 if $ios_version
497 0 0 if $firmware
509 0 0 if $address and $address =~ /^$FusionInventory::Agent::Tools::Hardware::mac_address_pattern$/
521 0 0 if @addresses and @addresses == 1
534 0 0 unless $info
538 0 0 if (exists $$info{'DESCRIPTION'})
545 0 0 if (exists $$info{'SNMPHOSTNAME'})
567 0 0 if $$info{'TYPE'} and $$info{'TYPE'} eq 'PRINTER'
574 0 0 if $$info{'TYPE'} and $$info{'TYPE'} eq 'NETWORKING'
583 0 0 if ($ports and %$ports) { }
609 0 0 unless $$variable{'oid'}
612 0 0 if (ref $$variable{'oid'} eq 'ARRAY') { }
615 0 0 if $results
620 0 0 unless $results
626 0 0 $type eq 'count' ? :
0 0 $type eq 'string' ? :
0 0 $type eq 'constant' ? :
0 0 $type eq 'mac' ? :
632 0 0 if defined $value
642 0 0 $highspeed_value ? :
652 0 0 unless $value
654 0 0 unless (exists $$ports{$value})
655 0 0 if $logger
660 0 0 unless ($suffix =~ /^$FusionInventory::Agent::Tools::Hardware::ip_address_pattern$/)
661 0 0 if $logger
692 0 0 unless defined $max and defined $current
699 0 0 if ($type_id != 1) { }
704 0 0 $description =~ /transfer/i ? :
0 0 $description =~ /fuser/i ? :
0 0 $description =~ /maintenance/i ? :
711 0 0 unless ($type)
712 0 0 if $logger
716 0 0 if ($type eq 'TONER' or $type eq 'DRUM' or $type eq 'CARTRIDGE' or $type eq 'DEVELOPER')
718 0 0 if ($color_id) { }
720 0 0 unless ($color)
721 0 0 if $logger
727 0 0 $description =~ /(black|noir)/i ? :
0 0 $description =~ /(yellow|jaune)/i ? :
0 0 $description =~ /magenta/i ? :
0 0 $description =~ /cyan/i ? :
738 0 0 if ($current == -2) { }
0 0 elsif ($current == -3) { }
746 0 0 if ($max != -2) { }
751 0 0 $unit_id == 4 ? :
0 0 $unit_id == 7 ? :
0 0 $unit_id == 8 ? :
0 0 $unit_id == 11 ? :
0 0 $unit_id == 13 ? :
0 0 $unit_id == 15 ? :
0 0 $unit_id == 16 ? :
0 0 $unit_id == 17 ? :
0 0 $unit_id == 18 ? :
0 0 $unit_id == 19 ? :
774 0 0 unless defined $value
775 0 0 unless (_isInteger($value))
776 0 0 if $logger
827 0 0 unless defined $value1 and _isInteger($value1)
828 0 0 unless defined $value2 and _isInteger($value2)
829 0 0 if $value1 == 0
843 0 0 unless $value
846 0 0 if ($value =~ /$FusionInventory::Agent::Tools::Hardware::mac_address_pattern/) { }
0 0 elsif ($value =~ /^\d{2}:\d{2}:\d{2}:\d{2}:\d{2}$/) { }
857 0 0 if ($value =~ /^0x[0-9A-F]{0,4}([0-9A-F]{12})$/i) { }
866 0 0 if $result eq '00:00:00:00:00:00'
874 0 0 unless $value
883 0 0 unless $value
892 0 0 unless $value
898 0 0 unless $value
906 0 0 if ($value =~ /^(\d+) KBytes$/) { }
916 0 0 if _isInteger($value)
917 0 0 if $value =~ /\((\d+)\)$/
923 0 0 _isInteger($value) ? :
954 0 0 if ($addresses)
969 0 0 if ($addresses) { }
982 0 0 if exists $$port{'CONNECTIONS'} and exists $$port{'CONNECTIONS'}{'CDP'} and $$port{'CONNECTIONS'}{'CDP'}
985 0 0 unless exists $$port{'VLANS'}
994 0 0 if $logger
1001 0 0 unless $mac_addresses
1009 0 0 if @vlans
1023 0 0 unless (exists $$ports{$port_id})
1024 0 0 if $logger
1035 0 0 if exists $$port{'CONNECTIONS'} and exists $$port{'CONNECTIONS'}{'CDP'} and $$port{'CONNECTIONS'}{'CDP'}
1042 0 0 if $$port{'MAC'}
1043 0 0 if exists $$port{'CONNECTIONS'} and exists $$port{'CONNECTIONS'}{'CONNECTION'} and exists $$port{'CONNECTIONS'}{'CONNECTION'}{'MAC'}
1051 0 0 unless @adresses
1078 0 0 unless defined $interface_id
1081 0 0 if @bytes > 6
1097 0 0 if ($lldp_info)
1100 0 0 unless (exists $$ports{$interface_id})
1101 0 0 if $logger
1118 0 0 if ($cdp_info)
1121 0 0 unless (exists $$ports{$interface_id})
1122 0 0 if $logger
1132 0 0 if ($lldp_connection) { }
1133 0 0 if ($$cdp_connection{'SYSDESCR'} eq $$lldp_connection{'SYSDESCR'}) { }
1156 0 0 if ($edp_info)
1159 0 0 unless (exists $$ports{$interface_id})
1160 0 0 if $logger
1170 0 0 if ($lldp_connection) { }
1171 0 0 if ($$edp_connection{'SYSDESCR'} eq $$lldp_connection{'SYSDESCR'}) { }
1217 0 0 unless $sysdescr
1227 0 0 if (not $portId =~ /^0x/ or length $portId != 14)
1232 0 0 if $ifdescr
1235 0 0 if $sysname
1238 0 0 $params{'vendor'} eq 'Juniper' ? :
0 0 !exists($$port2interface{$id}) ? :
1269 0 0 if $ip eq '0.0.0.0'
1273 0 0 unless $sysdescr and $model
1283 0 0 if ($devicePort =~ /^\d+$/) { }
1291 0 0 if ($deviceId =~ /^0x/) { }
1292 0 0 if (length $deviceId == 14) { }
1303 0 0 if ($$connection{'SYSNAME'} and $$connection{'SYSNAME'} =~ /^SIP([A-F0-9a-f]*)$/)
1310 0 0 if ($$results{$interface_id}) { }
1350 0 0 if $ip eq '0.0.0.0'
1365 0 0 if ($$results{$interface_id}) { }
1389 0 0 unless $vlans
1396 0 0 unless (exists $$ports{$port_id})
1397 0 0 if $logger
1438 0 0 unless $trunk_ports
1445 0 0 unless (exists $$ports{$port_id})
1446 0 0 if $logger
1468 0 0 if ($vlanStatus)
1470 0 0 $value == 1 ? :
1481 0 0 if ($accessMode)
1486 0 0 $value == 2 ? :
1497 0 0 if ($vlanId)
1500 0 0 !exists($$port2interface{$id}) ? :
1503 0 0 $value == 0 ? :
1518 0 0 if ($lacp_info)
1521 0 0 unless ($$ports{$interface_id})
1522 0 0 if $logger
1532 0 0 if ($pagp_info)
1535 0 0 unless ($$ports{$interface_id})
1536 0 0 if $logger
1556 0 0 if $aggregator_id == 0
1557 0 0 if $aggregator_id == $interface_id
1574 0 0 unless $portShortNum > 0