Comment on todo_skip tests in update()
This commit is contained in:
@@ -65,9 +65,6 @@ sub constructor : Tests(11) {
|
|||||||
is($test->{info}{snmp_user}, 'initial', 'SNMP user arg saved');
|
is($test->{info}{snmp_user}, 'initial', 'SNMP user arg saved');
|
||||||
}
|
}
|
||||||
|
|
||||||
# update() needs to be reworked to discard all args except community
|
|
||||||
# or context as described in documentation
|
|
||||||
|
|
||||||
sub update : Tests(9) {
|
sub update : Tests(9) {
|
||||||
my $test = shift;
|
my $test = shift;
|
||||||
|
|
||||||
@@ -84,30 +81,26 @@ sub update : Tests(9) {
|
|||||||
is($test->{info}{sess}{Community}, 'new_community', 'Community changed');
|
is($test->{info}{sess}{Community}, 'new_community', 'Community changed');
|
||||||
|
|
||||||
TODO: {
|
TODO: {
|
||||||
todo_skip "V3 Context update() test issues", 4 if 1;
|
# The update() method creates a new SNMP::Session, v1/2 do not actually
|
||||||
|
# need to contact the DestHost for sesssion creation while v3 does.
|
||||||
my $class = $test->class;
|
# It appears that Net-SNMP 5.8 changes the behavior of v3 session creation
|
||||||
|
# so that it doesn't require contact with the DestHost to pass these tests
|
||||||
my $v3_info = $class->new(
|
# We also could connect to http://snmplabs.com v3 simulator but would
|
||||||
'AutoSpecify' => 0,
|
# prefer to keep those tests isolated to 10_remote_snmplabs.t - we could
|
||||||
'BulkWalk' => 0,
|
# also move the update() tests to that file.
|
||||||
'UseEnums' => 1,
|
todo_skip "Revist v3 Context update() tests when using Net-SNMP 5.8+", 4
|
||||||
'RetryNoSuch' => 1,
|
if 1;
|
||||||
'DestHost' => '127.0.0.1',
|
|
||||||
'SecName' => 'initial',
|
|
||||||
'SecLevel' => 'noAuthNoPriv',
|
|
||||||
'Context' => '',
|
|
||||||
'Version' => 3,
|
|
||||||
);
|
|
||||||
|
|
||||||
# Starting context
|
# Starting context
|
||||||
is($v3_info->{sess}{Context}, undef, q(Context doesn't exist));
|
ok(!defined $test->{info}{sess}{Context}, q(Context doesn't exist));
|
||||||
|
|
||||||
# Change context
|
# Change context
|
||||||
%update_args = ('Context' => 'vlan-100');
|
# Since update() is actually creating new SNMP::Session we can put
|
||||||
ok($v3_info->update(%update_args), 'Update Context');
|
# whatever session arguments needed in %update_args
|
||||||
is($v3_info->error(), undef, '... and no error');
|
%update_args = ('Context' => 'vlan-100', 'Version' => 3,);
|
||||||
is($v3_info->{sess}{Context}, 'vlan-100', 'Context changed');
|
ok($test->{info}->update(%update_args), 'Update Context');
|
||||||
|
is($test->{info}->error(), undef, '... and no error');
|
||||||
|
is($test->{info}->{sess}{Context}, 'vlan-100', 'Context changed');
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user