|
|
||
|---|---|---|
| .. | ||
| CONFLICTS | ||
| README.md | ||
| bigtest | ||
| bug60749.phpt | ||
| bug64124.phpt | ||
| bug64159.phpt | ||
| bug72479.phpt | ||
| clean.inc | ||
| generic_timeout_error.phpt | ||
| ipv6.phpt | ||
| skipif.inc | ||
| snmp-object-errno-errstr.phpt | ||
| snmp-object-error.phpt | ||
| snmp-object-properties.phpt | ||
| snmp-object-setSecurity_error.phpt | ||
| snmp-object.phpt | ||
| snmp2_get.phpt | ||
| snmp2_getnext.phpt | ||
| snmp2_real_walk.phpt | ||
| snmp2_set-nomib.phpt | ||
| snmp2_set.phpt | ||
| snmp2_walk.phpt | ||
| snmp3-error.phpt | ||
| snmp3.phpt | ||
| snmp_get_quick_print.phpt | ||
| snmp_get_valueretrieval.phpt | ||
| snmp_getvalue.phpt | ||
| snmp_include.inc | ||
| snmp_read_mib.phpt | ||
| snmp_set_enum_print.phpt | ||
| snmp_set_oid_output_format.phpt | ||
| snmpd.conf | ||
| snmpget.phpt | ||
| snmpgetnext.phpt | ||
| snmprealwalk.phpt | ||
| snmpset-nomib.phpt | ||
| snmpset.phpt | ||
| snmpwalk.phpt | ||
| wrong_hostname.phpt | ||
README.md
The snmp extension 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
suitable (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
- On Ubuntu, install
snmpdandsnmp-mibs-downloader. (May benet-snmpdon other distributions.) - Replace config file (by default this is
/etc/snmp/snmpd.confon Linux and/usr/local/etc/snmp/snmpd.confon FreeBSD) withsnmpd.confsupplied.
Before launching daemon make sure that there is no file
/var/net-snmp/snmpd.conf. Delete it if exists. Forgetting to do so will fail
SNMPv3 tests.
-
Place
ext/snmp/tests/bigtestnearsnmpd.conf, tune path to it insnmpd.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