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

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(snmprealwalk($hostname$community'.1.3.6.1.2.1.1'''));
10:
var_dump(snmprealwalk($hostname$community'.1.3.6.1.2.1.1'$timeout''));
11:
12: echo 
"Checking working\n";
13: echo 
"Single OID\n";
14:
$return snmprealwalk($hostname$community'.1.3.6.1.2.1.1'$timeout$retries);
15:
var_dump(gettype($return));
16:
var_dump(sizeof($return));
17:
var_dump(key($return));
18:
var_dump(array_shift($return));
19:
20: echo 
"Single OID in array\n";
21:
$return snmprealwalk($hostname$community, array('.1.3.6.1.2.1.1'), $timeout$retries);
22:
var_dump(gettype($return));
23:
var_dump(sizeof($return));
24:
var_dump(key($return));
25:
var_dump(array_shift($return));
26:
27: echo 
"More error handling\n";
28: echo 
"Multiple correct OID\n";
29:
$return snmprealwalk($hostname$community, array('.1.3.6.1.2.1.1''.1.3.6'), $timeout$retries);
30:
var_dump($return);
31:
32: echo 
"Multiple OID with wrong OID\n";
33:
$return snmprealwalk($hostname$community, array('.1.3.6.1.2.1.1''.1.3.6...1'), $timeout$retries);
34:
var_dump($return);
35:
$return snmprealwalk($hostname$community, array('.1.3.6...1''.1.3.6.1.2.1.1'), $timeout$retries);
36:
var_dump($return);
37:
38: echo 
"Single nonexisting OID\n";
39:
$return snmprealwalk($hostname$community, array('.1.3.6.99999.0.99999.111'), $timeout$retries);
40:
var_dump($return);
41:
42:
?>
43:

Expected

Checking error handling

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

Warning: snmprealwalk() 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(%d) "%s"
string(%d) "%s"
Single OID in array
string(5) "array"
int(%d)
string(%d) "%s"
string(%d) "%s"
More error handling
Multiple correct OID

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

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

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

Warning: snmprealwalk(): 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: snmprealwalk() expects parameter 4 to be int, string given in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmprealwalk.php:9
Stack trace:
#0 /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmprealwalk.php(9): snmprealwalk('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/snmprealwalk.php on line 9

Diff

003+ Fatal error: Uncaught TypeError: snmprealwalk() expects parameter 4 to be int, string given in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmprealwalk.php:9
004+ Stack trace:
005+ #0 /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmprealwalk.php(9): snmprealwalk('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/snmprealwalk.php on line 9
003- Warning: snmprealwalk() expects parameter 4 to be int, %s given in %s on line %d
004- bool(false)
005- 
006- Warning: snmprealwalk() 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(%d) "%s"
013- string(%d) "%s"
014- Single OID in array
015- string(5) "array"
016- int(%d)
017- string(%d) "%s"
018- string(%d) "%s"
019- More error handling
020- Multiple correct OID
021- 
022- Warning: snmprealwalk(): Multi OID walks are not supported! in %s on line %d
023- bool(false)
024- Multiple OID with wrong OID
025- 
026- Warning: snmprealwalk(): Multi OID walks are not supported! in %s on line %d
027- bool(false)
028- 
029- Warning: snmprealwalk(): Multi OID walks are not supported! in %s on line %d
030- bool(false)
031- Single nonexisting OID
032- 
033- Warning: snmprealwalk(): Error in packet at '%s': (noSuchName) There is no such variable name in this MIB. in %s on line %d
034- bool(false)

 

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

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