From 83e565e2445be073f8af1f6c6401266b11f6e018 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sun, 12 May 2019 22:03:10 +0200 Subject: [PATCH] [ci skip] Migrate tests READMEs to Markdown --- ext/imap/tests/README | 40 ------------- ext/imap/tests/README.md | 48 ++++++++++++++++ ext/imap/tests/imap_include.inc | 2 +- ext/ldap/tests/{README => README.md} | 84 +++++++++++++++++----------- ext/pdo_mysql/tests/README | 16 ------ ext/pdo_mysql/tests/README.md | 33 +++++++++++ ext/pgsql/tests/README | 16 ------ ext/pgsql/tests/README.md | 18 ++++++ ext/snmp/tests/README | 48 ---------------- ext/snmp/tests/README.md | 52 +++++++++++++++++ 10 files changed, 203 insertions(+), 154 deletions(-) delete mode 100644 ext/imap/tests/README create mode 100644 ext/imap/tests/README.md rename ext/ldap/tests/{README => README.md} (66%) delete mode 100644 ext/pdo_mysql/tests/README create mode 100644 ext/pdo_mysql/tests/README.md delete mode 100644 ext/pgsql/tests/README create mode 100644 ext/pgsql/tests/README.md delete mode 100644 ext/snmp/tests/README create mode 100644 ext/snmp/tests/README.md 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 similarity index 66% rename from ext/ldap/tests/README rename to 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 = << -Patrick Allaert -Côme Bernigaud +* 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 + ``` -- 2.40.0