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

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

Expected

Checking error handling

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

Warning: snmpget() expects parameter 5 to be int,%s given in %s on line %d
bool(false)
Checking working
Single OID, default timeout and retries
string(%d) "%s"
Single OID, default retries
string(%d) "%s"
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: snmpget(): Invalid object identifier: .1.3.6.1.2.1..1.1.0 in %s on line %d
bool(false)
Single OID in array

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

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

Warning: snmpget(): Error in packet at 'SNMPv2-MIB::sysDescr.110': (noSuchName) There is no such variable name in this MIB. in %s on line %d
bool(false)
Single OID in array

Warning: snmpget(): Error in packet at 'SNMPv2-MIB::sysDescr.110': (noSuchName) There is no such variable name in this MIB. in %s on line %d
bool(false)
Multiple OID

Warning: snmpget(): Error in packet at 'SNMPv2-MIB::sysUpTime.220': (noSuchName) There is no such variable name in this MIB. in %s on line %d
array(1) {
  ["%s"]=>
  string(%d) "%s"
}

Output

Checking error handling

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

Diff

003+ Fatal error: Uncaught TypeError: snmpget() expects parameter 4 to be int, string given in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmpget.php:9
004+ Stack trace:
005+ #0 /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmpget.php(9): snmpget('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/snmpget.php on line 9
003- Warning: snmpget() expects parameter 4 to be int,%s given in %s on line %d
004- bool(false)
005- 
006- Warning: snmpget() expects parameter 5 to be int,%s given in %s on line %d
007- bool(false)
008- Checking working
009- Single OID, default timeout and retries
010- string(%d) "%s"
011- Single OID, default retries
012- string(%d) "%s"
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: snmpget(): 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: snmpget(): 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: snmpget(): 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: snmpget(): Error in packet at 'SNMPv2-MIB::sysDescr.110': (noSuchName) There is no such variable name in this MIB. in %s on line %d
044- bool(false)
045- Single OID in array
046- 
047- Warning: snmpget(): Error in packet at 'SNMPv2-MIB::sysDescr.110': (noSuchName) There is no such variable name in this MIB. in %s on line %d
048- bool(false)
049- Multiple OID
050- 
051- Warning: snmpget(): Error in packet at 'SNMPv2-MIB::sysUpTime.220': (noSuchName) There is no such variable name in this MIB. 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 (942 days ago)

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