Subject: | "make test" errors |
There are two variables declared twice in "my" statements in Util.pm.
Patch is attached.
Also, test item #5, which is an snmpset, fails unless the IP address and
community provided as input when running Makefile.PL are a writable
combo. The prompt for data does not state that IP+community needs to be
writable, plus it doesn't seem likely that many people would have a
writable snmpd running for a test such as this (or at least access
controls would interfere).
At the least, prompt the user for a *writable* host and community, or
IMHO better still, remove the write-test. Patch is attached for that as
well.
-Mike
Subject: | snmp-util-repeat-declaration-fix.patch |
--- Util.pm 2009-03-24 14:00:39.000000000 -0700
+++ Util-fixed.pm 2009-03-24 13:52:25.000000000 -0700
@@ -799,7 +799,6 @@
my($self, $range, @oid_list) = @_;
my(
$IP,
- $value,
$oid,
$value,
$value_hi,
@@ -1633,7 +1632,6 @@
$oid_name,
@oid_names,
@oids,
- @oid_names,
$name_indexed,
$start_index,
$hash,
Subject: | snmp-util-write-test-fix.patch |
--- t/libtest.t 2009-03-24 14:14:21.000000000 -0700
+++ t/libtest-fixed.t 2009-03-24 14:13:46.000000000 -0700
@@ -39,7 +39,7 @@
)
or die "Can't create snmp object for $IP\n";
-$test_num = 8; # Numter of tests to run
+$test_num = 7; # Numter of tests to run
print "1..$test_num\n";
@@ -116,25 +116,6 @@
}
$test_num++;
-#print STDERR "Test $test_num - snmpset sysContact.0 and restore ";
-$sys_contact = $snmp->get('v',"sysContact.0");
-$snmp->set("sysContact.0" => 'test-string');
-$result = $snmp->get('v',"sysContact.0");
-$snmp->set("sysContact.0" => $sys_contact);
-$restore_result = $snmp->get('v',"sysContact.0");
-
-if (!$snmp->error && $result eq 'test-string' && $restore_result eq $sys_contact ){
- print "ok $test_num\n";
- #print STDERR "ok $test_num\n";
- $test_results[$test_num] = 1;
-}
-else{
- print "not ok $test_num\n";
- #print STDERR "not ok $test_num\n";
- $test_results[$test_num] = 0;
-}
-
-$test_num++;
#print STDERR "Test $test_num - snmpnext test ";
@result = $snmp->next('ne',"ifAdminStatus.$interface");