Branch Coverage

blib/lib/Cisco/Management.pm
Criterion Covered Total %
branch 14 496 2.8


line true false branch
87 0 0 if (@_ == 1) { }
92 0 0 if (/^-?port$/i) { }
0 0 elsif (/^-?community$/i) { }
0 0 elsif (/^-?family$/i) { }
0 0 elsif (/^-?hostname$/i or /^-?(?:de?st|peer)?addr$/i) { }
0 0 elsif (/^-?timeout$/i) { }
0 0 elsif (/^-?version$/i) { }
97 0 0 if ($args{$_} =~ /^(?:(?:(:?ip)?v?(?:4|6))|${\2;}|$AF_INET6)$/) { }
98 0 0 if ($args{$_} =~ /^(?:(?:(:?ip)?v?4)|${\2;})$/) { }
123 0 0 if ($params{'version'} <= 2 and not defined $params{'community'})
128 0 0 unless (defined $params{'hostname'})
133 0 0 if (defined(my $ret = _resolv($params{'hostname'}, $family))) { }
136 0 0 if ($family == 2) { }
147 0 0 unless (defined $session)
173 0 0 if $key =~ /^\_.+\_$/
186 0 0 if (@_ == 1) { }
192 0 0 if (/^-?(?:tftp)?server$/i or /^-?tftp$/) { }
0 0 elsif (/^-?catos$/i) { }
0 0 elsif (/^-?timeout$/i) { }
0 0 elsif (/^-?family$/i) { }
0 0 elsif (/^-?source$/i) { }
0 0 elsif (/^-?dest(?:ination)?$/i) { }
195 0 0 if ($args{$_} == 1)
201 0 0 if ($args{$_} =~ /^(?:(?:(:?ip)?v?(?:4|6))|${\2;}|$AF_INET6)$/) { }
202 0 0 if ($args{$_} =~ /^(?:(?:(:?ip)?v?4)|${\2;})$/) { }
212 0 0 if ($args{$_} =~ /^run(?:ning)?(?:-config)?$/i) { }
0 0 elsif ($args{$_} =~ /^start(?:up)?(?:-config)?$/i) { }
222 0 0 if ($args{$_} =~ /^run(?:ning)?(?:-config)?$/i) { }
0 0 elsif ($args{$_} =~ /^start(?:up)?(?:-config)?$/i) { }
236 0 0 if ($params{'source'} == $params{'dest'})
242 0 0 if ($params{'op'} ne 'wr' and not defined $params{'tftpserver'})
247 0 0 unless (defined $params{'family'})
252 0 0 if (defined $params{'tftpserver'})
253 0 0 if (defined(my $ret = _resolv($params{'tftpserver'}, $params{'family'}))) { }
259 0 0 if ($params{'catos'} and $params{'family'} == $AF_INET6)
280 0 0 if ($params{'op'} eq 'wr') { }
281 0 0 if ($params{'catos'})
288 0 0 unless (defined $response)
291 0 0 if (defined $response) { }
307 0 0 if ($response == 0) { }
0 0 elsif ($response == -1) { }
320 0 0 unless (defined $response)
329 0 0 unless (defined $response)
333 0 0 if ($loop++ == $params{'timeout'})
341 0 0 if ($$response{'1.3.6.1.4.1.9.9.96.1.1.1.1.10.' . $instance} == 3) { }
0 0 elsif ($$response{'1.3.6.1.4.1.9.9.96.1.1.1.1.10.' . $instance} == 4) { }
378 0 0 if ($cpu5min = &_snmpgetnext($session, '1.3.6.1.4.1.9.2.1.58') and defined $$cpu5min[0]) { }
0 0 elsif ($cpu5min = &_snmpgetnext($session, '1.3.6.1.4.1.9.9.109.1.1.1.1.5') and defined $$cpu5min[0]) { }
0 0 elsif ($cpu5min = &_snmpgetnext($session, '1.3.6.1.4.1.9.9.109.1.1.1.1.8') and defined $$cpu5min[0]) { }
399 0 0 if ($type > 1)
402 0 0 if (defined(my $result = $session->get_request(-'varbindlist', ['1.3.6.1.2.1.47.1.1.1.1.7.' . $$temp[$_]]))) { }
412 0 0 if ($type == 1) { }
0 0 elsif ($type == 2) { }
0 0 elsif ($type == 3) { }
447 0 0 if (@_ == 1) { }
449 0 0 unless ($uIfx =~ /^\d+$/)
456 0 0 if (/^-?interface$/i or /^-?index$/i)
457 0 0 if ($args{$_} =~ /^\d+$/) { }
466 0 0 unless (defined $uIfx)
471 0 0 unless (defined $rIf)
478 0 0 if ($$rIfx[$_] == $uIfx)
497 0 0 if (@_ == 1) { }
502 0 0 if (/^-?interface$/i) { }
0 0 elsif (/^-?index$/i) { }
505 0 0 if ($args{$_} == 1)
511 0 0 unless (exists $params{'uIf'})
517 0 0 unless (defined $rIf)
537 0 0 if ($rIfNamePart =~ /^$uIfNamePart/i and $rIfNumPart eq $uIfNumPart)
542 0 0 if (@matches == 1) { }
0 0 elsif (@matches == 0) { }
543 0 0 if ($params{'index'} == 0) { }
568 0 0 if (@_ == 1) { }
570 0 0 unless (defined($params{'ifs'} = _get_range($params{'ifs'})))
576 0 0 if (/^-?interface(?:s)?$/i)
577 0 0 unless (defined($params{'ifs'} = _get_range($args{$_})))
588 0 0 if ($ifs == -1) { }
597 0 0 unless (defined $ret{$IFKEYS[$oid - 1]})
634 0 0 $ret{$IFKEYS[5]}[$idx] =~ /^0x/ ? :
0 0 $ret{$IFKEYS[5]}[$idx] =~ /^\0/ ? :
635 0 0 exists $UpDownStatus{$ret{$IFKEYS[6]}[$idx]} ? :
636 0 0 exists $UpDownStatus{$ret{$IFKEYS[7]}[$idx]} ? :
639 0 0 if (exists $duplexIfs{$ret{$IFKEYS[0]}[$idx]}) { }
640 0 0 exists $DuplexType{$duplexIfs{$ret{$IFKEYS[0]}[$idx]}} ? :
658 0 0 unless (defined $IPIndex)
684 0 0 if (defined $arg and $arg >= 1) { }
709 0 0 if (@_ == 1) { }
711 0 0 unless (defined($params{'ifs'} = _get_range($params{'ifs'})))
717 0 0 if (/^-?interface(?:s)?$/i) { }
0 0 elsif (/^-?metric(?:s)?$/i) { }
718 0 0 unless (defined($params{'ifs'} = _get_range($args{$_})))
726 0 0 if (ref $args{$_} eq 'ARRAY') { }
729 0 0 if (exists $params{ucfirst lc $mets}) { }
738 0 0 if (exists $params{ucfirst lc $args{$_}}) { }
753 0 0 if ($ifs == -1) { }
761 0 0 unless (defined $ret{'Index'})
766 0 0 if ($params{$IFMETRICUSERKEYS[0]})
769 0 0 unless (defined $ret{$IFMETRICKEYS[0]})
775 0 0 unless (defined $ret{$IFMETRICKEYS[1]})
781 0 0 if ($params{$IFMETRICUSERKEYS[1]})
784 0 0 unless (defined $ret{$IFMETRICKEYS[2]})
790 0 0 unless (defined $ret{$IFMETRICKEYS[3]})
796 0 0 if ($params{$IFMETRICUSERKEYS[2]})
799 0 0 unless (defined $ret{$IFMETRICKEYS[4]})
805 0 0 unless (defined $ret{$IFMETRICKEYS[5]})
811 0 0 if ($params{$IFMETRICUSERKEYS[3]})
814 0 0 unless (defined $ret{$IFMETRICKEYS[6]})
820 0 0 unless (defined $ret{$IFMETRICKEYS[7]})
826 0 0 if ($params{$IFMETRICUSERKEYS[4]})
829 0 0 unless (defined $ret{$IFMETRICKEYS[8]})
835 0 0 unless (defined $ret{$IFMETRICKEYS[9]})
841 0 0 if ($params{$IFMETRICUSERKEYS[5]})
844 0 0 unless (defined $ret{$IFMETRICKEYS[10]})
850 0 0 unless (defined $ret{$IFMETRICKEYS[11]})
856 0 0 if ($params{$IFMETRICUSERKEYS[6]})
859 0 0 unless (defined $ret{$IFMETRICKEYS[12]})
897 0 0 if (@_ != 1)
900 0 0 if (/^-?polling$/i or /^-?interval$/i) { }
0 0 elsif (/^-?recursive$/i) { }
901 0 0 if ($args{$_} =~ /^\d+$/ and $args{$_} > 0) { }
914 0 0 if (exists $params{'recur'} and ref $params{'recur'} eq 'Cisco::Management') { }
917 0 0 unless (defined($prev = $self->interface_metrics(@_)))
924 0 0 unless (defined($curr = $self->interface_metrics(@_)))
932 0 0 defined $$curr{$ifs}{$IFMETRICKEYS[0]} ? :
933 0 0 defined $$curr{$ifs}{$IFMETRICKEYS[1]} ? :
934 0 0 defined $$curr{$ifs}{$IFMETRICKEYS[2]} ? :
935 0 0 defined $$curr{$ifs}{$IFMETRICKEYS[3]} ? :
936 0 0 defined $$curr{$ifs}{$IFMETRICKEYS[4]} ? :
937 0 0 defined $$curr{$ifs}{$IFMETRICKEYS[5]} ? :
938 0 0 defined $$curr{$ifs}{$IFMETRICKEYS[6]} ? :
939 0 0 defined $$curr{$ifs}{$IFMETRICKEYS[7]} ? :
940 0 0 defined $$curr{$ifs}{$IFMETRICKEYS[8]} ? :
941 0 0 defined $$curr{$ifs}{$IFMETRICKEYS[9]} ? :
942 0 0 defined $$curr{$ifs}{$IFMETRICKEYS[10]} ? :
943 0 0 defined $$curr{$ifs}{$IFMETRICKEYS[11]} ? :
944 0 0 defined $$curr{$ifs}{$IFMETRICKEYS[12]} ? :
948 0 0 wantarray ? :
967 0 0 if (@_ == 1) { }
969 0 0 unless (defined($params{'ifs'} = _get_range($params{'ifs'})))
975 0 0 if (/^-?interface(?:s)?$/i) { }
0 0 elsif (/^-?operation$/i or /^-?command$/i) { }
976 0 0 unless (defined($params{'ifs'} = _get_range($args{$_})))
980 0 0 if (exists $op{uc $args{$_}}) { }
991 0 0 unless (defined $params{'ifs'})
993 0 0 unless (defined $params{'ifs'})
1001 0 0 if (defined $session->set_request('1.3.6.1.2.1.2.2.1.7.' . $_, INTEGER(), $params{'oper'})) { }
1019 0 0 if (@_ == 1) { }
1021 0 0 unless (defined($params{'lines'} = _get_range($params{'lines'})))
1027 0 0 if (/^-?range$/i or /^-?line(?:s)?$/i)
1028 0 0 unless (defined($params{'lines'} = _get_range($args{$_})))
1035 0 0 unless (defined $params{'lines'})
1037 0 0 unless (defined $params{'lines'})
1045 0 0 if (defined $session->set_request('1.3.6.1.4.1.9.2.9.10.0', INTEGER(), $_)) { }
1064 0 0 unless (defined $ret{$LINEKEYS[$oid - 1]})
1111 0 0 exists $LineModem{$ret{$LINEKEYS[6]}[$lines]} ? :
1112 0 0 exists $LineFlow{$ret{$LINEKEYS[5]}[$lines]} ? :
1116 0 0 exists $LineTypes{$ret{$LINEKEYS[1]}[$lines]} ? :
1132 0 0 unless (defined $ret{$SESSIONKEYS[$oid - 1]})
1164 0 0 exists $SessionDir{$ret{$SESSIONKEYS[1]}[$sess]} ? :
1165 0 0 exists $SessionTypes{$ret{$SESSIONKEYS[0]}[$sess]} ? :
1183 0 0 if (@_ == 1) { }
1188 0 0 if (/^-?message$/i) { }
0 0 elsif (/^-?line(?:s)?$/i) { }
1191 0 0 unless (defined($params{'lines'} = _get_range($args{$_})))
1213 0 0 if (defined $response) { }
1222 0 0 if ($lines[0] == -1)
1233 0 0 if (not defined($response = $session->get_request(-'varbindlist', ['1.3.6.1.4.1.9.2.9.1.0']))) { }
1251 0 0 unless (defined $ret{$MEMKEYS[$oid - 2]})
1262 0 0 $ret{$MEMKEYS[2]}[$mem] == 1 ? :
1281 0 0 if $key =~ /^\_.+\_$/
1292 0 0 if (@_ == 1) { }
1297 0 0 if (/^-?host(?:name)?$/i or /^-?dest(?:ination)?$/i) { }
0 0 elsif (/^-?size$/i) { }
0 0 elsif (/^-?family$/i) { }
0 0 elsif (/^-?count$/i) { }
0 0 elsif (/^-?wait$/i or /^-?timeout$/i) { }
0 0 elsif (/^-?vrf(?:name)?$/i) { }
1300 0 0 if ($args{$_} =~ /^\d+$/) { }
1307 0 0 if ($args{$_} =~ /^(?:(?:(:?ip)?v?(?:4|6))|${\2;}|$AF_INET6)$/) { }
1308 0 0 if ($args{$_} =~ /^(?:(?:(:?ip)?v?4)|${\2;})$/) { }
1318 0 0 if ($args{$_} =~ /^\d+$/) { }
1325 0 0 if ($args{$_} =~ /^\d+$/) { }
1339 0 0 unless (defined $params{'host'})
1344 0 0 unless (defined $params{'family'})
1349 0 0 if (defined(my $ret = _resolv($params{'host'}, $params{'family'}))) { }
1359 0 0 unless (defined $response)
1366 0 0 if ($params{'family'} == 2) { }
1371 0 0 if ($HAVE_Net_IPv6Addr) { }
1387 0 0 $params{'family'} == 2 ? :
1388 0 0 unless (defined $response)
1403 0 0 if (exists $params{'vrf'})
1409 0 0 if (defined $$response{'1.3.6.1.4.1.9.9.16.1.1.1.16.' . $instance}) { }
1410 0 0 if ($$response{'1.3.6.1.4.1.9.9.16.1.1.1.16.' . $instance} != 2)
1472 0 0 if $key =~ /^\_.+\_$/
1477 0 0 if (defined $response) { }
1479 0 0 if (defined $$response[0])
1480 0 0 if (defined $$response[1])
1481 0 0 if (defined $$response[2])
1482 0 0 if (defined $$response[3])
1483 0 0 if (defined $$response[4])
1484 0 0 if (defined $$response[5])
1485 0 0 if (defined $$response[6])
1527 0 0 if (defined $arg and $arg >= 1) { }
1541 0 0 if $$self{'_SYSINFO_'}{'Services'} & int $_
1550 0 0 if ($$self{'_SYSINFO_'}{'Description'} =~ /Version ([^ ,\n\r]+)/) { }
1566 0 0 if $key =~ /^\_.+\_$/
1573 0 0 unless (defined $ret{$INVENTORYKEYS[$oid - 2]})
1613 0 53 if ($self ne 'Cisco::Management') { }
1619 53 0 if ($passwd =~ /^[\da-f]+$/i and length $passwd > 2)
1620 53 0 unless (length $passwd & 1)
1626 4 261 if ($s > $#xlat)
1643 0 3 if ($self ne 'Cisco::Management') { }
1653 2 1 if (defined $index)
1654 1 1 if ($index =~ /^\d+$/) { }
0 1 elsif ($index eq '') { }
1655 0 1 if ($index < 0 or $index > $#xlat) { }
1678 4 271 if ($s > $#xlat)
1735 0 0 if ($$params{'catos'}) { }
1739 0 0 if ($$params{'op'} eq 'put') { }
1750 0 0 if ($loop++ == $$params{'timeout'})
1757 0 0 if ($$response{'1.3.6.1.4.1.9.5.1.5.5.0'} == 2) { }
1773 0 0 unless (defined $response)
1775 0 0 if ($$params{'family'} == $AF_INET6)
1779 0 0 if ($$params{'op'} eq 'put') { }
1784 0 0 if (defined $response) { }
1793 0 0 if ($$params{'op'} eq 'put') { }
1802 0 0 $$params{'family'} == 2 ? :
1804 0 0 if (defined $response) { }
1810 0 0 if ($$params{'family'} == $AF_INET6)
1827 0 0 unless ($opt =~ /^\d+([\,\-]\d+)*$/)
1842 0 0 if ($opt =~ /-/) { }
1872 0 0 if (oid_base_match($base, $o)) { }
1880 0 0 if (@oids == 0 and @vals == 0)
1881 0 0 if (defined($result = $session->get_request($oid))) { }
1908 0 0 unless (defined $family)
1919 0 0 if ($cnt == 0) { }
0 0 elsif ($cnt == 1) { }
0 0 elsif ($cnt >= 2) { }
1927 0 0 if ($name =~ /^\[.*\]:\d{1,5}$/) { }
1939 0 0 if (defined $h{'port'} and !($h{'port'} =~ /^\d{1,5}$/) || $h{'port'} < 1 || $h{'port'} > 65535)
1947 0 0 if ($Socket::VERSION >= 1.94) { }
1956 0 0 if (defined $getaddr[0])
1965 0 0 if (defined $ret and inet_ntoa($ret) eq $h{'host'})
1974 0 0 if ($Socket::VERSION >= 1.94) { }
1981 0 0 if (defined $getaddr[0]) { }
1983 0 0 if (defined $address) { }
1993 0 0 $family == 2 ? :
1998 0 0 if ($family == $AF_INET6)
2004 0 0 if (defined $gethost[4]) { }