Comment on todo_skip tests in update()

This commit is contained in:
Eric A. Miller
2018-03-28 22:47:07 -04:00
parent bda796ae98
commit a0b2010994

View File

@@ -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.
# 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
# We also could connect to http://snmplabs.com v3 simulator but would
# prefer to keep those tests isolated to 10_remote_snmplabs.t - we could
# also move the update() tests to that file.
todo_skip "Revist v3 Context update() tests when using Net-SNMP 5.8+", 4
if 1;
my $class = $test->class; # Starting context
ok(!defined $test->{info}{sess}{Context}, q(Context doesn't exist));
my $v3_info = $class->new( # Change context
'AutoSpecify' => 0, # Since update() is actually creating new SNMP::Session we can put
'BulkWalk' => 0, # whatever session arguments needed in %update_args
'UseEnums' => 1, %update_args = ('Context' => 'vlan-100', 'Version' => 3,);
'RetryNoSuch' => 1, ok($test->{info}->update(%update_args), 'Update Context');
'DestHost' => '127.0.0.1', is($test->{info}->error(), undef, '... and no error');
'SecName' => 'initial', is($test->{info}->{sess}{Context}, 'vlan-100', 'Context changed');
'SecLevel' => 'noAuthNoPriv',
'Context' => '',
'Version' => 3,
);
# Starting context
is($v3_info->{sess}{Context}, undef, q(Context doesn't exist));
# Change context
%update_args = ('Context' => 'vlan-100');
ok($v3_info->update(%update_args), 'Update Context');
is($v3_info->error(), undef, '... and no error');
is($v3_info->{sess}{Context}, 'vlan-100', 'Context changed');
} }
} }