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

Script

1: <?php
2:
require_once(__DIR__.'/snmp_include.inc');
3:
4:
//EXPECTF format is quickprint OFF
5:
snmp_set_quick_print(false);
6:
7: echo 
"Get with SNMP_VALUE_LIBRARY\n";
8:
snmp_set_valueretrieval(SNMP_VALUE_LIBRARY);
9:
var_dump(snmpget($hostname$community'.1.3.6.1.2.1.1.1.0'$timeout$retries));
10:
11: echo 
"Get with SNMP_VALUE_PLAIN\n";
12:
snmp_set_valueretrieval(SNMP_VALUE_PLAIN);
13:
var_dump(snmpget($hostname$community'.1.3.6.1.2.1.1.1.0'$timeout$retries));
14:
15: echo 
"Get with SNMP_VALUE_OBJECT\n";
16:
snmp_set_valueretrieval(SNMP_VALUE_OBJECT);
17:
$z snmpget($hostname$community'.1.3.6.1.2.1.1.1.0'$timeout$retries);
18: echo 
gettype($z)."\n";
19:
var_dump($z->type);
20:
var_dump($z->value);
21:
22: echo 
"Get with SNMP_VALUE_OBJECT | SNMP_VALUE_PLAIN\n";
23:
snmp_set_valueretrieval(SNMP_VALUE_OBJECT SNMP_VALUE_PLAIN);
24:
$z snmpget($hostname$community'.1.3.6.1.2.1.1.1.0'$timeout$retries);
25: echo 
gettype($z)."\n";
26:
var_dump($z->type);
27:
var_dump($z->value);
28:
29: echo 
"Get with SNMP_VALUE_OBJECT for BITS OID\n";
30:
snmp_set_valueretrieval(SNMP_VALUE_OBJECT);
31:
$z snmpget($hostname$community'.1.3.6.1.2.1.88.1.4.2.1.3.6.95.115.110.109.112.100.95.108.105.110.107.68.111.119.110'$timeout$retries);
32: echo 
gettype($z)."\n";
33:
var_dump($z->type);
34:
var_dump($z->value);
35:
36: echo 
"Get with SNMP_VALUE_OBJECT | SNMP_VALUE_PLAIN for BITS OID\n";
37:
snmp_set_valueretrieval(SNMP_VALUE_OBJECT SNMP_VALUE_PLAIN);
38:
$z snmpget($hostname$community'.1.3.6.1.2.1.88.1.4.2.1.3.6.95.115.110.109.112.100.95.108.105.110.107.68.111.119.110'$timeout$retries);
39: echo 
gettype($z)."\n";
40:
var_dump($z->type);
41:
var_dump(is_numeric($z->value));
42:
var_dump(is_string($z->value));
43:
var_dump(bin2hex($z->value));
44:
45: echo 
"Check parsing of different OID types\n";
46:
snmp_set_valueretrieval(SNMP_VALUE_PLAIN);
47:
var_dump(count(snmp2_walk($hostname$community'.'$timeout$retries)));
48:
49:
?>
50:

Expected

Get with SNMP_VALUE_LIBRARY
string(%d) "STRING: %s"
Get with SNMP_VALUE_PLAIN
string(%d) "%s"
Get with SNMP_VALUE_OBJECT
object
int(4)
string(%d) "STRING: %s"
Get with SNMP_VALUE_OBJECT | SNMP_VALUE_PLAIN
object
int(4)
string(%d) "%s"
Get with SNMP_VALUE_OBJECT for BITS OID
object
int(4)
string(25) "BITS: %d %s"
Get with SNMP_VALUE_OBJECT | SNMP_VALUE_PLAIN for BITS OID
object
int(4)
bool(false)
bool(true)
string(2) "%d"
Check parsing of different OID types
int(%d)

Output

Get with SNMP_VALUE_LIBRARY
string(95) "STRING: Linux nex2.php.net 2.6.32-754.12.1.el6.x86_64 #1 SMP Tue Apr 9 14:52:26 UTC 2019 x86_64"
Get with SNMP_VALUE_PLAIN
string(87) "Linux nex2.php.net 2.6.32-754.12.1.el6.x86_64 #1 SMP Tue Apr 9 14:52:26 UTC 2019 x86_64"
Get with SNMP_VALUE_OBJECT
object
int(4)
string(95) "STRING: Linux nex2.php.net 2.6.32-754.12.1.el6.x86_64 #1 SMP Tue Apr 9 14:52:26 UTC 2019 x86_64"
Get with SNMP_VALUE_OBJECT | SNMP_VALUE_PLAIN
object
int(4)
string(87) "Linux nex2.php.net 2.6.32-754.12.1.el6.x86_64 #1 SMP Tue Apr 9 14:52:26 UTC 2019 x86_64"
Get with SNMP_VALUE_OBJECT for BITS OID
object
int(4)
string(25) "BITS: 80 notification(0) "
Get with SNMP_VALUE_OBJECT | SNMP_VALUE_PLAIN for BITS OID
object
int(4)
bool(false)
bool(true)
string(2) "80"
Check parsing of different OID types

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

Warning: count(): Parameter must be an array or an object that implements Countable in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp_getvalue.php on line 47
int(1)

Diff

024+ 
025+ Warning: snmp2_walk(): No response from 127.0.0.1 in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp_getvalue.php on line 47
026+ 
027+ Warning: count(): Parameter must be an array or an object that implements Countable in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp_getvalue.php on line 47

 

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

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