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_get.phpt ('Function snmp2_get')

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(snmp2_get($hostname$community'.1.3.6.1.2.1.1.1.0'''));
10:
var_dump(snmp2_get($hostname$community'.1.3.6.1.2.1.1.1.0'$timeout''));
11: echo 
"Empty OID array\n";
12:
var_dump(snmp2_get($hostname$community, array(), $timeout$retries));
13:
14: echo 
"Checking working\n";
15: echo 
"Single OID\n";
16:
var_dump(snmp2_get($hostname$community'.1.3.6.1.2.1.1.1.0'$timeout$retries));
17: echo 
"Single OID in array\n";
18:
var_dump(snmp2_get($hostname$community, array('.1.3.6.1.2.1.1.1.0'), $timeout$retries));
19: echo 
"Multiple OID\n";
20:
var_dump(snmp2_get($hostname$community, array('.1.3.6.1.2.1.1.1.0''.1.3.6.1.2.1.1.3.0'), $timeout$retries));
21:
22: echo 
"More error handling\n";
23: echo 
"Single OID\n";
24:
var_dump(snmp2_get($hostname$community'.1.3.6.1.2..1.1.1.0'$timeout$retries));
25: echo 
"Single OID in array\n";
26:
var_dump(snmp2_get($hostname$community, array('.1.3.6.1.2.1...1.1.0'), $timeout$retries));
27: echo 
"Multiple OID\n";
28:
var_dump(snmp2_get($hostname$community, array('.1.3.6.1.2.1...1.1.0''.1.3.6.1.2.1.1.3.0'), $timeout$retries));
29:
30: echo 
"noSuchName checks\n";
31: echo 
"Single OID\n";
32:
var_dump(snmp2_get($hostname$community'.1.3.6.1.2.1.1.1.110'$timeout$retries));
33: echo 
"Single OID in array\n";
34:
var_dump(snmp2_get($hostname$community, array('.1.3.6.1.2.1.1.1.110'), $timeout$retries));
35: echo 
"Multiple OID\n";
36:
var_dump(snmp2_get($hostname$community, array('.1.3.6.1.2.1.1.1.0''.1.3.6.1.2.1.1.3.220'), $timeout$retries));
37:
38:
39:
?>
40:

Expected

Checking error handling

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

Warning: snmp2_get() expects parameter 5 to be int,%s given in %s on line %d
bool(false)
Empty OID array

Warning: snmp2_get(): Got empty OID array in %s on line %d
bool(false)
Checking working
Single OID
string(%d) "%s"
Single OID in array
array(1) {
  ["%s"]=>
  string(%d) "%s"
}
Multiple OID
array(2) {
  ["%s"]=>
  string(%d) "%s"
  ["%s"]=>
  string(%d) "%d"
}
More error handling
Single OID

Warning: snmp2_get(): Invalid object identifier: .1.3.6.1.2..1.1.1.0 in %s on line %d
bool(false)
Single OID in array

Warning: snmp2_get(): Invalid object identifier: .1.3.6.1.2.1...1.1.0 in %s on line %d
bool(false)
Multiple OID

Warning: snmp2_get(): Invalid object identifier: .1.3.6.1.2.1...1.1.0 in %s on line %d
bool(false)
noSuchName checks
Single OID

Warning: snmp2_get(): Error in packet at 'SNMPv2-MIB::sysDescr.110': No Such Instance currently exists at this OID in %s on line %d
bool(false)
Single OID in array

Warning: snmp2_get(): Error in packet at 'SNMPv2-MIB::sysDescr.110': No Such Instance currently exists at this OID in %s on line %d
bool(false)
Multiple OID

Warning: snmp2_get(): Error in packet at 'SNMPv2-MIB::sysUpTime.220': No Such Instance currently exists at this OID in %s on line %d
array(1) {
  ["%s"]=>
  string(%d) "%s"
}

Output

Checking error handling

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

Diff

003+ Fatal error: Uncaught TypeError: snmp2_get() expects parameter 4 to be int, string given in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp2_get.php:9
004+ Stack trace:
005+ #0 /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp2_get.php(9): snmp2_get('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/snmp2_get.php on line 9
003- Warning: snmp2_get() expects parameter 4 to be int,%s given in %s on line %d
004- bool(false)
005- 
006- Warning: snmp2_get() expects parameter 5 to be int,%s given in %s on line %d
007- bool(false)
008- Empty OID array
009- 
010- Warning: snmp2_get(): Got empty OID array in %s on line %d
011- bool(false)
012- Checking working
013- Single OID
014- string(%d) "%s"
015- Single OID in array
016- array(1) {
017-   ["%s"]=>
018-   string(%d) "%s"
019- }
020- Multiple OID
021- array(2) {
022-   ["%s"]=>
023-   string(%d) "%s"
024-   ["%s"]=>
025-   string(%d) "%d"
026- }
027- More error handling
028- Single OID
029- 
030- Warning: snmp2_get(): Invalid object identifier: .1.3.6.1.2..1.1.1.0 in %s on line %d
031- bool(false)
032- Single OID in array
033- 
034- Warning: snmp2_get(): Invalid object identifier: .1.3.6.1.2.1...1.1.0 in %s on line %d
035- bool(false)
036- Multiple OID
037- 
038- Warning: snmp2_get(): Invalid object identifier: .1.3.6.1.2.1...1.1.0 in %s on line %d
039- bool(false)
040- noSuchName checks
041- Single OID
042- 
043- Warning: snmp2_get(): Error in packet at 'SNMPv2-MIB::sysDescr.110': No Such Instance currently exists at this OID in %s on line %d
044- bool(false)
045- Single OID in array
046- 
047- Warning: snmp2_get(): Error in packet at 'SNMPv2-MIB::sysDescr.110': No Such Instance currently exists at this OID in %s on line %d
048- bool(false)
049- Multiple OID
050- 
051- Warning: snmp2_get(): Error in packet at 'SNMPv2-MIB::sysUpTime.220': No Such Instance currently exists at this OID in %s on line %d
052- array(1) {
053-   ["%s"]=>
054-   string(%d) "%s"
055- }

 

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

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