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/snmp3-error.phpt ('SNMPv3 Support (errors)')

Script

1: <?php
2:
require_once(__DIR__.'/snmp_include.inc');
3:
4: echo 
"Checking error handling\n";
5:
6:
//int snmp3_get(string host, string sec_name, string sec_level, string auth_protocol,
7: //              string auth_passphrase, string priv_protocol, string priv_passphrase,
8: //              string object_id [, int timeout [, int retries]]);
9:
10:
var_dump(snmp3_get($hostname$community''''''''''));
11:
var_dump(snmp3_get($hostname$community'''''''''''.1.3.6.1.2.1.1.1.0'));
12:
var_dump(snmp3_get($hostname$community'bugusPriv''''''''''.1.3.6.1.2.1.1.1.0'));
13:
var_dump(snmp3_get($hostname$community'authNoPriv''TTT''''''''.1.3.6.1.2.1.1.1.0'));
14:
var_dump(snmp3_get($hostname$community'authNoPriv''MD5''''''''.1.3.6.1.2.1.1.1.0'));
15:
var_dump(snmp3_get($hostname$community'authNoPriv''MD5''te''''''.1.3.6.1.2.1.1.1.0'));
16:
var_dump(snmp3_get($hostname$community'authPriv''MD5'$auth_pass'BBB''''.1.3.6.1.2.1.1.1.0'));
17:
var_dump(snmp3_get($hostname$community'authPriv''MD5'$auth_pass'AES''''.1.3.6.1.2.1.1.1.0'));
18:
var_dump(snmp3_get($hostname$community'authPriv''MD5'$auth_pass'AES''ty''.1.3.6.1.2.1.1.1.0'));
19:
var_dump(snmp3_get($hostname'somebogususer''authPriv''MD5'$auth_pass'AES'$priv_pass'.1.3.6.1.2.1.1.1.0'$timeout$retries));
20:
21:
var_dump(snmp3_set($hostname$community'authPriv''MD5'$auth_pass'AES'$priv_pass'''s'));
22:
23:
var_dump(snmp3_set($hostname$rwuser'authPriv''MD5'$auth_pass'AES'$priv_pass'.1.3.6.777...7.5.3''s''ttt'$timeout$retries));
24:
var_dump(snmp3_set($hostname$rwuser'authPriv''MD5'$auth_pass'AES'$priv_pass'.1.3.6.777.7.5.3', array('s'), 'yyy'$timeout$retries));
25:
26:
?>
27:

Expected

Checking error handling

Warning: snmp3_get() expects at least 8 parameters, 7 given in %s on line %d
bool(false)

Warning: snmp3_get(): Invalid security level '' in %s on line %d
bool(false)

Warning: snmp3_get(): Invalid security level 'bugusPriv' in %s on line %d
bool(false)

Warning: snmp3_get(): Unknown authentication protocol 'TTT' in %s on line %d
bool(false)

Warning: snmp3_get(): Error generating a key for authentication pass phrase '': Generic error (The supplied password length is too short.) in %s on line %d
bool(false)

Warning: snmp3_get(): Error generating a key for authentication pass phrase 'te': Generic error (The supplied password length is too short.) in %s on line %d
bool(false)

Warning: snmp3_get(): Unknown security protocol 'BBB' in %s on line %d
bool(false)

Warning: snmp3_get(): Error generating a key for privacy pass phrase '': Generic error (The supplied password length is too short.) in %s on line %d
bool(false)

Warning: snmp3_get(): Error generating a key for privacy pass phrase 'ty': Generic error (The supplied password length is too short.) in %s on line %d
bool(false)

Warning: snmp3_get(): Fatal error: Unknown user name in %s on line %d
bool(false)

Warning: snmp3_set() expects at least 10 parameters, 9 given in %s on line %d
bool(false)

Warning: snmp3_set(): Invalid object identifier: .1.3.6.777...7.5.3 in %s on line %d
bool(false)

Warning: snmp3_set(): Single objid and multiple type or values are not supported in %s on line %d
bool(false)

Output

Checking error handling

Fatal error: Uncaught ArgumentCountError: snmp3_get() expects at least 8 parameters, 7 given in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp3-error.php:10
Stack trace:
#0 /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp3-error.php(10): snmp3_get('127.0.0.1:161', 'public', '', '', '', '', '')
#1 {main}
  thrown in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp3-error.php on line 10

Diff

003+ Fatal error: Uncaught ArgumentCountError: snmp3_get() expects at least 8 parameters, 7 given in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp3-error.php:10
004+ Stack trace:
005+ #0 /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp3-error.php(10): snmp3_get('127.0.0.1:161', 'public', '', '', '', '', '')
006+ #1 {main}
007+   thrown in /var/php_gcov/PHP_HEAD/ext/snmp/tests/snmp3-error.php on line 10
003- Warning: snmp3_get() expects at least 8 parameters, 7 given in %s on line %d
004- bool(false)
005- 
006- Warning: snmp3_get(): Invalid security level '' in %s on line %d
007- bool(false)
008- 
009- Warning: snmp3_get(): Invalid security level 'bugusPriv' in %s on line %d
010- bool(false)
011- 
012- Warning: snmp3_get(): Unknown authentication protocol 'TTT' in %s on line %d
013- bool(false)
014- 
015- Warning: snmp3_get(): Error generating a key for authentication pass phrase '': Generic error (The supplied password length is too short.) in %s on line %d
016- bool(false)
017- 
018- Warning: snmp3_get(): Error generating a key for authentication pass phrase 'te': Generic error (The supplied password length is too short.) in %s on line %d
019- bool(false)
020- 
021- Warning: snmp3_get(): Unknown security protocol 'BBB' in %s on line %d
022- bool(false)
023- 
024- Warning: snmp3_get(): Error generating a key for privacy pass phrase '': Generic error (The supplied password length is too short.) in %s on line %d
025- bool(false)
026- 
027- Warning: snmp3_get(): Error generating a key for privacy pass phrase 'ty': Generic error (The supplied password length is too short.) in %s on line %d
028- bool(false)
029- 
030- Warning: snmp3_get(): Fatal error: Unknown user name in %s on line %d
031- bool(false)
032- 
033- Warning: snmp3_set() expects at least 10 parameters, 9 given in %s on line %d
034- bool(false)
035- 
036- Warning: snmp3_set(): Invalid object identifier: .1.3.6.777...7.5.3 in %s on line %d
037- bool(false)
038- 
039- Warning: snmp3_set(): Single objid and multiple type or values are not supported in %s on line %d
040- bool(false)

 

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

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