php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #53594
Patch patch-ext-snmp-tests revision 2011-01-05 18:00 UTC by lytboris at gmail dot com
revision 2010-12-29 16:50 UTC by lytboris at gmail dot com
revision 2010-12-22 18:53 UTC by lytboris at gmail dot com
Patch patch-ext-snmp-src revision 2011-01-05 17:59 UTC by lytboris at gmail dot com
revision 2010-12-29 16:50 UTC by lytboris at gmail dot com
Patch patch-ext-snmp-trunk revision 2010-12-23 06:18 UTC by lytboris at gmail dot com
revision 2010-12-23 06:16 UTC by lytboris at gmail dot com
Patch php-ext-snmp-source revision 2010-12-22 18:52 UTC by lytboris at gmail dot com

Patch patch-ext-snmp-tests for SNMP related Bug #53594

Patch version 2010-12-22 18:53 UTC

Return to Bug #53594 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions: 2011-01-05 18:00 UTC | 2010-12-29 16:50 UTC | 2010-12-22 18:53 UTC

Developer: lytboris@gmail.com

Line 1 (now 1), was 5 lines, now 4 lines
 diff -urN -x .svn ext/snmp/tests/README ext/snmp/tests/README
  --- ext/snmp/tests/README	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/README	2010-12-21 19:41:14.000000000 +0300
  @@ -0,0 +1,63 @@
  +SNMP Tests
Line 64 (now 63), was 17 lines, now 15 lines

  +On Windows
  +----------
  +
  +[to be completed]
 diff -urN -x .svn ext/snmp/tests/clean.inc ext/snmp/tests/clean.inc
  --- ext/snmp/tests/clean.inc	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/clean.inc	2009-10-17 21:14:00.000000000 +0400
  @@ -0,0 +1,4 @@
  +<?php
  +include_once(dirname(__FILE__) . '/snmp_include.inc');
  +
  +// To be completed if necessary
 diff -urN -x .svn ext/snmp/tests/generic_timeout_error.phpt ext/snmp/tests/generic_timeout_error.phpt
  --- ext/snmp/tests/generic_timeout_error.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/generic_timeout_error.phpt	2010-12-21 23:33:35.000000000 +0300
  @@ -0,0 +1,22 @@
  +--TEST--                                 
Line 99 (now 96), was 9 lines, now 8 lines

  +--EXPECTF--
  +Warning: snmpget(): No response from %s in %s on line %d
  +bool(false)
  \ No newline at end of file
 diff -urN -x .svn ext/snmp/tests/skipif.inc ext/snmp/tests/skipif.inc
  --- ext/snmp/tests/skipif.inc	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/skipif.inc	2010-12-18 14:33:17.000000000 +0300
  @@ -0,0 +1,13 @@
  +<?php
Line 116 (now 112), was 262 lines, now 8 lines

  +
  +if (snmpget($hostname, $community, '.1.3.6.1.2.1.1.1.0', $timeout) === false)
  +	die('NO SNMPD on this host or community invalid');
  +
 diff -urN -x .svn ext/snmp/tests/snmp-session-error.phpt ext/snmp/tests/snmp-session-error.phpt
 --- ext/snmp/tests/snmp-session-error.phpt	1970-01-01 03:00:00.000000000 +0300
 +++ ext/snmp/tests/snmp-session-error.phpt	2010-12-29 17:06:09.000000000 +0300
 @@ -0,0 +1,75 @@
 +--TEST--                                 
 +Errors in SNMP session-wise functions 
 +--CREDITS--
 +Boris Lytochkin
 +--SKIPIF--
 +<?php
 +require_once(dirname(__FILE__).'/skipif.inc');
 +?>
 +--FILE--
 +<?php
 +require_once(dirname(__FILE__).'/snmp_include.inc');
 +
 +//EXPECTF format is quickprint OFF
 +snmp_set_quick_print(false);
 +snmp_set_valueretrieval(SNMP_VALUE_PLAIN);
 +
 +var_dump(snmp_session_close(NULL));
 +var_dump(snmp_session_open(SNMP_VERSION_1, $hostname));
 +var_dump(snmp_session_open(SNMP_VERSION_1, $hostname, $community, ''));
 +var_dump(snmp_session_open(SNMP_VERSION_1, $hostname, $community, $timeout, ''));
 +var_dump(snmp_session_open(7, $hostname, $community));
 +var_dump(snmp_session_set_security(NULL));
 +
 +echo "Open normal session\n";
 +$session = snmp_session_open(SNMP_VERSION_3, $hostname, $user_noauth, $timeout, $retries);
 +echo "Closing session\n";
 +var_dump(snmp_session_close($session));
 +var_dump(snmpget($session, '.1.3.6.1.2.1.1.1.0'));
 +
 +$session = snmp_session_open(SNMP_VERSION_2c, $hostname, $community, $timeout, $retries);
 +var_dump($session);
 +var_dump(snmpwalk($session, '.1.3.6.1.2.1.1', ''));
 +var_dump(snmpwalk($session, '.1.3.6.1.2.1.1', 0, ''));
 +var_dump(snmpget($session));
 +var_dump(snmpset($session));
 +
 +?>
 +--EXPECTF--
 +
 +Warning: snmp_session_close() expects parameter 1 to be resource, null given in %s on line %d
 +bool(false)
 +
 +Warning: snmp_session_open() expects at least 3 parameters, 2 given in %s on line %d
 +NULL
 +
 +Warning: snmp_session_open() expects parameter 4 to be long, string given in %s on line %d
 +NULL
 +
 +Warning: snmp_session_open() expects parameter 5 to be long, string given in %s on line %d
 +NULL
 +
 +Warning: snmp_session_open(): Unknown SNMP protocol version in %s on line %d
 +NULL
 +
 +Warning: snmp_session_set_security() expects parameter 1 to be resource, null given in %s on line %d
 +bool(false)
 +Open normal session
 +Closing session
 +bool(true)
 +
 +Warning: snmpget(): 5 is not a valid SNMP session resource in %s on line %d
 +bool(false)
 +resource(6) of type (SNMP session)
 +
 +Warning: snmpwalk() expects parameter 3 to be long, string given in %s on line %d
 +bool(false)
 +
 +Warning: snmpwalk() expects parameter 4 to be long, string given in %s on line %d
 +bool(false)
 +
 +Warning: snmpget() expects exactly 2 parameters, 1 given in %s on line %d
 +bool(false)
 +
 +Warning: snmpset() expects exactly 4 parameters, 1 given in %s on line %d
 +bool(false)
 diff -urN -x .svn ext/snmp/tests/snmp-session.phpt ext/snmp/tests/snmp-session.phpt
 --- ext/snmp/tests/snmp-session.phpt	1970-01-01 03:00:00.000000000 +0300
 +++ ext/snmp/tests/snmp-session.phpt	2010-12-29 17:21:28.000000000 +0300
 @@ -0,0 +1,169 @@
 +--TEST--                                 
 +Function snmpget
 +--CREDITS--
 +Boris Lytochkin
 +--SKIPIF--
 +<?php
 +require_once(dirname(__FILE__).'/skipif.inc');
 +?>
 +--FILE--
 +<?php
 +require_once(dirname(__FILE__).'/snmp_include.inc');
 +
 +//EXPECTF format is quickprint OFF
 +snmp_set_quick_print(false);
 +snmp_set_valueretrieval(SNMP_VALUE_PLAIN);
 +
 +echo "SNMPv1\n";
 +$session = snmp_session_open(SNMP_VERSION_1, $hostname, $community, $timeout, $retries);
 +var_dump($session);
 +var_dump(snmpget($session, '.1.3.6.1.2.1.1.1.0'));
 +var_dump(snmpgetnext($session, '.1.3.6.1.2.1.1.1.0'));
 +var_dump(snmp_session_close($session));
 +
 +echo "SNMPv2\n";
 +$session = snmp_session_open(SNMP_VERSION_2c, $hostname, $community, $timeout, $retries);
 +var_dump($session);
 +var_dump(snmpget($session, '.1.3.6.1.2.1.1.1.0'));
 +var_dump(snmpgetnext($session, '.1.3.6.1.2.1.1.1.0'));
 +var_dump(snmp_session_close($session));
 +
 +echo "WALK multiple on single OID\n";
 +$session = snmp_session_open(SNMP_VERSION_2c, $hostname, $community, $timeout, $retries);
 +var_dump($session);
 +$z = snmpwalk($session, '.1.3.6.1.2.1.1');
 +var_dump(gettype($z));
 +var_dump(count($z));
 +var_dump(key($z));
 +var_dump(array_shift($z));
 +var_dump(snmp_session_close($session));
 +
 +echo "WALK multiple on single OID, non_repeaters set to 0\n";
 +$session = snmp_session_open(SNMP_VERSION_2c, $hostname, $community, $timeout, $retries);
 +var_dump($session);
 +$z = snmpwalk($session, '.1.3.6.1.2.1.1', 0);
 +var_dump(gettype($z));
 +var_dump(count($z));
 +var_dump(key($z));
 +var_dump(array_shift($z));
 +var_dump(snmp_session_close($session));
 +
 +echo "WALK multiple on single OID, non_repeaters set to 0, max_repetitions set to 30\n";
 +$session = snmp_session_open(SNMP_VERSION_2c, $hostname, $community, $timeout, $retries);
 +var_dump($session);
 +$z = snmpwalk($session, '.1.3.6.1.2.1.1', 0, 30);
 +var_dump(gettype($z));
 +var_dump(count($z));
 +var_dump(key($z));
 +var_dump(array_shift($z));
 +var_dump(snmp_session_close($session));
 +
 +echo "SNMPv3 (default security settings)\n";
 +$session = snmp_session_open(SNMP_VERSION_3, $hostname, $user_noauth, $timeout, $retries);
 +#snmp_session_set_security($session, $user_noauth, 'noAuthNoPriv', '', '', '', '', '', '');
 +var_dump($session);
 +var_dump(snmpget($session, '.1.3.6.1.2.1.1.1.0'));
 +var_dump(snmpgetnext($session, '.1.3.6.1.2.1.1.1.0'));
 +var_dump(snmp_session_close($session));
 +
 +echo "SNMPv3 (noAuthNoPriv)\n";
 +$session = snmp_session_open(SNMP_VERSION_3, $hostname, $user_noauth, $timeout, $retries);
 +snmp_session_set_security($session, 'noAuthNoPriv');
 +var_dump($session);
 +var_dump(snmpget($session, '.1.3.6.1.2.1.1.1.0'));
 +var_dump(snmpgetnext($session, '.1.3.6.1.2.1.1.1.0'));
 +var_dump(snmp_session_close($session));
 +
 +echo "SNMPv3 (authPriv)\n";
 +$session = snmp_session_open(SNMP_VERSION_3, $hostname, $rwuser, $timeout, $retries);
 +snmp_session_set_security($session, 'authPriv', 'MD5', $auth_pass, 'AES', $priv_pass);
 +var_dump($session);
 +var_dump(snmpget($session, '.1.3.6.1.2.1.1.1.0'));
 +var_dump(snmpgetnext($session, '.1.3.6.1.2.1.1.1.0'));
 +var_dump(snmpwalk($session, '.1.3.6.1.2.1.1.1.0'));
 +var_dump(snmp_session_close($session));
 +
 +echo "SET single OID\n";
 +$session = snmp_session_open(SNMP_VERSION_3, $hostname, $rwuser, $timeout, $retries);
 +snmp_session_set_security($session, 'authPriv', 'MD5', $auth_pass, 'AES', $priv_pass);
 +$oid1 = 'SNMPv2-MIB::sysContact.0';
 +$oldvalue1 = snmpget($session, $oid1);
 +$newvalue1 = $oldvalue1 . '0';
 +
 +$z = snmpset($session, $oid1, 's', $newvalue1);
 +var_dump($z);
 +var_dump((snmpget($session, $oid1) === $newvalue1));
 +$z = snmpset($session, $oid1, 's', $oldvalue1);
 +var_dump($z);
 +var_dump((snmpget($session, $oid1) === $oldvalue1));
 +var_dump(snmp_session_close($session));
 +
 +echo "SNMPv3, setting contextEngineID (authPriv)\n";
 +$session = snmp_session_open(SNMP_VERSION_3, $hostname, $rwuser, $timeout, $retries);
 +snmp_session_set_security($session, 'authPriv', 'MD5', $auth_pass, 'AES', $priv_pass, '', 'aeeeff');
 +var_dump($session);
 +var_dump(snmpget($session, '.1.3.6.1.2.1.1.1.0'));
 +var_dump(snmp_session_close($session));
 +
 +?>
 +--EXPECTF--
 +SNMPv1
 +resource(%d) of type (SNMP session)
 +string(%d) "%s"
 +string(%d) "%s"
 +bool(true)
 +SNMPv2
 +resource(%d) of type (SNMP session)
 +string(%d) "%s"
 +string(%d) "%s"
 +bool(true)
 +WALK multiple on single OID
 +resource(%d) of type (SNMP session)
 +string(5) "array"
 +int(%d)
 +int(0)
 +string(%d) "%s"
 +bool(true)
 +WALK multiple on single OID, non_repeaters set to 0
 +resource(%d) of type (SNMP session)
 +string(5) "array"
 +int(%d)
 +int(0)
 +string(%d) "%s"
 +bool(true)
 +WALK multiple on single OID, non_repeaters set to 0, max_repetitions set to 30
 +resource(%d) of type (SNMP session)
 +string(5) "array"
 +int(%d)
 +int(0)
 +string(%d) "%s"
 +bool(true)
 +SNMPv3 (default security settings)
 +resource(%d) of type (SNMP session)
 +string(%d) "%s"
 +string(%d) "%s"
 +bool(true)
 +SNMPv3 (noAuthNoPriv)
 +resource(%d) of type (SNMP session)
 +string(%d) "%s"
 +string(%d) "%s"
 +bool(true)
 +SNMPv3 (authPriv)
 +resource(%d) of type (SNMP session)
 +string(%d) "%s"
 +string(%d) "%s"
 +array(1) {
 +  [0]=>
 +  string(%d) "%s"
 +}
 +bool(true)
 +SET single OID
 +bool(true)
 +bool(true)
 +bool(true)
 +bool(true)
 +bool(true)
 +SNMPv3, setting contextEngineID (authPriv)
 +resource(%d) of type (SNMP session)
 +string(%d) "%s"
 +bool(true)
 \ No newline at end of file
 diff -urN -x .svn ext/snmp/tests/snmp2_get.phpt ext/snmp/tests/snmp2_get.phpt
  --- ext/snmp/tests/snmp2_get.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmp2_get.phpt	2010-12-21 17:08:24.000000000 +0300
  @@ -0,0 +1,107 @@
  +--TEST--                                 
Line 480 (now 222), was 9 lines, now 8 lines

  +array(1) {
  +  [0]=>
  +  %unicode|string%(%d) "%s"
  +}
 diff -urN -x .svn ext/snmp/tests/snmp2_getnext.phpt ext/snmp/tests/snmp2_getnext.phpt
  --- ext/snmp/tests/snmp2_getnext.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmp2_getnext.phpt	2010-12-19 22:44:42.000000000 +0300
  @@ -0,0 +1,39 @@
  +--TEST--                                 
Line 523 (now 264), was 9 lines, now 8 lines

  +  %unicode|string%(%d) "%s"
  +  [1]=>
  +  %unicode|string%(%d) "%d"
  +}
 diff -urN -x .svn ext/snmp/tests/snmp2_real_get.phpt ext/snmp/tests/snmp2_real_get.phpt
  --- ext/snmp/tests/snmp2_real_get.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmp2_real_get.phpt	2010-12-19 18:46:41.000000000 +0300
  @@ -0,0 +1,104 @@
  +--TEST--                                 
Line 631 (now 371), was 9 lines, now 8 lines

  +array(1) {
  +  [%s]=>
  +  %unicode|string%(%d) "%s"
  +}
 diff -urN -x .svn ext/snmp/tests/snmp2_real_getnext.phpt ext/snmp/tests/snmp2_real_getnext.phpt
  --- ext/snmp/tests/snmp2_real_getnext.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmp2_real_getnext.phpt	2010-12-20 11:22:38.000000000 +0300
  @@ -0,0 +1,42 @@
  +--TEST--                                 
Line 677 (now 416), was 9 lines, now 8 lines

  +  %unicode|string%(%d) "%s"
  +  [%s]=>
  +  %unicode|string%(%d) "%d"
  +}
 diff -urN -x .svn ext/snmp/tests/snmp2_real_walk.phpt ext/snmp/tests/snmp2_real_walk.phpt
  --- ext/snmp/tests/snmp2_real_walk.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmp2_real_walk.phpt	2010-12-21 23:31:59.000000000 +0300
  @@ -0,0 +1,86 @@
  +--TEST--                                 
Line 767 (now 505), was 14 lines, now 13 lines

  +Single nonexisting OID
  +
  +Warning: snmp2_real_walk(): Error in packet at '%s': No more variables left in this MIB View (It is past the end of the MIB tree) in %s on line %d
  +bool(false)
 diff -urN -x .svn ext/snmp/tests/snmp2_set-nomib.phpt ext/snmp/tests/snmp2_set-nomib.phpt
  --- ext/snmp/tests/snmp2_set-nomib.phpt	1970-01-01 03:00:00.000000000 +0300
 +++ ext/snmp/tests/snmp2_set-nomib.phpt	2010-12-27 23:49:25.000000000 +0300
 +++ ext/snmp/tests/snmp2_set-nomib.phpt	2010-12-20 11:05:38.000000000 +0300
  @@ -0,0 +1,59 @@
  +--TEST--                                 
 +Function snmp2_set (without MIBs loading)
 +Function snmp2_set
  +--CREDITS--
  +Boris Lytockin
  +--SKIPIF--
  +<?php
Line 831 (now 568), was 9 lines, now 8 lines

  +bool(true)
  +bool(true)
  +bool(true)
  \ No newline at end of file
 diff -urN -x .svn ext/snmp/tests/snmp2_set.phpt ext/snmp/tests/snmp2_set.phpt
  --- ext/snmp/tests/snmp2_set.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmp2_set.phpt	2010-12-20 10:36:16.000000000 +0300
  @@ -0,0 +1,248 @@
  +--TEST--                                 
Line 1083 (now 819), was 9 lines, now 8 lines

  +Warning: snmp2_set(): Could not add variable: OID='%s' type='w' value='%s': Bad variable type ("w") in %s on line %d
  +bool(false)
  +bool(true)
  +bool(true)
 diff -urN -x .svn ext/snmp/tests/snmp2_walk.phpt ext/snmp/tests/snmp2_walk.phpt
  --- ext/snmp/tests/snmp2_walk.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmp2_walk.phpt	2010-12-21 23:31:59.000000000 +0300
  @@ -0,0 +1,99 @@
  +--TEST--                                 
Line 1186 (now 921), was 14 lines, now 13 lines

  +Single nonexisting OID
  +
  +Warning: snmp2_walk(): Error in packet at '%s': No more variables left in this MIB View (It is past the end of the MIB tree) in %s on line %d
  +bool(false)
 diff -urN -x .svn ext/snmp/tests/snmp3-error.phpt ext/snmp/tests/snmp3-error.phpt
  --- ext/snmp/tests/snmp3-error.phpt	1970-01-01 03:00:00.000000000 +0300
 +++ ext/snmp/tests/snmp3-error.phpt	2010-12-27 23:48:55.000000000 +0300
 +++ ext/snmp/tests/snmp3-error.phpt	2010-12-21 22:11:55.000000000 +0300
  @@ -0,0 +1,76 @@
  +--TEST--                                 
 +SNMPv3 Support (errors)
 +SNMPv3 Support
  +--CREDITS--
  +Boris Lytochkin
  +--SKIPIF--
  +<?php
Line 1267 (now 1001), was 9 lines, now 8 lines

  +
  +Warning: snmp3_set(): Single objid and multiple type or values are not supported in %s on line %d
  +bool(false)
  \ No newline at end of file
 diff -urN -x .svn ext/snmp/tests/snmp3.phpt ext/snmp/tests/snmp3.phpt
  --- ext/snmp/tests/snmp3.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmp3.phpt	2010-12-21 23:32:14.000000000 +0300
  @@ -0,0 +1,141 @@
  +--TEST--                                 
Line 1412 (now 1145), was 9 lines, now 8 lines

  +bool(true)
  +bool(true)
  +bool(true)
  +bool(true)
 diff -urN -x .svn ext/snmp/tests/snmp_get_quick_print.phpt ext/snmp/tests/snmp_get_quick_print.phpt
  --- ext/snmp/tests/snmp_get_quick_print.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmp_get_quick_print.phpt	2010-12-19 14:03:23.000000000 +0300
  @@ -0,0 +1,41 @@
  +--TEST--                                 
Line 1457 (now 1189), was 9 lines, now 8 lines

  +bool(%s)
  +bool(false)
  +bool(true)
  +
 diff -urN -x .svn ext/snmp/tests/snmp_get_valueretrieval.phpt ext/snmp/tests/snmp_get_valueretrieval.phpt
  --- ext/snmp/tests/snmp_get_valueretrieval.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmp_get_valueretrieval.phpt	2010-12-19 14:17:55.000000000 +0300
  @@ -0,0 +1,37 @@
  +--TEST--                                 
Line 1498 (now 1229), was 9 lines, now 8 lines

  +int(%d)
  +bool(true)
  +bool(true)
  +bool(true)
 diff -urN -x .svn ext/snmp/tests/snmp_getvalue.phpt ext/snmp/tests/snmp_getvalue.phpt
  --- ext/snmp/tests/snmp_getvalue.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmp_getvalue.phpt	2010-12-19 19:37:10.000000000 +0300
  @@ -0,0 +1,46 @@
  +--TEST--                                 
Line 1548 (now 1278), was 9 lines, now 8 lines

  +int(4)
  +string(%d) "%s"
  +Check parsing of different OID types
  +int(%d)
 diff -urN -x .svn ext/snmp/tests/snmp_include.inc ext/snmp/tests/snmp_include.inc
  --- ext/snmp/tests/snmp_include.inc	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmp_include.inc	2010-12-21 15:40:33.000000000 +0300
  @@ -0,0 +1,29 @@
  +<?php
Line 1581 (now 1310), was 9 lines, now 8 lines

  +$user_auth_prefix = getenv('SNMP_USER_PREFIX') ? getenv('SNMP_USER_PREFIX') :	'admin';
  +$rwuser = 	getenv('SNMP_RWUSER') ? 	getenv('SNMP_RWUSER') :		($user_auth_prefix . 'MD5AES');
  +$auth_pass =	getenv('SNMP_AUTH_PASS') ?	getenv('SNMP_AUTH_PASS') :	'test1234';
  +$priv_pass =	getenv('SNMP_PRIV_PASS') ?	getenv('SNMP_PRIV_PASS') :	'test1234';
 diff -urN -x .svn ext/snmp/tests/snmp_parse_oid.phpt ext/snmp/tests/snmp_parse_oid.phpt
  --- ext/snmp/tests/snmp_parse_oid.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmp_parse_oid.phpt	2010-12-20 15:10:06.000000000 +0300
  @@ -0,0 +1,36 @@
  +--TEST--                                 
Line 1622 (now 1350), was 9 lines, now 8 lines

  +
  +Warning: snmp2_get(): Could not process more than %d OIDs in singe GET/GETNEXT/SET query in %s on line %d
  +bool(false)
  \ No newline at end of file
 diff -urN -x .svn ext/snmp/tests/snmp_read_mib.phpt ext/snmp/tests/snmp_read_mib.phpt
  --- ext/snmp/tests/snmp_read_mib.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmp_read_mib.phpt	2010-12-21 23:31:59.000000000 +0300
  @@ -0,0 +1,34 @@
  +--TEST--                                 
Line 1660 (now 1387), was 78 lines, now 8 lines

  +Warning: snmp_read_mib(): Error while reading MIB file '%s': No such file or directory in %s on line %d
  +bool(false)
  +Checking working
  +bool(true)
 diff -urN -x .svn ext/snmp/tests/snmp_session_set_security.phpt ext/snmp/tests/snmp_session_set_security.phpt
 --- ext/snmp/tests/snmp_session_set_security.phpt	1970-01-01 03:00:00.000000000 +0300
 +++ ext/snmp/tests/snmp_session_set_security.phpt	2010-12-29 15:40:57.000000000 +0300
 @@ -0,0 +1,64 @@
 +--TEST--                                 
 +Function snmpget
 +--CREDITS--
 +Boris Lytochkin
 +--SKIPIF--
 +<?php
 +require_once(dirname(__FILE__).'/skipif.inc');
 +?>
 +--FILE--
 +<?php
 +require_once(dirname(__FILE__).'/snmp_include.inc');
 +
 +//EXPECTF format is quickprint OFF
 +snmp_set_quick_print(false);
 +snmp_set_valueretrieval(SNMP_VALUE_PLAIN);
 +
 +$session = snmp_session_open(SNMP_VERSION_3, $hostname, $user_noauth, $timeout, $retries);
 +snmp_session_set_security($session, 'noAuthNoPriv');
 +var_dump($session);
 +
 +#echo "Checking error handling\n";
 +var_dump(snmp_session_set_security($session, ''));
 +var_dump(snmp_session_set_security($session, 'bugusPriv'));
 +var_dump(snmp_session_set_security($session, 'authNoPriv', 'TTT'));
 +var_dump(snmp_session_set_security($session, 'authNoPriv', 'MD5', ''));
 +var_dump(snmp_session_set_security($session, 'authNoPriv', 'MD5', 'te'));
 +var_dump(snmp_session_set_security($session, 'authPriv', 'MD5', $auth_pass, 'BBB'));
 +var_dump(snmp_session_set_security($session, 'authPriv', 'MD5', $auth_pass, 'AES', ''));
 +var_dump(snmp_session_set_security($session, 'authPriv', 'MD5', $auth_pass, 'AES', 'ty'));
 +var_dump(snmp_session_set_security($session, 'authPriv', 'MD5', $auth_pass, 'AES', 'test12345', 'context', 'dsa'));
 +
 +var_dump(snmp_session_close($session));
 +
 +?>
 +--EXPECTF--
 +resource(%d) of type (SNMP session)
 +
 +Warning: snmp_session_set_security(): Invalid security level '' in %s on line %d
 +bool(false)
 +
 +Warning: snmp_session_set_security(): Invalid security level 'bugusPriv' in %s on line %d
 +bool(false)
 +
 +Warning: snmp_session_set_security(): Unknown authentication protocol 'TTT' in %s on line %d
 +bool(false)
 +
 +Warning: snmp_session_set_security(): 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: snmp_session_set_security(): 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: snmp_session_set_security(): Unknown security protocol 'BBB' in %s on line %d
 +bool(false)
 +
 +Warning: snmp_session_set_security(): 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: snmp_session_set_security(): 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: snmp_session_set_security(): Bad engine ID value 'dsa' in %s on line %d
 +bool(false)
 +bool(true)
 \ No newline at end of file
 diff -urN -x .svn ext/snmp/tests/snmp_set_enum_print.phpt ext/snmp/tests/snmp_set_enum_print.phpt
  --- ext/snmp/tests/snmp_set_enum_print.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmp_set_enum_print.phpt	2010-12-19 14:16:50.000000000 +0300
  @@ -0,0 +1,28 @@
  +--TEST--                                 
Line 1761 (now 1418), was 9 lines, now 8 lines

  +bool(false)
  +Checking working
  +bool(true)
  +bool(true)
 diff -urN -x .svn ext/snmp/tests/snmp_set_oid_output_format.phpt ext/snmp/tests/snmp_set_oid_output_format.phpt
  --- ext/snmp/tests/snmp_set_oid_output_format.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmp_set_oid_output_format.phpt	2010-12-19 14:05:11.000000000 +0300
  @@ -0,0 +1,28 @@
  +--TEST--                                 
Line 1793 (now 1449), was 12 lines, now 11 lines

  +bool(false)
  +Checking working
  +bool(true)
  +bool(true)
 diff -urN -x .svn ext/snmp/tests/snmpget.phpt ext/snmp/tests/snmpget.phpt
  --- ext/snmp/tests/snmpget.phpt	1970-01-01 03:00:00.000000000 +0300
 +++ ext/snmp/tests/snmpget.phpt	2010-12-29 13:58:37.000000000 +0300
 @@ -0,0 +1,109 @@
 +++ ext/snmp/tests/snmpget.phpt	2010-12-19 18:07:17.000000000 +0300
 @@ -0,0 +1,101 @@
  +--TEST--                                 
  +Function snmpget
  +--CREDITS--
  +Olivier Doucet & Boris Lytochkin
Line 1818 (now 1473), was 12 lines, now 8 lines

  +var_dump(snmpget($hostname, $community, '.1.3.6.1.2.1.1.1.0', ''));
  +var_dump(snmpget($hostname, $community, '.1.3.6.1.2.1.1.1.0', $timeout, ''));
  +
  +echo "Checking working\n";
 +echo "Single OID, default timeout and retries\n";
 +var_dump(snmpget($hostname, $community, '.1.3.6.1.2.1.1.1.0'));
 +echo "Single OID, default retries\n";
 +var_dump(snmpget($hostname, $community, '.1.3.6.1.2.1.1.1.0', $timeout));
  +echo "Single OID\n";
  +var_dump(snmpget($hostname, $community, '.1.3.6.1.2.1.1.1.0', $timeout, $retries));
  +echo "Single OID in array\n";
  +var_dump(snmpget($hostname, $community, array('.1.3.6.1.2.1.1.1.0'), $timeout, $retries));
Line 1856 (now 1507), was 12 lines, now 8 lines

  +
  +Warning: snmpget() expects parameter 5 to be long,%s given in %s on line %d
  +bool(false)
  +Checking working
 +Single OID, default timeout and retries
 +%unicode|string%(%d) "%s"
 +Single OID, default retries
 +%unicode|string%(%d) "%s"
  +Single OID
  +%unicode|string%(%d) "%s"
  +Single OID in array
  +array(1) {
Line 1906 (now 1553), was 9 lines, now 8 lines

  +array(1) {
  +  [0]=>
  +  %unicode|string%(%d) "%s"
  +}
 diff -urN -x .svn ext/snmp/tests/snmpgetnext.phpt ext/snmp/tests/snmpgetnext.phpt
  --- ext/snmp/tests/snmpgetnext.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmpgetnext.phpt	2010-12-19 22:42:55.000000000 +0300
  @@ -0,0 +1,39 @@
  +--TEST--                                 
Line 1949 (now 1595), was 9 lines, now 8 lines

  +  %unicode|string%(%d) "%s"
  +  [1]=>
  +  %unicode|string%(%d) "%d"
  +}
 diff -urN -x .svn ext/snmp/tests/snmprealget.phpt ext/snmp/tests/snmprealget.phpt
  --- ext/snmp/tests/snmprealget.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmprealget.phpt	2010-12-19 18:40:08.000000000 +0300
  @@ -0,0 +1,104 @@
  +--TEST--                                 
Line 2057 (now 1702), was 9 lines, now 8 lines

  +array(1) {
  +  [%s]=>
  +  %unicode|string%(%d) "%s"
  +}
 diff -urN -x .svn ext/snmp/tests/snmprealgetnext.phpt ext/snmp/tests/snmprealgetnext.phpt
  --- ext/snmp/tests/snmprealgetnext.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmprealgetnext.phpt	2010-12-20 11:16:47.000000000 +0300
  @@ -0,0 +1,42 @@
  +--TEST--                                 
Line 2103 (now 1747), was 9 lines, now 8 lines

  +  %unicode|string%(%d) "%s"
  +  [%s]=>
  +  %unicode|string%(%d) "%d"
  +}
 diff -urN -x .svn ext/snmp/tests/snmprealwalk.phpt ext/snmp/tests/snmprealwalk.phpt
  --- ext/snmp/tests/snmprealwalk.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmprealwalk.phpt	2010-12-21 23:31:59.000000000 +0300
  @@ -0,0 +1,86 @@
  +--TEST--                                 
Line 2193 (now 1836), was 14 lines, now 13 lines

  +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)
 diff -urN -x .svn ext/snmp/tests/snmpset-nomib.phpt ext/snmp/tests/snmpset-nomib.phpt
  --- ext/snmp/tests/snmpset-nomib.phpt	1970-01-01 03:00:00.000000000 +0300
 +++ ext/snmp/tests/snmpset-nomib.phpt	2010-12-27 23:50:26.000000000 +0300
 +++ ext/snmp/tests/snmpset-nomib.phpt	2010-12-21 23:32:27.000000000 +0300
  @@ -0,0 +1,60 @@
  +--TEST--                                 
 +Function snmpset (without MIBs loading)
 +Function snmpset
  +--CREDITS--
  +Boris Lytochkin
  +--SKIPIF--
  +<?php
Line 2258 (now 1900), was 9 lines, now 8 lines

  +bool(true)
  +bool(true)
  +bool(true)
  \ No newline at end of file
 diff -urN -x .svn ext/snmp/tests/snmpset.phpt ext/snmp/tests/snmpset.phpt
  --- ext/snmp/tests/snmpset.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmpset.phpt	2010-12-21 23:31:59.000000000 +0300
  @@ -0,0 +1,248 @@
  +--TEST--                                 
Line 2510 (now 2151), was 9 lines, now 8 lines

  +Warning: snmpset(): Could not add variable: OID='%s' type='w' value='%s': Bad variable type ("w") in %s on line %d
  +bool(false)
  +bool(true)
  +bool(true)
 diff -urN -x .svn ext/snmp/tests/snmpwalk.phpt ext/snmp/tests/snmpwalk.phpt
  --- ext/snmp/tests/snmpwalk.phpt	1970-01-01 03:00:00.000000000 +0300
  +++ ext/snmp/tests/snmpwalk.phpt	2010-12-21 23:31:59.000000000 +0300
  @@ -0,0 +1,99 @@
  +--TEST--                                 
Line 2613 (now 2253), was 31 lines, now 4 lines

  +Single nonexisting OID
  +
  +Warning: snmpwalk(): Error in packet at '%s': (noSuchName) There is no such variable name in this MIB. in %s on line %d
  +bool(false)
 diff -urN -x .svn ext/snmp/tests/wrong_hostname.phpt ext/snmp/tests/wrong_hostname.phpt
 --- ext/snmp/tests/wrong_hostname.phpt	1970-01-01 03:00:00.000000000 +0300
 +++ ext/snmp/tests/wrong_hostname.phpt	2010-12-28 01:15:29.000000000 +0300
 @@ -0,0 +1,22 @@
 +--TEST--                                 
 +Generic timeout (wrong community)
 +--CREDITS--
 +Boris Lytochkin
 +--SKIPIF--
 +<?php
 +require_once(dirname(__FILE__).'/skipif.inc');
 +?>
 +--FILE--
 +<?php
 +require_once(dirname(__FILE__).'/snmp_include.inc');
 +
 +//EXPECTF format is quickprint OFF
 +snmp_set_quick_print(false);
 +snmp_set_valueretrieval(SNMP_VALUE_PLAIN);
 +
 +var_dump(snmpget('192.168..6.1', 'community', '.1.3.6.1.2.1.1.1.0', $timeout, $retries));
 +
 +?>
 +--EXPECTF--
 +Warning: snmpget(): Could not open snmp connection: Unknown host (192.168..6.1) (Bad file descriptor) in %s on line %d
 +bool(false)
 \ No newline at end of file
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 13:02:15 2014 UTC