PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/snmp/tests/snmp2_walk.phpt ('Function snmp2_walk')

Script

1: <?php
2:
require_once(dirname(__FILE__).'/snmp_include.inc');
3:
4:
//EXPECTF format is quickprint OFF
5:
snmp_set_quick_print(false);
6:
snmp_set_valueretrieval(SNMP_VALUE_PLAIN);
7:
8: echo 
"Checking error handling\n";
9:
var_dump(snmp2_walk($hostname$community'.1.3.6.1.2.1.1'''));
10:
var_dump(snmp2_walk($hostname$community'.1.3.6.1.2.1.1'$timeout''));
11:
12: echo 
"Checking working\n";
13: echo 
"Single OID\n";
14:
$return snmp2_walk($hostname$community'.1.3.6.1.2.1.1'$timeout$retries);
15:
16:
var_dump(gettype($return));
17:
var_dump(sizeof($return));
18:
var_dump(gettype($return[0]));
19:
var_dump(gettype($return[1]));
20:
21: echo 
"Single OID in array\n";
22:
$return snmp2_walk($hostname$community, array('.1.3.6.1.2.1.1'), $timeout$retries);
23:
var_dump(gettype($return));
24:
var_dump(gettype($return[0]));
25:
26: echo 
"Default OID\n";
27:
$return snmpwalk($hostname$community''$timeout$retries);
28:
var_dump(gettype($return));
29:
var_dump(gettype($return[0]));
30:
31: echo 
"More error handling\n";
32: echo 
"Single incorrect OID\n";
33:
$return snmpwalk($hostname$community'.1.3.6...1'$timeout$retries);
34:
var_dump($return);
35:
36: echo 
"Multiple correct OID\n";
37:
$return snmp2_walk($hostname$community, array('.1.3.6.1.2.1.1''.1.3.6'), $timeout$retries);
38:
var_dump($return);
39:
40: echo 
"Multiple OID with wrong OID\n";
41:
$return snmp2_walk($hostname$community, array('.1.3.6.1.2.1.1''.1.3.6...1'), $timeout$retries);
42:
var_dump($return);
43:
$return snmp2_walk($hostname$community, array('.1.3.6...1''.1.3.6.1.2.1.1'), $timeout$retries);
44:
var_dump($return);
45:
46: echo 
"Single nonexisting OID\n";
47:
$return snmp2_walk($hostname$community, array('.1.3.6.99999.0.99999.111'), $timeout$retries);
48:
var_dump($return);
49:
50:
?>
51:

Expected

Checking error handling

Warning: snmp2_walk() expects parameter 4 to be integer, %s given in %s on line %d
bool(false)

Warning: snmp2_walk() expects parameter 5 to be integer, %s given in %s on line %d
bool(false)
Checking working
Single OID
string(5) "array"
int(%d)
string(6) "string"
string(6) "string"
Single OID in array
string(5) "array"
string(6) "string"
Default OID
string(5) "array"
string(6) "string"
More error handling
Single incorrect OID

Warning: snmpwalk(): Invalid object identifier: %s in %s on line %d
bool(false)
Multiple correct OID

Warning: snmp2_walk(): Multi OID walks are not supported! in %s on line %d
bool(false)
Multiple OID with wrong OID

Warning: snmp2_walk(): Multi OID walks are not supported! in %s on line %d
bool(false)

Warning: snmp2_walk(): Multi OID walks are not supported! in %s on line %d
bool(false)
Single nonexisting OID

Warning: snmp2_walk(): Error in packet at '%s': No more variables left in this MIB View (It is past the end of the MIB tree) in %s on line %d
bool(false)

Output

Checking error handling

Warning: snmp2_walk() expects parameter 4 to be integer, string given in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp2_walk.php on line 9
bool(false)

Warning: snmp2_walk() expects parameter 5 to be integer, string given in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp2_walk.php on line 10
bool(false)
Checking working
Single OID
string(5) "array"
int(31)
string(6) "string"
string(6) "string"
Single OID in array
string(5) "array"
string(6) "string"
Default OID

Warning: snmpwalk(): No response from 127.0.0.1 in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp2_walk.php on line 27
string(7) "boolean"
string(4) "NULL"
More error handling
Single incorrect OID

Warning: snmpwalk(): Invalid object identifier: .1.3.6...1 in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp2_walk.php on line 33
bool(false)
Multiple correct OID

Warning: snmp2_walk(): Multi OID walks are not supported! in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp2_walk.php on line 37
bool(false)
Multiple OID with wrong OID

Warning: snmp2_walk(): Multi OID walks are not supported! in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp2_walk.php on line 41
bool(false)

Warning: snmp2_walk(): Multi OID walks are not supported! in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp2_walk.php on line 43
bool(false)
Single nonexisting OID

Warning: snmp2_walk(): No response from 127.0.0.1 in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp2_walk.php on line 47
bool(false)

Diff

018+ 
019+ Warning: snmpwalk(): No response from 127.0.0.1 in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp2_walk.php on line 27
020+ string(7) "boolean"
021+ string(4) "NULL"
018- string(5) "array"
019- string(6) "string"
038- Warning: snmp2_walk(): Error in packet at '%s': No more variables left in this MIB View (It is past the end of the MIB tree) in %s on line %d
040+ Warning: snmp2_walk(): No response from 127.0.0.1 in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp2_walk.php on line 47

 

Generated at Thu, 07 Dec 2017 02:58:06 +0000 (5 days ago)

Copyright © 2005-2017 The PHP Group
All rights reserved.