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/snmpwalk.phpt ('Function snmpwalk')

Script

1: <?php
2:
require_once(__DIR__.'/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(snmpwalk($hostname$community'.1.3.6.1.2.1.1'''));
10:
var_dump(snmpwalk($hostname$community'.1.3.6.1.2.1.1'$timeout''));
11:
12: echo 
"Checking working\n";
13: echo 
"Single OID\n";
14:
$return snmpwalk($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 snmpwalk($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 snmpwalk($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 snmpwalk($hostname$community, array('.1.3.6.1.2.1.1''.1.3.6...1'), $timeout$retries);
42:
var_dump($return);
43:
$return snmpwalk($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 snmpwalk($hostname$community, array('.1.3.6.99999.0.99999.111'), $timeout$retries);
48:
var_dump($return);
49:
50:
?>
51:

Expected

Checking error handling

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

Warning: snmpwalk() expects parameter 5 to be int, %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: snmpwalk(): Multi OID walks are not supported! in %s on line %d
bool(false)
Multiple OID with wrong OID

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

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

Warning: snmpwalk(): Error in packet at '%s': (noSuchName) There is no such variable name in this MIB. in %s on line %d
bool(false)

Output

Checking error handling

Fatal error: Uncaught TypeError: snmpwalk() expects parameter 4 to be int, string given in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmpwalk.php:9
Stack trace:
#0 /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmpwalk.php(9): snmpwalk('127.0.0.1:161', 'public', '.1.3.6.1.2.1.1', '')
#1 {main}
  thrown in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmpwalk.php on line 9

Diff

003+ Fatal error: Uncaught TypeError: snmpwalk() expects parameter 4 to be int, string given in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmpwalk.php:9
004+ Stack trace:
005+ #0 /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmpwalk.php(9): snmpwalk('127.0.0.1:161', 'public', '.1.3.6.1.2.1.1', '')
006+ #1 {main}
007+   thrown in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmpwalk.php on line 9
003- Warning: snmpwalk() expects parameter 4 to be int, %s given in %s on line %d
004- bool(false)
005- 
006- Warning: snmpwalk() expects parameter 5 to be int, %s given in %s on line %d
007- bool(false)
008- Checking working
009- Single OID
010- string(5) "array"
011- int(%d)
012- string(6) "string"
013- string(6) "string"
014- Single OID in array
015- string(5) "array"
016- string(6) "string"
017- Default OID
018- string(5) "array"
019- string(6) "string"
020- More error handling
021- Single incorrect OID
022- 
023- Warning: snmpwalk(): Invalid object identifier: %s in %s on line %d
024- bool(false)
025- Multiple correct OID
026- 
027- Warning: snmpwalk(): Multi OID walks are not supported! in %s on line %d
028- bool(false)
029- Multiple OID with wrong OID
030- 
031- Warning: snmpwalk(): Multi OID walks are not supported! in %s on line %d
032- bool(false)
033- 
034- Warning: snmpwalk(): Multi OID walks are not supported! in %s on line %d
035- bool(false)
036- Single nonexisting OID
037- 
038- Warning: snmpwalk(): Error in packet at '%s': (noSuchName) There is no such variable name in this MIB. in %s on line %d
039- bool(false)

 

Generated at Mon, 06 May 2019 17:58:35 +0000 (942 days ago)

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