php-src/ext/snmp/tests
Peter Kokot d679f02295 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:33:09 +02:00
..
bigtest Rename ext/snmp/tests/bigtest.sh to bigtest 2018-09-27 02:41:54 +02:00
bug60749.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
bug64124.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
bug64159.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
bug72479.phpt Sync leading and final newlines in *.phpt sections 2018-10-15 04:33:09 +02:00
clean.inc
generic_timeout_error.phpt Sync leading and final newlines in *.phpt sections 2018-10-15 04:33:09 +02:00
ipv6.phpt Sync leading and final newlines in *.phpt sections 2018-10-15 04:33:09 +02:00
README Trim trailing whitespace in source code files 2018-10-13 14:17:28 +02:00
reflection.phpt Use EXPECT instead of EXPECTF when possible 2018-02-20 21:53:48 +01:00
skipif.inc Sync leading and final newlines in source code files 2018-10-14 12:56:38 +02:00
snmp2_get.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmp2_getnext.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmp2_real_walk.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmp2_set-nomib.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmp2_set.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmp2_walk.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmp3-error.phpt Trim trailing whitespace in *.phpt 2018-10-14 19:46:15 +02:00
snmp3.phpt Trim trailing whitespace in *.phpt 2018-10-14 19:46:15 +02:00
snmp_get_quick_print.phpt Sync leading and final newlines in *.phpt sections 2018-10-15 04:33:09 +02:00
snmp_get_valueretrieval.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmp_getvalue.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmp_include.inc merge from trunk two commits: 2011-08-20 16:10:48 +00:00
snmp_read_mib.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmp_set_enum_print.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmp_set_oid_output_format.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmp-object-errno-errstr.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmp-object-error.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmp-object-properties.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmp-object-setSecurity_error.phpt Sync leading and final newlines in *.phpt sections 2018-10-15 04:33:09 +02:00
snmp-object.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmpd.conf Rename ext/snmp/tests/bigtest.sh to bigtest 2018-09-27 02:41:54 +02:00
snmpget.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmpgetnext.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmprealwalk.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmpset-nomib.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmpset.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
snmpwalk.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
wrong_hostname.phpt Trim trailing whitespace in tests 2018-10-14 12:07:20 -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 ext/snmp/tests/bigtest 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]