diff --git a/lib/SNMP/Info/Layer2/NWSS2300.pm b/lib/SNMP/Info/Layer2/NWSS2300.pm index 704049f4..9eb2d3d6 100644 --- a/lib/SNMP/Info/Layer2/NWSS2300.pm +++ b/lib/SNMP/Info/Layer2/NWSS2300.pm @@ -53,9 +53,9 @@ $VERSION = '3.80'; %GLOBALS = ( %SNMP::Info::Layer2::GLOBALS, - 'os_ver' => 'ntwsVersionString', - 'serial' => 'ntwsSerialNumber', - 'mac' => 'dot1dBaseBridgeAddress', + 'os_ver' => 'ntwsVersionString', + 'nws_serial' => 'ntwsSerialNumber', + 'mac' => 'dot1dBaseBridgeAddress', ); %FUNCS = ( @@ -139,6 +139,14 @@ sub vendor { return 'avaya'; } +sub serial { + my $nwss2300 = shift; + my $ser = $nwss2300->ntwsSerialNumber(); +# my $ser = $nwss2300->nws_serial(); + + return $ser; +} + sub model { my $nwss2300 = shift; my $id = $nwss2300->id(); @@ -654,7 +662,7 @@ sub e_serial { my %e_serial; # Chassis - $e_serial{1} = $nwss2300->serial(); + $e_serial{1} = $nwss2300->serial() || ''; # APs foreach my $iid ( keys %$ap_serial ) { diff --git a/lib/SNMP/Info/Layer2/Trapeze.pm b/lib/SNMP/Info/Layer2/Trapeze.pm index f2453112..b809ef50 100644 --- a/lib/SNMP/Info/Layer2/Trapeze.pm +++ b/lib/SNMP/Info/Layer2/Trapeze.pm @@ -53,9 +53,9 @@ $VERSION = '3.80'; %GLOBALS = ( %SNMP::Info::Layer2::GLOBALS, - 'os_ver' => 'trpzVersionString', - 'serial' => 'trpzSerialNumber', - 'mac' => 'dot1dBaseBridgeAddress', + 'os_ver' => 'trpzVersionString', + 'tr_serial' => 'trpzSerialNumber', + 'mac' => 'dot1dBaseBridgeAddress', ); %FUNCS = ( @@ -138,6 +138,14 @@ sub vendor { return 'juniper'; } +sub serial { + my $trapeze = shift; + my $ser = $trapeze->trpzSerialNumber(); +# my $ser = $trapeze->tr_serial(); + + return $ser; +} + sub model { my $trapeze = shift; my $id = $trapeze->id(); @@ -653,7 +661,7 @@ sub e_serial { my %e_serial; # Chassis - $e_serial{1} = $trapeze->serial(); + $e_serial{1} = $trapeze->serial() || ''; # APs foreach my $iid ( keys %$ap_serial ) { diff --git a/xt/lib/Test/SNMP/Info/Layer2/NWSS2300.pm b/xt/lib/Test/SNMP/Info/Layer2/NWSS2300.pm index 88b78d0a..31ec194f 100644 --- a/xt/lib/Test/SNMP/Info/Layer2/NWSS2300.pm +++ b/xt/lib/Test/SNMP/Info/Layer2/NWSS2300.pm @@ -51,6 +51,9 @@ sub setup : Tests(setup) { '_description' => 'Nortel Wireless Security Switch 2380, 7.0.13.3 REL', + # NTWS-BASIC-MIB + '_ntwsSerialNumber' => 'STP1E4013Z', + # NTWS-REGISTRATION-DEVICES-MIB::ntwsSwitch2380 '_id' => '.1.3.6.1.4.1.45.6.1.3.1.3', 'store' => {}, @@ -72,4 +75,15 @@ sub vendor : Tests(2) { is($test->{info}->vendor(), 'avaya', q(Vendor returns 'avaya')); } +sub serial : Tests(3) { + my $test = shift; + + can_ok($test->{info}, 'serial'); + is($test->{info}->serial(), 'STP1E4013Z', q(Serial is expected value)); + + $test->{info}->clear_cache(); + is($test->{info}->serial(), undef, + q(No serial returns undef)); +} + 1; diff --git a/xt/lib/Test/SNMP/Info/Layer2/Trapeze.pm b/xt/lib/Test/SNMP/Info/Layer2/Trapeze.pm index 01bd0264..e0892399 100644 --- a/xt/lib/Test/SNMP/Info/Layer2/Trapeze.pm +++ b/xt/lib/Test/SNMP/Info/Layer2/Trapeze.pm @@ -51,6 +51,9 @@ sub setup : Tests(setup) { '_description' => 'Juniper Networks, Inc WLC880R 7.5.1.6 REL', + # TRAPEZE-NETWORKS-BASIC-MIB + '_trpzSerialNumber' => '0882200159', + # TRAPEZE-NETWORKS-REGISTRATION-DEVICES-MIB::wirelessLANController880R '_id' => '.1.3.6.1.4.1.14525.3.3.1', 'store' => {}, @@ -79,4 +82,15 @@ sub vendor : Tests(2) { is($test->{info}->vendor(), 'juniper', q(Vendor returns 'juniper')); } +sub serial : Tests(3) { + my $test = shift; + + can_ok($test->{info}, 'serial'); + is($test->{info}->serial(), '0882200159', q(Serial is expected value)); + + $test->{info}->clear_cache(); + is($test->{info}->serial(), undef, + q(No serial returns undef)); +} + 1;