Add Layer7::Arbor test class

POD updates
This commit is contained in:
Eric A. Miller
2018-04-16 23:29:24 -04:00
parent 9e7f7f734e
commit 1fdc486cd5
8 changed files with 148 additions and 19 deletions

View File

@@ -1,6 +1,7 @@
Version 3.55 Version 3.55
[NEW FEATURES] [NEW FEATURES]
* #258 Add support for Arbor devices (robwwd)
* #253 Nexans switch support (paecker) * #253 Nexans switch support (paecker)
* #142 Sixnet Switch Support * #142 Sixnet Switch Support

View File

@@ -257,6 +257,7 @@ xt/lib/Test/SNMP/Info/Layer3/VMware.pm
xt/lib/Test/SNMP/Info/Layer3/VyOS.pm xt/lib/Test/SNMP/Info/Layer3/VyOS.pm
xt/lib/Test/SNMP/Info/Layer7.pm xt/lib/Test/SNMP/Info/Layer7.pm
xt/lib/Test/SNMP/Info/Layer7/APC.pm xt/lib/Test/SNMP/Info/Layer7/APC.pm
xt/lib/Test/SNMP/Info/Layer7/Arbor.pm
xt/lib/Test/SNMP/Info/Layer7/CiscoIPS.pm xt/lib/Test/SNMP/Info/Layer7/CiscoIPS.pm
xt/lib/Test/SNMP/Info/Layer7/Gigamon.pm xt/lib/Test/SNMP/Info/Layer7/Gigamon.pm
xt/lib/Test/SNMP/Info/Layer7/Neoteris.pm xt/lib/Test/SNMP/Info/Layer7/Neoteris.pm

View File

@@ -255,10 +255,18 @@
"file" : "lib/SNMP/Info/Layer2/Netgear.pm", "file" : "lib/SNMP/Info/Layer2/Netgear.pm",
"version" : "3.54" "version" : "3.54"
}, },
"SNMP::Info::Layer2::Nexans" : {
"file" : "lib/SNMP/Info/Layer2/Nexans.pm",
"version" : "3.54"
},
"SNMP::Info::Layer2::Orinoco" : { "SNMP::Info::Layer2::Orinoco" : {
"file" : "lib/SNMP/Info/Layer2/Orinoco.pm", "file" : "lib/SNMP/Info/Layer2/Orinoco.pm",
"version" : "3.54" "version" : "3.54"
}, },
"SNMP::Info::Layer2::Sixnet" : {
"file" : "lib/SNMP/Info/Layer2/Sixnet.pm",
"version" : "3.54"
},
"SNMP::Info::Layer2::Trapeze" : { "SNMP::Info::Layer2::Trapeze" : {
"file" : "lib/SNMP/Info/Layer2/Trapeze.pm", "file" : "lib/SNMP/Info/Layer2/Trapeze.pm",
"version" : "3.54" "version" : "3.54"

View File

@@ -178,9 +178,15 @@ provides:
SNMP::Info::Layer2::Netgear: SNMP::Info::Layer2::Netgear:
file: lib/SNMP/Info/Layer2/Netgear.pm file: lib/SNMP/Info/Layer2/Netgear.pm
version: '3.54' version: '3.54'
SNMP::Info::Layer2::Nexans:
file: lib/SNMP/Info/Layer2/Nexans.pm
version: '3.54'
SNMP::Info::Layer2::Orinoco: SNMP::Info::Layer2::Orinoco:
file: lib/SNMP/Info/Layer2/Orinoco.pm file: lib/SNMP/Info/Layer2/Orinoco.pm
version: '3.54' version: '3.54'
SNMP::Info::Layer2::Sixnet:
file: lib/SNMP/Info/Layer2/Sixnet.pm
version: '3.54'
SNMP::Info::Layer2::Trapeze: SNMP::Info::Layer2::Trapeze:
file: lib/SNMP/Info/Layer2/Trapeze.pm file: lib/SNMP/Info/Layer2/Trapeze.pm
version: '3.54' version: '3.54'

43
README
View File

@@ -23,14 +23,14 @@ DEVICES SUPPORTED
SYNOPSIS SYNOPSIS
use SNMP::Info; use SNMP::Info;
my $info = new SNMP::Info( my $info = new SNMP::Info(
# Auto Discover more specific Device Class # Auto Discover more specific Device Class
AutoSpecify => 1, AutoSpecify => 1,
Debug => 1, Debug => 1,
# The rest is passed to SNMP::Session # The rest is passed to SNMP::Session
DestHost => 'router', DestHost => 'router',
Community => 'public', Community => 'public',
Version => 2 Version => 2
) or die "Can't connect to device.\n"; ) or die "Can't connect to device.\n";
my $err = $info->error(); my $err = $info->error();
@@ -61,7 +61,7 @@ SYNOPSIS
# The CDP Table has table entries different than the interface tables. # The CDP Table has table entries different than the interface tables.
# So we use c_if to get the map from cdp table to interface table. # So we use c_if to get the map from cdp table to interface table.
my %c_map = reverse %$c_if; my %c_map = reverse %$c_if;
my $c_key = $c_map{$iid}; my $c_key = $c_map{$iid};
unless (defined $c_key) { unless (defined $c_key) {
print "\n\n"; print "\n\n";
@@ -515,6 +515,11 @@ SUBCLASSES
See documentation in SNMP::Info::Layer2::Netgear for details. See documentation in SNMP::Info::Layer2::Netgear for details.
SNMP::Info::Layer2::Nexans
Subclass for Nexans switches
See documetion in SNMP::Info::Layer2::Nexans for details.
SNMP::Info::Layer2::NWSS2300 SNMP::Info::Layer2::NWSS2300
SNMP Interface to Avaya (Trapeze) Wireless Controllers SNMP Interface to Avaya (Trapeze) Wireless Controllers
@@ -530,6 +535,11 @@ SUBCLASSES
See documentation in SNMP::Info::Layer2::Trapeze for details. See documentation in SNMP::Info::Layer2::Trapeze for details.
SNMP::Info::Layer2::Sixnet
SNMP Interface to Sixnet industrial switches
See documentation in SNMP::Info::Layer2::Sixnet for details.
SNMP::Info::Layer2::Ubiquiti SNMP::Info::Layer2::Ubiquiti
SNMP Interface to Ubiquiti Access Points and other devices SNMP Interface to Ubiquiti Access Points and other devices
@@ -650,9 +660,9 @@ SUBCLASSES
See documentation in SNMP::Info::Layer3::DLink for details. See documentation in SNMP::Info::Layer3::DLink for details.
SNMP::Info::Layer3::Dell SNMP::Info::Layer3::Dell
Subclass for Dell PowerConnect switches. D-Link, the IBM Subclass for Dell PowerConnect switches. The IBM BladeCenter
BladeCenter Gigabit Ethernet Switch Module and some Linksys Gigabit Ethernet Switch Module and some Linksys switches also
switches also use this module based upon MIB support. use this module based upon MIB support.
See documentation in SNMP::Info::Layer3::Dell for details. See documentation in SNMP::Info::Layer3::Dell for details.
@@ -820,6 +830,11 @@ SUBCLASSES
See documentation in SNMP::Info::Layer7::APC for details. See documentation in SNMP::Info::Layer7::APC for details.
SNMP::Info::Layer7::Arbor
Subclass for Arbor appliances
See documentation in SNMP::Info::Layer7::Arbor for details.
SNMP::Info::Layer7::CiscoIPS SNMP::Info::Layer7::CiscoIPS
Subclass for Cisco IPS devices Subclass for Cisco IPS devices
@@ -1121,7 +1136,7 @@ USAGE
This returns a binary encoded string where each digit represents a This returns a binary encoded string where each digit represents a
layer of the OSI model served by the device. layer of the OSI model served by the device.
eg: 01000010 means layers 2 (physical) and 7 (Application) eg: 01000010 means layers 2 (physical) and 7 (Application)
are served. are served.
Note: This string is 8 digits long. Note: This string is 8 digits long.
@@ -1602,7 +1617,7 @@ SETTING DATA VIA SNMP
# Disable a port administratively # Disable a port administratively
my %if_map = reverse %{$info->interfaces()} my %if_map = reverse %{$info->interfaces()}
$info->set_i_up_admin('down', $if_map{'FastEthernet0/0'}) $info->set_i_up_admin('down', $if_map{'FastEthernet0/0'})
or die "Couldn't disable the port. ",$info->error(1); or die "Couldn't disable the port. ",$info->error(1);
NOTE: You must be connected to your device with a "ReadWrite" community NOTE: You must be connected to your device with a "ReadWrite" community
@@ -1784,7 +1799,7 @@ EXTENDING SNMP::INFO
return 'Fire' if $power =~ /reallyhot/i; return 'Fire' if $power =~ /reallyhot/i;
return 'Ice' if $power =~ /reallycold/i; return 'Ice' if $power =~ /reallycold/i;
# Else # Else
return $power; return $power;
} }
@@ -1848,12 +1863,12 @@ SNMP::INFO INTERNALS
'64000' => '64 kbps', '64000' => '64 kbps',
'115000' => '115 kpbs', '115000' => '115 kpbs',
'1500000' => '1.5 Mbps', '1500000' => '1.5 Mbps',
'1536000' => 'T1', '1536000' => 'T1',
'1544000' => 'T1', '1544000' => 'T1',
'2000000' => '2.0 Mbps', '2000000' => '2.0 Mbps',
'2048000' => '2.048 Mbps', '2048000' => '2.048 Mbps',
'3072000' => 'Dual T1', '3072000' => 'Dual T1',
'3088000' => 'Dual T1', '3088000' => 'Dual T1',
'4000000' => '4.0 Mbps', '4000000' => '4.0 Mbps',
'10000000' => '10 Mbps', '10000000' => '10 Mbps',
'11000000' => '11 Mbps', '11000000' => '11 Mbps',
@@ -1875,7 +1890,7 @@ SNMP::INFO INTERNALS
'155519000' => 'OC-3', '155519000' => 'OC-3',
'155520000' => 'OC-3', '155520000' => 'OC-3',
'400000000' => '400 Mbps', '400000000' => '400 Mbps',
'599040000' => 'ATM on OC-12', '599040000' => 'ATM on OC-12',
'622000000' => 'OC-12', '622000000' => 'OC-12',
'622080000' => 'OC-12', '622080000' => 'OC-12',
'1000000000' => '1.0 Gbps', '1000000000' => '1.0 Gbps',
@@ -2157,8 +2172,8 @@ COPYRIGHT AND LICENSE
* Redistributions in binary form must reproduce the above copyright * Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.
* Neither the name of the University of California, Santa Cruz nor the * Neither the name of the University of California, Santa Cruz nor the
names of its contributors may be used to endorse or promote products names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission. derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS

View File

@@ -995,10 +995,16 @@ See documentation in L<SNMP::Info::Layer7> for details.
=item SNMP::Info::Layer7::APC =item SNMP::Info::Layer7::APC
Subclass for APC UPS devices Subclass for APC UPS devices
See documentation in L<SNMP::Info::Layer7::APC> for details. See documentation in L<SNMP::Info::Layer7::APC> for details.
=item SNMP::Info::Layer7::Arbor
Subclass for Arbor appliances
See documentation in L<SNMP::Info::Layer7::Arbor> for details.
=item SNMP::Info::Layer7::CiscoIPS =item SNMP::Info::Layer7::CiscoIPS
Subclass for Cisco IPS devices Subclass for Cisco IPS devices

View File

@@ -97,6 +97,7 @@ sub os_ver {
1; 1;
__END__ __END__
=head1 NAME =head1 NAME
@@ -181,10 +182,6 @@ See documentation in L<SNMP::Info::Layer7> for details.
These are methods that return tables of information in the form of a reference These are methods that return tables of information in the form of a reference
to a hash. to a hash.
=over
=back
=head2 Table Methods imported from SNMP::Info::Layer7 =head2 Table Methods imported from SNMP::Info::Layer7
See documentation in L<SNMP::Info::Layer7> for details. See documentation in L<SNMP::Info::Layer7> for details.

View File

@@ -0,0 +1,95 @@
# Test::SNMP::Info::Layer7::Arbor
#
# Copyright (c) 2018 Rob Woodward
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the University of California, Santa Cruz nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
package Test::SNMP::Info::Layer7::Arbor;
use Test::Class::Most parent => 'My::Test::Class';
use SNMP::Info::Layer7::Arbor;
sub setup : Tests(setup) {
my $test = shift;
$test->SUPER::setup;
# Start with a common cache that will serve most tests
my $cache_data = {
'_layers' => 72,
'_description' => 'Peakflow TMS 8.2 Model: TMS-2800-40G Serial: CT24227201ZQ',
'_id' => '.1.3.6.1.4.1.9694.1.4',
'store' => {},
};
$test->{info}->cache($cache_data);
}
sub os : Tests(2) {
my $test = shift;
can_ok($test->{info}, 'os');
is($test->{info}->os(), 'ArbOS', q(OS returns 'ArbOS'));
}
sub os_ver : Tests(3) {
my $test = shift;
can_ok($test->{info}, 'os_ver');
is($test->{info}->os_ver(), '8.2', q(OS version has expected value));
$test->{info}->clear_cache();
is($test->{info}->os_ver(), undef,
q(No description returns undef OS version));
}
sub serial : Tests(3) {
my $test = shift;
can_ok($test->{info}, 'serial');
is($test->{info}->serial(), 'CT24227201ZQ', q(Serial has expected value));
$test->{info}->clear_cache();
is($test->{info}->serial(), undef, q(No data returns undef serial));
}
sub vendor : Tests(2) {
my $test = shift;
can_ok($test->{info}, 'vendor');
is($test->{info}->vendor(), 'arbor', q(Vendor returns 'arbor'));
}
sub model : Tests(3) {
my $test = shift;
can_ok($test->{info}, 'model');
is($test->{info}->model(), 'TMS-2800-40G', q(Model has expected value));
$test->{info}->clear_cache();
is($test->{info}->model(), undef, q(No description returns undef model));
}
1;