php-src/ext/snmp/tests
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00
..
bigtest.sh
bug60749.phpt Use EXPECT instead of EXPECTF when possible 2018-02-20 21:53:48 +01:00
bug64124.phpt Remove more PHP 6 leftovers from tests 2016-11-24 22:39:39 +01:00
bug64159.phpt
bug72479.phpt Fixed bug #72479 - same as #72434 2016-06-26 18:02:58 -07:00
clean.inc
generic_timeout_error.phpt
ipv6.phpt Remove more PHP 6 leftovers from tests 2016-11-24 22:39:39 +01:00
README
reflection.phpt Use EXPECT instead of EXPECTF when possible 2018-02-20 21:53:48 +01:00
skipif.inc Remove trailing whitespace in inc files 2018-02-10 19:20:23 +01:00
snmp2_get.phpt Fixed tests 2018-02-06 15:36:31 +03:00
snmp2_getnext.phpt Remove more PHP 6 leftovers from tests 2016-11-24 22:39:39 +01:00
snmp2_real_walk.phpt Use int instead of integer in type errors 2018-02-04 19:08:23 +01:00
snmp2_set-nomib.phpt
snmp2_set.phpt Use %d when expecting line number in tests 2018-02-02 22:35:13 +01:00
snmp2_walk.phpt Use int instead of integer in type errors 2018-02-04 19:08:23 +01:00
snmp3-error.phpt
snmp3.phpt
snmp_get_quick_print.phpt Use int instead of integer in type errors 2018-02-04 19:08:23 +01:00
snmp_get_valueretrieval.phpt Use int instead of integer in type errors 2018-02-04 19:08:23 +01:00
snmp_getvalue.phpt
snmp_include.inc
snmp_read_mib.phpt
snmp_set_enum_print.phpt
snmp_set_oid_output_format.phpt
snmp-object-errno-errstr.phpt
snmp-object-error.phpt Use int instead of integer in type errors 2018-02-04 19:08:23 +01:00
snmp-object-properties.phpt
snmp-object-setSecurity_error.phpt
snmp-object.phpt
snmpd.conf
snmpget.phpt Fixed tests 2018-02-06 15:36:31 +03:00
snmpgetnext.phpt Remove more PHP 6 leftovers from tests 2016-11-24 22:39:39 +01:00
snmprealwalk.phpt Use int instead of integer in type errors 2018-02-04 19:08:23 +01:00
snmpset-nomib.phpt
snmpset.phpt Use %d when expecting line number in tests 2018-02-02 22:35:13 +01:00
snmpwalk.phpt Use int instead of integer in type errors 2018-02-04 19:08:23 +01: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]