Name Date Size #Lines LOC

..01-Dec-2024-

CONFLICTSH A D25-Sep-20245 21

README.mdH A D25-Sep-20241.6 KiB5439

bigtestH A D25-Sep-2024141 117

bigtest.jsH A D25-Sep-2024135 43

bug60749.phptH A D25-Sep-2024694 3129

bug64124.phptH A D25-Sep-20241 KiB4337

bug64159.phptH A D25-Sep-2024601 3229

bug72479.phptH A D25-Sep-2024758 3836

clean.incH A D25-Sep-202494 53

generic_timeout_error.phptH A D25-Sep-2024671 2924

gh16959.phptH A D01-Dec-20241.5 KiB7066

ipv6.phptH A D25-Sep-2024685 3227

skipif.incH A D25-Sep-2024378 118

snmp-object-errno-errstr.phptH A D25-Sep-20245.1 KiB151143

snmp-object-error.phptH A D25-Sep-20242.9 KiB112103

snmp-object-properties-error.phptH A D25-Sep-20242 KiB8774

snmp-object-properties.phptH A D25-Sep-20243.9 KiB201186

snmp-object-setSecurity_error.phptH A D25-Sep-20242.6 KiB8368

snmp-object.phptH A D25-Sep-20247 KiB248228

snmp2_get.phptH A D25-Sep-20242.8 KiB10288

snmp2_getnext.phptH A D25-Sep-2024890 4238

snmp2_real_walk.phptH A D25-Sep-20242.1 KiB7866

snmp2_set-nomib.phptH A D25-Sep-20241.6 KiB6152

snmp2_set.phptH A D25-Sep-202410.1 KiB262227

snmp2_walk.phptH A D25-Sep-20242.5 KiB9276

snmp3-error.phptH A D25-Sep-20243.3 KiB8569

snmp3.phptH A D25-Sep-20243.9 KiB130118

snmp_get_quick_print.phptH A D25-Sep-2024476 2825

snmp_get_valueretrieval.phptH A D25-Sep-20241.3 KiB4642

snmp_getvalue.phptH A D25-Sep-20242.5 KiB8878

snmp_include.incH A D25-Sep-20241.1 KiB3225

snmp_read_mib.phptH A D25-Sep-2024715 3326

snmp_set_enum_print.phptH A D25-Sep-2024457 2422

snmp_set_oid_output_format.phptH A D25-Sep-2024795 3330

snmpd.confH A D25-Sep-2024746 2817

snmpget.phptH A D25-Sep-20242.9 KiB9986

snmpgetnext.phptH A D25-Sep-2024882 4238

snmprealwalk.phptH A D25-Sep-20242.1 KiB7866

snmpset-nomib.phptH A D25-Sep-20241.6 KiB6252

snmpset.phptH A D25-Sep-20249.9 KiB253223

snmpwalk.phptH A D25-Sep-20242.4 KiB9276

wrong_hostname.phptH A D25-Sep-2024479 2521

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* On Ubuntu, install `snmpd` and `snmp-mibs-downloader`. (May be `net-snmpd`
38  on other distributions.)
39* Replace config file (by default this is `/etc/snmp/snmpd.conf` on Linux and
40  `/usr/local/etc/snmp/snmpd.conf` on FreeBSD) with `snmpd.conf` supplied.
41
42Before launching daemon make sure that there is no file
43`/var/net-snmp/snmpd.conf`. Delete it if exists. Forgetting to do so will fail
44SNMPv3 tests.
45
46* Place `ext/snmp/tests/bigtest` near `snmpd.conf`, tune path to it in
47  `snmpd.conf`.
48* Launch snmpd (service snmpd start or /etc/init.d/snmpd start). Alternatively
49  you can start snmpd daemon using following command line:
50
51    ```bash
52    sudo snmpd -C -c ./snmpd.conf -f -Le
53    ```
54