Name Date Size #Lines LOC

..02-Nov-2020-

README.mdH A D05-Dec-20191.6 KiB5338

bigtestH A D05-Dec-2019141 117

bug60749.phptH A D05-Dec-2019666 2927

bug64124.phptH A D05-Dec-20191,003 4135

bug64159.phptH A D05-Dec-2019502 2521

bug72479.phptH A D05-Dec-2019738 3634

clean.incH A D05-Dec-201994 53

generic_timeout_error.phptH A D05-Dec-2019651 2722

ipv6.phptH A D05-Dec-2019662 3025

reflection.phptH A D05-Dec-20192.3 KiB9480

skipif.incH A D05-Dec-2019459 139

snmp-object-errno-errstr.phptH A D05-Dec-20195 KiB148140

snmp-object-error.phptH A D05-Dec-20193.3 KiB123105

snmp-object-properties.phptH A D05-Dec-20193.8 KiB209191

snmp-object-setSecurity_error.phptH A D05-Dec-20192.3 KiB6651

snmp-object.phptH A D05-Dec-20197 KiB246226

snmp2_get.phptH A D05-Dec-20193.1 KiB10588

snmp2_getnext.phptH A D05-Dec-2019870 4036

snmp2_real_walk.phptH A D05-Dec-20192.5 KiB8772

snmp2_set-nomib.phptH A D05-Dec-20191.5 KiB5849

snmp2_set.phptH A D05-Dec-201910 KiB249212

snmp2_walk.phptH A D05-Dec-20192.8 KiB10081

snmp3-error.phptH A D05-Dec-20193.3 KiB7757

snmp3.phptH A D05-Dec-20193.9 KiB128116

snmp_get_quick_print.phptH A D05-Dec-2019925 4134

snmp_get_valueretrieval.phptH A D05-Dec-20191.6 KiB5446

snmp_getvalue.phptH A D05-Dec-20192.4 KiB8474

snmp_include.incH A D05-Dec-20191.1 KiB3225

snmp_read_mib.phptH A D05-Dec-2019814 3527

snmp_set_enum_print.phptH A D05-Dec-2019628 2925

snmp_set_oid_output_format.phptH A D05-Dec-2019862 3328

snmpd.confH A D05-Dec-2019744 2818

snmpget.phptH A D05-Dec-20193.2 KiB10791

snmpgetnext.phptH A D05-Dec-2019862 4036

snmprealwalk.phptH A D05-Dec-20192.4 KiB8772

snmpset-nomib.phptH A D05-Dec-20191.5 KiB5949

snmpset.phptH A D05-Dec-201910 KiB249212

snmpwalk.phptH A D05-Dec-20192.7 KiB10081

wrong_hostname.phptH A D05-Dec-2019459 2319

README.md

1# The snmp extension tests
2
3To enable these tests, you must have:
4
5* PHP compiled with SNMP `--with-snmp`
6* An SNMP server running.
7
8## How to test
9
10You need to give credentials with environment vars if default ones are not
11suitable (see `snmp_include.inc` for more info):
12
13```txt
14SNMP_HOSTNAME : IPv4 of remote SNMP agent
15SNMP_HOSTNAME : IPv6 or remote SNMP agent
16SNMP_PORT : SNMP port for queries
17SNMP_COMMUNITY : community name
18SNMP_COMMUNITY_WRITE : community used for write tests (snmpset()).
19SNMP_MIBDIR : Directory containing MIBS
20```
21
22To run test suite you may use this command (presuming that you pwd is where this
23README file is located):
24
25```bash
26make -C ../../.. test TESTS="`cd ../../..; /bin/ls -1 ext/snmp/tests/*.phpt | xargs echo`"
27```
28
29Running `run-tests.php` directly will clear your environment and therefore tests
30will fail if your SNMP configuration does not fit into default values specified
31in `snmp_include.inc`.
32
33## Configuring the SNMPD server
34
35### On Linux/FreeBSD
36
37* Install package `net-snmpd` (name may differ based on your distribution).
38* Replace config file (by default this is `/etc/snmp/snmpd.conf` on Linux and
39  `/usr/local/etc/snmp/snmpd.conf` on FreeBSD) with `snmpd.conf` supplied.
40
41Before launching daemon make sure that there is no file
42`/var/net-snmp/snmpd.conf`. Delete it if exists. Forgetting to do so will fail
43SNMPv3 tests.
44
45* Place `ext/snmp/tests/bigtest` near `snmpd.conf`, tune path to it in
46  `snmpd.conf`.
47* Launch snmpd (service snmpd start or /etc/init.d/snmpd start). Alternatively
48  you can start snmpd daemon using following command line:
49
50    ```bash
51    sudo snmpd -C -c ./snmpd.conf -f -Le
52    ```
53