diff options
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/imap/tests/README | 40 | ||||
| -rw-r--r-- | ext/imap/tests/README.md | 48 | ||||
| -rw-r--r-- | ext/imap/tests/imap_include.inc | 2 | ||||
| -rw-r--r-- | ext/ldap/tests/README.md (renamed from ext/ldap/tests/README) | 84 | ||||
| -rw-r--r-- | ext/pdo_mysql/tests/README | 16 | ||||
| -rw-r--r-- | ext/pdo_mysql/tests/README.md | 33 | ||||
| -rw-r--r-- | ext/pgsql/tests/README | 16 | ||||
| -rw-r--r-- | ext/pgsql/tests/README.md | 18 | ||||
| -rw-r--r-- | ext/snmp/tests/README | 48 | ||||
| -rw-r--r-- | ext/snmp/tests/README.md | 52 |
10 files changed, 203 insertions, 154 deletions
diff --git a/ext/imap/tests/README b/ext/imap/tests/README deleted file mode 100644 index 99424b3995..0000000000 --- a/ext/imap/tests/README +++ /dev/null @@ -1,40 +0,0 @@ -Many of the tests in this directory require a mail server to be running, if there is no mail server the test will skip and warn, see skipif.inc for details. - -To make the tests run parameters in the skipif.inc and imap_include.inc file will need to be changed to match the local mailserver configuration. - - -The tests have been checked using dovecot (on Linux 32 and 64 bit systems) and hMailServer on Windows. The tests are intended to be mailserver agnostic. - -The tests can be run without modification with a fairly minimal dovecot installation. For information, the dovecot.conf file used in running the tests is given below (after -----). The dovecot password file (dovecotpass) requires a password for one user, webmaster@something.com. It's also necessary to set up one additional user ID (vmail) to own the mail directory. - --------------------------------------------------- -protocols = imap imaps - -listen = * - -ssl_disable = yes - -disable_plaintext_auth=yes - -## Mailbox locations and namespaces - -mail_location = maildir:/home/vmail/mail/%d/%n/Maildir - -auth_verbose = yes - -auth_debug = yes - -auth default { - - mechanisms = login - - passdb passwd-file { - args = /etc/dovecot/dovecotpass - } - - userdb static { - args = uid=11459 gid=1002 home=/home/vmail/dovecot/mail/%d/%n - } - - user = root -} diff --git a/ext/imap/tests/README.md b/ext/imap/tests/README.md new file mode 100644 index 0000000000..381cdc2e8e --- /dev/null +++ b/ext/imap/tests/README.md @@ -0,0 +1,48 @@ +# The imap extension tests + +Many of the tests in this directory require a mail server to be running, if +there is no mail server the test will skip and warn, see skipif.inc for details. + +To make the tests run parameters in the `skipif.inc` and `imap_include.inc` +files will need to be changed to match the local mailserver configuration. + +The tests have been checked using dovecot (on Linux 32 and 64 bit systems) and +hMailServer on Windows. The tests are intended to be mailserver agnostic. + +The tests can be run without modification with a fairly minimal dovecot +installation. For information, the dovecot.conf file used in running the tests +is given below. The dovecot password file (dovecotpass) requires a password for +one user, `webmaster@something.com`. It's also necessary to set up one +additional user ID (vmail) to own the mail directory. + +```txt +protocols = imap imaps + +listen = * + +ssl_disable = yes + +disable_plaintext_auth=yes + +## Mailbox locations and namespaces + +mail_location = maildir:/home/vmail/mail/%d/%n/Maildir + +auth_verbose = yes + +auth_debug = yes + +auth default { + mechanisms = login + + passdb passwd-file { + args = /etc/dovecot/dovecotpass + } + + userdb static { + args = uid=11459 gid=1002 home=/home/vmail/dovecot/mail/%d/%n + } + + user = root +} +``` diff --git a/ext/imap/tests/imap_include.inc b/ext/imap/tests/imap_include.inc index 0425faa4ae..369a560a5f 100644 --- a/ext/imap/tests/imap_include.inc +++ b/ext/imap/tests/imap_include.inc @@ -31,7 +31,7 @@ $mandatory_overview_fields = array( * * Special handling for 'udate', which will vary run-to-run; assumes an IMAP * server with its clock synced to the current system, which is consistent with - * setup instructions in ext/imap/tests/README + * setup instructions in ext/imap/tests/README.md * * @param array resp element from the return value of imap_fetch_overview() */ diff --git a/ext/ldap/tests/README b/ext/ldap/tests/README.md index 8dfa12d2f9..ef96f7b3c1 100644 --- a/ext/ldap/tests/README +++ b/ext/ldap/tests/README.md @@ -1,19 +1,19 @@ +# The ldap extension tests + To ease testing LDAP-Setups we've created a vagrant-setup. -Prerequisits: -============= +## Prerequisites -You will need vagrant on your box. Get it from https://www.vagrantup.com +You will need [vagrant](https://www.vagrantup.com) on your box. -Usage: -====== +## Usage To use it follow these steps: -* Create a Vagrant-file with the following content. +* Create a `Vagrantfile` with the following content. * Go to that directory and run "vagrant up" -``` +```Vagrantfile $setup = <<<SETUP apt-get update @@ -50,42 +50,55 @@ Vagrant.configure(2) do |config| end ``` -Now you will have a virtual machine up and running on IP-Address 192.168.10.33 listening on port 369 for incomming LDAP-connections. The machine is already configured to execute the LDAP-Tests +Now you will have a virtual machine up and running on IP-Address `192.168.10.33` +listening on port 369 for incomming LDAP-connections. The machine is already +configured to execute the LDAP-Tests. -The next step is to go into the PHP-Source-directory. Configure and make the source as appropriate. +The next step is to go into the PHP-Source-directory. Configure and make the +source as appropriate. Before running the LDAP-Tests you need to set some environment-variables: +```bash export LDAP_TEST_PASSWD="password" export LDAP_TEST_BASE="ou=extldap,dc=nodomain" export LDAP_TEST_USER="dc=admin,dc=nodomain" export LDAP_TEST_HOST=192.168.33.10 +``` -Now you can run the test-suite by calling "make test". To test only the LDAP-Tests, run "make test TESTS=ext/ldap" +Now you can run the test-suite by calling `make test`. To test only the +LDAP-Tests, run `make test TESTS=ext/ldap`. CAVEAT: The current setup does not (yet) test secure connections. +## Old README -======== -OLD README +Most tests here rely on the availability of an LDAP server configured with TLS. -Most tests here relies on the availability of an LDAP server configured with TLS. +### Client/Server configuration -Client/Server configuration: -=========================================================== OpenLDAP 2.4.31 has been used with the configuration below. Notes: -1. A self signed certificate can be generated using: - $ openssl req -newkey rsa:1024 -x509 -nodes -out server.pem -keyout server.pem -days 3650 - It is used for testing ldap_start_tls(), which also requires "TLS_REQCERT never" in client configuration -2. An empty LDAP structure is required for the tests to be PASSed (except for base and admin) -If you use a debian based distribution, prefer the use of dpkg-reconfigure. +1. A self signed certificate can be generated using: + + ```bash + openssl req -newkey rsa:1024 -x509 -nodes -out server.pem -keyout server.pem -days 3650 + ``` + + It is used for testing ldap_start_tls(), which also requires + `TLS_REQCERT never` in client configuration. + +2. An empty LDAP structure is required for the tests to be PASSed (except for + base and admin) + +If you use a debian based distribution, prefer the use of `dpkg-reconfigure`. Otherwise you may alter these configuration files: - (/etc/openldap/)slapd.conf: ------------------------------------------------------------ +#### (/etc/openldap/)slapd.conf + +```txt TLSCACertificateFile /etc/openldap/ssl/server.pem TLSCertificateFile /etc/openldap/ssl/server.pem TLSCertificateKeyFile /etc/openldap/ssl/server.pem @@ -101,17 +114,21 @@ directory /var/lib/openldap-data index objectClass eq authz-regexp - uid=Manager,cn=digest-md5,cn=auth - cn=Manager,dc=my-domain,dc=com + uid=Manager,cn=digest-md5,cn=auth + cn=Manager,dc=my-domain,dc=com +``` +#### (/etc/openldap/)ldap.conf -(/etc/openldap/)ldap.conf: ------------------------------------------------------------ +```txt TLS_REQCERT never +``` + +#### Tests configuration -Tests configuration: -=========================================================== The following environment variables may be defined: + +```txt LDAP_TEST_HOST (default: localhost) Host to connect to LDAP_TEST_PORT (default: 389) Port to connect to LDAP_TEST_BASE (default: dc=my-domain,dc=com) Base to use. May be the ldap root or a subtree. (ldap_search_variation6 will fail if a subtree is used) @@ -120,9 +137,10 @@ LDAP_TEST_SASL_USER (default: Manager) SASL user used for SA LDAP_TEST_PASSWD (default: secret) Password used for plain and SASL binding LDAP_TEST_OPT_PROTOCOL_VERSION (default: 3) Version of LDAP protocol to use LDAP_TEST_SKIP_BIND_FAILURE (default: true) Whether to fail the test or not in case binding fails +``` + +## Credits -Credits: -=========================================================== -Davide Mendolia <idaf1er@gmail.com> -Patrick Allaert <patrick.allaert@gmail.com> -Côme Bernigaud <mcmic@php.net> +* Davide Mendolia (idaf1er@gmail.com) +* Patrick Allaert (patrick.allaert@gmail.com) +* Côme Bernigaud (mcmic@php.net) diff --git a/ext/pdo_mysql/tests/README b/ext/pdo_mysql/tests/README deleted file mode 100644 index 920f5ef474..0000000000 --- a/ext/pdo_mysql/tests/README +++ /dev/null @@ -1,16 +0,0 @@ -You must set the following environment variables to run the tests: - - PDO_MYSQL_TEST_DSN - DSN - For example: mysql:dbname=test;host=localhost;port=3306 - - PDO_MYSQL_TEST_HOST - database host - PDO_MYSQL_TEST_DB - database (schema) name - PDO_MYSQL_TEST_SOCKET - database server socket - PDO_MYSQL_TEST_ENGINE - storage engine to use - PDO_MYSQL_TEST_USER - database user - PDO_MYSQL_TEST_PASS - database user password - PDO_MYSQL_TEST_CHARSET - database charset - - NOTE: if any of PDO_MYSQL_TEST_[HOST|DB|SOCKET|ENGINE|CHARSET] is - part of PDO_MYSQL_TEST_DSN, the values must match. That is, for example, - for PDO_MYSQL_TEST_DSN = mysql:dbname=test you MUST set PDO_MYSQL_TEST_DB=test. diff --git a/ext/pdo_mysql/tests/README.md b/ext/pdo_mysql/tests/README.md new file mode 100644 index 0000000000..afdac4189a --- /dev/null +++ b/ext/pdo_mysql/tests/README.md @@ -0,0 +1,33 @@ +# The pdo_mysql extension tests + +You must set the following environment variables to run the tests: + +```bash +# DSN; For example: mysql:dbname=test;host=localhost;port=3306 +PDO_MYSQL_TEST_DSN + +# Database host +PDO_MYSQL_TEST_HOST + +# Database (schema) name +PDO_MYSQL_TEST_DB + +# Database server socket +PDO_MYSQL_TEST_SOCKET + +# Storage engine to use +PDO_MYSQL_TEST_ENGINE + +# Database user +PDO_MYSQL_TEST_USER + +# Database user password +PDO_MYSQL_TEST_PASS + +# Database charset +PDO_MYSQL_TEST_CHARSET +``` + +NOTE: if any of `PDO_MYSQL_TEST_[HOST|DB|SOCKET|ENGINE|CHARSET]` is part of +`PDO_MYSQL_TEST_DSN`, the values must match. That is, for example, for +`PDO_MYSQL_TEST_DSN = mysql:dbname=test` you MUST set `PDO_MYSQL_TEST_DB=test`. diff --git a/ext/pgsql/tests/README b/ext/pgsql/tests/README deleted file mode 100644 index 5321d1f48d..0000000000 --- a/ext/pgsql/tests/README +++ /dev/null @@ -1,16 +0,0 @@ -Test scripts assumes: - - PostgreSQL server is installed locally - - there is a PostgreSQL account for the users running the test scripts - - there is database named "test" - -For instance, if your login name is 'testuser', you should have PostgreSQL -user account named 'testuser' and grant that user access to the database -'test'. - -If you have account and database, type "createdb test" from command prompt -to create the database to execute the test scripts. By executing the above -command as the same user running the tests you ensure that the user is -granted access to the database. - -If you find problems in PostgreSQL module, please mail to -intenals@lists.php.net, helly@php.net or yohgaki@php.net. diff --git a/ext/pgsql/tests/README.md b/ext/pgsql/tests/README.md new file mode 100644 index 0000000000..ecc2919eb8 --- /dev/null +++ b/ext/pgsql/tests/README.md @@ -0,0 +1,18 @@ +# The pgsql extension tests + +Test scripts assumes: + +* PostgreSQL server is installed locally +* There is a PostgreSQL account for the users running the test scripts +* There is database named `test` + +For instance, if your login name is `testuser`, you should have PostgreSQL user +account named `testuser` and grant that user access to the database `test`. + +If you have account and database, type `createdb test` from command prompt to +create the database to execute the test scripts. By executing the above command +as the same user running the tests you ensure that the user is granted access to +the database. + +If you find problems in PostgreSQL extension, please report a +[bug](https://bugs.php.net). diff --git a/ext/snmp/tests/README b/ext/snmp/tests/README deleted file mode 100644 index 3bfda2569c..0000000000 --- a/ext/snmp/tests/README +++ /dev/null @@ -1,48 +0,0 @@ -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] diff --git a/ext/snmp/tests/README.md b/ext/snmp/tests/README.md new file mode 100644 index 0000000000..ce6bf2d4dc --- /dev/null +++ b/ext/snmp/tests/README.md @@ -0,0 +1,52 @@ +# 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): + +```txt +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): + +```bash +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: + + ```bash + sudo snmpd -C -c ./snmpd.conf -f -Le + ``` |
