* remove trailing newline from os_ver, fixes netdisco #647 * note why the newline is in the test * also update tests * typo
This commit is contained in:
@@ -48,8 +48,8 @@ $VERSION = '3.68';
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer7::GLOBALS,
|
||||
'os_ver' => 'productVersion',
|
||||
'cpu' => 'iveCpuUtil',
|
||||
'pulse_os_ver' => 'productVersion',
|
||||
'cpu' => 'iveCpuUtil',
|
||||
);
|
||||
|
||||
%FUNCS = ( %SNMP::Info::Layer7::FUNCS, );
|
||||
@@ -60,6 +60,17 @@ sub vendor {
|
||||
return 'pulsesecure';
|
||||
}
|
||||
|
||||
sub os_ver {
|
||||
my $neoteris = shift;
|
||||
my $p_os_ver = $neoteris->pulse_os_ver();
|
||||
|
||||
if (defined $p_os_ver) {
|
||||
chomp ($p_os_ver);
|
||||
return $p_os_ver;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
sub os {
|
||||
return 'ive';
|
||||
}
|
||||
@@ -150,7 +161,7 @@ Returns C<'ive'>.
|
||||
|
||||
=item $neoteris->os_ver()
|
||||
|
||||
C<productVersion>
|
||||
C<productVersion> without trailing newline.
|
||||
|
||||
=item $neoteris->cpu()
|
||||
|
||||
|
||||
@@ -43,8 +43,11 @@ sub setup : Tests(setup) {
|
||||
'_description' => 'Pulse Secure, LLC,Pulse Connect Secure,PSA-3000,8.2R7.2 (build 55673)',
|
||||
|
||||
# PULSESECURE-PSG-MIB::ivePSA3000
|
||||
'_id' => '.1.3.6.1.4.1.12532.256.2.1',
|
||||
'store' => {},
|
||||
# _pulse_os_ver newline is intentional, this is what the appliance returns
|
||||
# see netdisco github issue #647
|
||||
'_id' => '.1.3.6.1.4.1.12532.256.2.1',
|
||||
'_pulse_os_ver' => "8.3R7.1 (build 65025)\n",
|
||||
'store' => {},
|
||||
};
|
||||
$test->{info}->cache($cache_data);
|
||||
}
|
||||
@@ -56,6 +59,13 @@ sub vendor : Tests(2) {
|
||||
is($test->{info}->vendor(), 'pulsesecure', q(Vendor returns 'pulsesecure'));
|
||||
}
|
||||
|
||||
sub os_ver : Tests(2) {
|
||||
my $test = shift;
|
||||
|
||||
can_ok($test->{info}, 'os_ver');
|
||||
is($test->{info}->os_ver(), '8.3R7.1 (build 65025)', q(os_ver returns '8.3R7.1 (build 65025)'));
|
||||
}
|
||||
|
||||
sub os : Tests(2) {
|
||||
my $test = shift;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user