Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 28-May-2021 | - | ||||
CONFLICTS | H A D | 02-Dec-2020 | 5 | 2 | 1 | |
README.md | H A D | 02-Dec-2020 | 1.6 KiB | 54 | 39 | |
bigtest | H A D | 02-Dec-2020 | 141 | 11 | 7 | |
bug60749.phpt | H A D | 02-Dec-2020 | 675 | 29 | 27 | |
bug64124.phpt | H A D | 02-Dec-2020 | 1,006 | 41 | 35 | |
bug64159.phpt | H A D | 02-Dec-2020 | 502 | 25 | 21 | |
bug72479.phpt | H A D | 02-Dec-2020 | 738 | 36 | 34 | |
clean.inc | H A D | 02-Dec-2020 | 94 | 5 | 3 | |
generic_timeout_error.phpt | H A D | 02-Dec-2020 | 651 | 27 | 22 | |
ipv6.phpt | H A D | 02-Dec-2020 | 665 | 30 | 25 | |
skipif.inc | H A D | 02-Dec-2020 | 463 | 13 | 9 | |
snmp-object-errno-errstr.phpt | H A D | 02-Dec-2020 | 5 KiB | 148 | 140 | |
snmp-object-error.phpt | H A D | 02-Dec-2020 | 2.8 KiB | 109 | 100 | |
snmp-object-properties.phpt | H A D | 02-Dec-2020 | 3.8 KiB | 197 | 183 | |
snmp-object-setSecurity_error.phpt | H A D | 02-Dec-2020 | 2.6 KiB | 81 | 66 | |
snmp-object.phpt | H A D | 02-Dec-2020 | 7 KiB | 246 | 226 | |
snmp2_get.phpt | H A D | 02-Dec-2020 | 2.8 KiB | 99 | 85 | |
snmp2_getnext.phpt | H A D | 02-Dec-2020 | 870 | 40 | 36 | |
snmp2_real_walk.phpt | H A D | 02-Dec-2020 | 2.1 KiB | 76 | 64 | |
snmp2_set-nomib.phpt | H A D | 02-Dec-2020 | 1.5 KiB | 58 | 49 | |
snmp2_set.phpt | H A D | 02-Dec-2020 | 10.1 KiB | 260 | 225 | |
snmp2_walk.phpt | H A D | 02-Dec-2020 | 2.4 KiB | 89 | 73 | |
snmp3-error.phpt | H A D | 02-Dec-2020 | 3.2 KiB | 82 | 66 | |
snmp3.phpt | H A D | 02-Dec-2020 | 3.9 KiB | 128 | 116 | |
snmp_get_quick_print.phpt | H A D | 02-Dec-2020 | 456 | 26 | 23 | |
snmp_get_valueretrieval.phpt | H A D | 02-Dec-2020 | 1.2 KiB | 44 | 40 | |
snmp_getvalue.phpt | H A D | 02-Dec-2020 | 2.4 KiB | 84 | 74 | |
snmp_include.inc | H A D | 02-Dec-2020 | 1.1 KiB | 32 | 25 | |
snmp_read_mib.phpt | H A D | 02-Dec-2020 | 695 | 31 | 24 | |
snmp_set_enum_print.phpt | H A D | 02-Dec-2020 | 437 | 22 | 20 | |
snmp_set_oid_output_format.phpt | H A D | 02-Dec-2020 | 775 | 31 | 28 | |
snmpd.conf | H A D | 02-Dec-2020 | 744 | 28 | 18 | |
snmpget.phpt | H A D | 02-Dec-2020 | 2.8 KiB | 96 | 83 | |
snmpgetnext.phpt | H A D | 02-Dec-2020 | 862 | 40 | 36 | |
snmprealwalk.phpt | H A D | 02-Dec-2020 | 2 KiB | 76 | 64 | |
snmpset-nomib.phpt | H A D | 02-Dec-2020 | 1.5 KiB | 59 | 49 | |
snmpset.phpt | H A D | 02-Dec-2020 | 9.9 KiB | 251 | 221 | |
snmpwalk.phpt | H A D | 02-Dec-2020 | 2.4 KiB | 89 | 73 | |
wrong_hostname.phpt | H A D | 02-Dec-2020 | 459 | 23 | 19 |
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