php-src/ext/snmp/tests
Stanislav Malyshev 6a4803026d Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Remove wrong argument $session from SNMP::setSecurity()
  Fix SNMP::setSecurity() arginfo (Fixes bug #70476)
2015-10-18 14:51:13 -07:00
..
bigtest.sh re-work walkaround for net-snmp BUGid 2027834, no need to detect it anymore 2013-05-03 23:06:34 +04:00
bug60749.phpt merge from trunk: 2012-01-13 18:46:56 +00:00
bug64124.phpt fix bug #64124 (IPv6 malformed) 2013-02-07 14:48:28 +04:00
bug64159.phpt fix typo in test 2013-06-16 00:09:18 +04:00
clean.inc
generic_timeout_error.phpt merge from trunk two commits: 2011-08-20 16:10:48 +00:00
ipv6.phpt more test coverage: missing square bracket error message 2013-03-17 20:40:15 +04:00
README re-work walkaround for net-snmp BUGid 2027834, no need to detect it anymore 2013-05-03 23:06:34 +04:00
reflection.phpt Remove wrong argument $session from SNMP::setSecurity() 2015-10-18 14:48:39 -07:00
skipif.inc
snmp2_get.phpt Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
snmp2_getnext.phpt
snmp2_real_walk.phpt Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
snmp2_set-nomib.phpt follow CS: 2011-03-20 20:07:33 +00:00
snmp2_set.phpt * fix warning about redefining REGISTER_PDO_CLASS_CONST_LONG (damn copy'n'paste) 2011-03-04 18:58:01 +00:00
snmp2_walk.phpt Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
snmp3-error.phpt more tuning based on discussion in FR #40816: 2011-08-31 08:36:22 +00:00
snmp3.phpt
snmp_get_quick_print.phpt Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
snmp_get_valueretrieval.phpt Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
snmp_getvalue.phpt fix FR #54502: allow user to change OID value output mode when SNMP_VALUE_OBJECT is used. 2011-07-17 17:18:31 +00:00
snmp_include.inc merge from trunk two commits: 2011-08-20 16:10:48 +00:00
snmp_read_mib.phpt
snmp_set_enum_print.phpt
snmp_set_oid_output_format.phpt
snmp-object-errno-errstr.phpt test coverage for SNMP::ERRNO_MULTIPLE_SET_QUERIES 2011-08-31 19:45:45 +00:00
snmp-object-error.phpt Updated tests to reflect exception class changes. 2015-05-16 16:49:14 -05:00
snmp-object-properties.phpt merge from trunk 2011-09-02 10:13:30 +00:00
snmp-object-setSecurity_error.phpt merging from trunk (r312088...r312092): 2011-06-12 12:10:01 +00:00
snmp-object.phpt remove OS-specific OIDs from 2013-05-04 00:04:52 +04:00
snmpd.conf re-work walkaround for net-snmp BUGid 2027834, no need to detect it anymore 2013-05-03 23:06:34 +04:00
snmpget.phpt Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
snmpgetnext.phpt
snmprealwalk.phpt Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
snmpset-nomib.phpt follow CS: 2011-03-20 20:07:33 +00:00
snmpset.phpt
snmpwalk.phpt Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
wrong_hostname.phpt Fixed test (system error messages may be different). 2015-10-07 03:25:12 +03:00

SNMP Tests
----------

To enable these tests, you must have :
- PHP compiled with SNMP (--with-snmp)
- an SNMP server running.


** How to test **
You need to give credentials with environment vars if default ones are not
sutable (see snmp_include.inc for more info):
SNMP_HOSTNAME : IPv4 of remote SNMP agent
SNMP_HOSTNAME : IPv6 or remote SNMP agent
SNMP_PORT : SNMP port for queries
SNMP_COMMUNITY : community name
SNMP_COMMUNITY_WRITE : community used for write tests (snmpset()).
SNMP_MIBDIR : Directory containing MIBS

To run test suite you may use this command (presuming that you pwd is where
this README file is located):
> make -C ../../.. test TESTS="`cd ../../..; /bin/ls -1 ext/snmp/tests/*.phpt | xargs echo`"
Running run-tests.php directly will clear your environment and therefore
tests will fail if your SNMP configuration does not fit into default values
specified in snmp_include.inc.

** Configuring the SNMPD server **

On Linux/FreeBSD
--------

- Install package net-snmpd (name may differ based on your distribution).
- Replace config file (by default this is /etc/snmp/snmpd.conf on Linux and
  /usr/local/etc/snmp/snmpd.conf on FreeBSD) with snmpd.conf supplied.
  
Before launching daemon make sure that there is no file /var/net-snmp/snmpd.conf
Delete it if exists. Ingoring to to so will fail SNMPv3 tests.

- Place bigtest.sh near snmpd.conf, tune path to it in snmpd.conf

- Launch snmpd (service snmpd start or /etc/init.d/snmpd start).
  Alternatively you can start snmpd daemon using following command line:
    sudo snmpd -C -c ./snmpd.conf -f -Le


On Windows
----------

[to be completed]