Merge branch 'robwwd-arbor'
This commit is contained in:
1
Changes
1
Changes
@@ -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
|
||||||
|
|
||||||
|
|||||||
2
MANIFEST
2
MANIFEST
@@ -118,6 +118,7 @@ lib/SNMP/Info/Layer3/VMware.pm
|
|||||||
lib/SNMP/Info/Layer3/VyOS.pm
|
lib/SNMP/Info/Layer3/VyOS.pm
|
||||||
lib/SNMP/Info/Layer7.pm
|
lib/SNMP/Info/Layer7.pm
|
||||||
lib/SNMP/Info/Layer7/APC.pm
|
lib/SNMP/Info/Layer7/APC.pm
|
||||||
|
lib/SNMP/Info/Layer7/Arbor.pm
|
||||||
lib/SNMP/Info/Layer7/CiscoIPS.pm
|
lib/SNMP/Info/Layer7/CiscoIPS.pm
|
||||||
lib/SNMP/Info/Layer7/Gigamon.pm
|
lib/SNMP/Info/Layer7/Gigamon.pm
|
||||||
lib/SNMP/Info/Layer7/Neoteris.pm
|
lib/SNMP/Info/Layer7/Neoteris.pm
|
||||||
@@ -256,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
|
||||||
|
|||||||
12
META.json
12
META.json
@@ -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"
|
||||||
@@ -483,6 +491,10 @@
|
|||||||
"file" : "lib/SNMP/Info/Layer7/APC.pm",
|
"file" : "lib/SNMP/Info/Layer7/APC.pm",
|
||||||
"version" : "3.54"
|
"version" : "3.54"
|
||||||
},
|
},
|
||||||
|
"SNMP::Info::Layer7::Arbor" : {
|
||||||
|
"file" : "lib/SNMP/Info/Layer7/Arbor.pm",
|
||||||
|
"version" : "3.54"
|
||||||
|
},
|
||||||
"SNMP::Info::Layer7::CiscoIPS" : {
|
"SNMP::Info::Layer7::CiscoIPS" : {
|
||||||
"file" : "lib/SNMP/Info/Layer7/CiscoIPS.pm",
|
"file" : "lib/SNMP/Info/Layer7/CiscoIPS.pm",
|
||||||
"version" : "3.54"
|
"version" : "3.54"
|
||||||
|
|||||||
9
META.yml
9
META.yml
@@ -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'
|
||||||
@@ -349,6 +355,9 @@ provides:
|
|||||||
SNMP::Info::Layer7::APC:
|
SNMP::Info::Layer7::APC:
|
||||||
file: lib/SNMP/Info/Layer7/APC.pm
|
file: lib/SNMP/Info/Layer7/APC.pm
|
||||||
version: '3.54'
|
version: '3.54'
|
||||||
|
SNMP::Info::Layer7::Arbor:
|
||||||
|
file: lib/SNMP/Info/Layer7/Arbor.pm
|
||||||
|
version: '3.54'
|
||||||
SNMP::Info::Layer7::CiscoIPS:
|
SNMP::Info::Layer7::CiscoIPS:
|
||||||
file: lib/SNMP/Info/Layer7/CiscoIPS.pm
|
file: lib/SNMP/Info/Layer7/CiscoIPS.pm
|
||||||
version: '3.54'
|
version: '3.54'
|
||||||
|
|||||||
21
README
21
README
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -1653,6 +1659,7 @@ sub device_type {
|
|||||||
my %l7sysoidmap = (
|
my %l7sysoidmap = (
|
||||||
318 => 'SNMP::Info::Layer7::APC',
|
318 => 'SNMP::Info::Layer7::APC',
|
||||||
5951 => 'SNMP::Info::Layer7::Netscaler',
|
5951 => 'SNMP::Info::Layer7::Netscaler',
|
||||||
|
9694 => 'SNMP::Info::Layer7::Arbor',
|
||||||
14525 => 'SNMP::Info::Layer2::Trapeze',
|
14525 => 'SNMP::Info::Layer2::Trapeze',
|
||||||
12532 => 'SNMP::Info::Layer7::Neoteris',
|
12532 => 'SNMP::Info::Layer7::Neoteris',
|
||||||
26866 => 'SNMP::Info::Layer7::Gigamon',
|
26866 => 'SNMP::Info::Layer7::Gigamon',
|
||||||
|
|||||||
189
lib/SNMP/Info/Layer7/Arbor.pm
Normal file
189
lib/SNMP/Info/Layer7/Arbor.pm
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
# SNMP::Info::Layer7::Arbor
|
||||||
|
#
|
||||||
|
# Copyright (c) 2017 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 SNMP::Info::Layer7::Arbor;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use Exporter;
|
||||||
|
use SNMP::Info::Layer7;
|
||||||
|
|
||||||
|
@SNMP::Info::Layer7::Arbor::ISA = qw/SNMP::Info::Layer7 Exporter/;
|
||||||
|
@SNMP::Info::Layer7::Arbor::EXPORT_OK = qw//;
|
||||||
|
|
||||||
|
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||||
|
|
||||||
|
$VERSION = '3.54';
|
||||||
|
|
||||||
|
%MIBS = (
|
||||||
|
%SNMP::Info::Layer7::MIBS,
|
||||||
|
);
|
||||||
|
|
||||||
|
%GLOBALS = (
|
||||||
|
%SNMP::Info::Layer7::GLOBALS,
|
||||||
|
);
|
||||||
|
|
||||||
|
%FUNCS = (
|
||||||
|
%SNMP::Info::Layer7::FUNCS,
|
||||||
|
);
|
||||||
|
|
||||||
|
%MUNGE = (
|
||||||
|
%SNMP::Info::Layer7::MUNGE,
|
||||||
|
);
|
||||||
|
|
||||||
|
sub vendor {
|
||||||
|
return 'arbor';
|
||||||
|
}
|
||||||
|
|
||||||
|
sub os {
|
||||||
|
return 'ArbOS';
|
||||||
|
}
|
||||||
|
|
||||||
|
sub serial {
|
||||||
|
my $Arbor = shift;
|
||||||
|
my $descr = $Arbor->description() || '';
|
||||||
|
my $serial = undef;
|
||||||
|
|
||||||
|
$serial = $1 if ( $descr =~ /Serial Number: ([\w\-]+)/i );
|
||||||
|
$serial = $1 if ( $descr =~ /Serial: ([\w\-]+)/i );
|
||||||
|
|
||||||
|
return $serial;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub model {
|
||||||
|
my $Arbor = shift;
|
||||||
|
my $descr = $Arbor->description() || '';
|
||||||
|
my $model = undef;
|
||||||
|
|
||||||
|
$model = $1 if ( $descr =~ /Model: ([\w\-]+) /i );
|
||||||
|
|
||||||
|
return $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub os_ver {
|
||||||
|
my $Arbor = shift;
|
||||||
|
my $descr = $Arbor->description() || '';
|
||||||
|
my $os_ver = undef;
|
||||||
|
|
||||||
|
$os_ver = $1 if ( $descr =~ /Peakflow \w+ ([\.\d]+) /i );
|
||||||
|
|
||||||
|
return $os_ver;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
__END__
|
||||||
|
|
||||||
|
=head1 NAME
|
||||||
|
|
||||||
|
SNMP::Info::Layer7::Arbor - SNMP Interface to Arbor appliances
|
||||||
|
|
||||||
|
=head1 AUTHORS
|
||||||
|
|
||||||
|
Rob Woodward
|
||||||
|
|
||||||
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
# Let SNMP::Info determine the correct subclass for you.
|
||||||
|
my $Arbor = new SNMP::Info(
|
||||||
|
AutoSpecify => 1,
|
||||||
|
Debug => 1,
|
||||||
|
DestHost => 'myrouter',
|
||||||
|
Community => 'public',
|
||||||
|
Version => 2
|
||||||
|
)
|
||||||
|
or die "Can't connect to DestHost.\n";
|
||||||
|
|
||||||
|
my $class = $Arbor->class();
|
||||||
|
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||||
|
|
||||||
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
|
Subclass for Arbor appliances
|
||||||
|
|
||||||
|
=head2 Inherited Classes
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
|
=item SNMP::Info::Layer7
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=head2 Required MIBs
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
|
=item Inherited Classes' MIBs
|
||||||
|
|
||||||
|
See L<SNMP::Info::Layer7> for its own MIB requirements.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=head1 GLOBALS
|
||||||
|
|
||||||
|
These are methods that return scalar value from SNMP
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
|
=item $Arbor->vendor()
|
||||||
|
|
||||||
|
Returns 'Arbor'.
|
||||||
|
|
||||||
|
=item $Arbor->os()
|
||||||
|
|
||||||
|
Returns 'arbos'.
|
||||||
|
|
||||||
|
=item $Arbor->os_ver()
|
||||||
|
|
||||||
|
Release extracted from C<sysDescr>.
|
||||||
|
|
||||||
|
=item $Arbor->model()
|
||||||
|
|
||||||
|
Model extracted from C<sysDescr>.
|
||||||
|
|
||||||
|
=item $Arbor->serial()
|
||||||
|
|
||||||
|
Returns serial number extracted from C<sysDescr>.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=head2 Globals imported from SNMP::Info::Layer7
|
||||||
|
|
||||||
|
See documentation in L<SNMP::Info::Layer7> for details.
|
||||||
|
|
||||||
|
=head1 TABLE ENTRIES
|
||||||
|
|
||||||
|
These are methods that return tables of information in the form of a reference
|
||||||
|
to a hash.
|
||||||
|
|
||||||
|
=head2 Table Methods imported from SNMP::Info::Layer7
|
||||||
|
|
||||||
|
See documentation in L<SNMP::Info::Layer7> for details.
|
||||||
|
|
||||||
|
=cut
|
||||||
95
xt/lib/Test/SNMP/Info/Layer7/Arbor.pm
Normal file
95
xt/lib/Test/SNMP/Info/Layer7/Arbor.pm
Normal 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;
|
||||||
Reference in New Issue
Block a user