com php-src: [ci skip] Migrate tests READMEs to Markdown: ext/imap/tests/README ext/imap/tests/README.md ext/imap/tests/i map_include.inc
ext/ldap/tests/README ext/ldap/tests/RE ADME.md ext/pdo_mysql/tests/README ext/pdo_mysql/test s/README.md ext/pgsql/tests/README
ext/pgsql/tests/README .md ext/snmp/tests/README ext/snmp/tests/README.md

From: Date: Sun, 12 May 2019 20:03:10 +0000
Subject: com php-src: [ci skip] Migrate tests READMEs to Markdown: ext/imap/tests/README ext/imap/tests/README.md ext/imap/tests/i map_include.inc
ext/ldap/tests/README ext/ldap/tests/RE ADME.md ext/pdo_mysql/tests/README ext/pdo_mysql/test s/README.md ext/pgsql/tests/README
ext/pgsql/tests/README .md ext/snmp/tests/README ext/snmp/tests/README.md
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-106144@lists.php.net to get a copy of this message
Commit: 83e565e2445be073f8af1f6c6401266b11f6e018 Author: Peter Kokot <peterkokot@gmail.com> Sun, 12 May 2019 22:03:10 +0200 Parents: 340da471670517379cd825d03e5c638e608a57c5 Branches: PHP-7.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=83e565e2445be073f8af1f6c6401266b11f6e018 Log: [ci skip] Migrate tests READMEs to Markdown Changed paths: D ext/imap/tests/README A ext/imap/tests/README.md M ext/imap/tests/imap_include.inc D ext/ldap/tests/README A ext/ldap/tests/README.md D ext/pdo_mysql/tests/README A ext/pdo_mysql/tests/README.md D ext/pgsql/tests/README A ext/pgsql/tests/README.md D ext/snmp/tests/README A ext/snmp/tests/README.md

diff --git a/ext/imap/tests/README b/ext/imap/tests/README deleted file mode 100644 index 99424b3..0000000 --- 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 0000000..381cdc2 --- /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 0425faa..369a560 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 deleted file mode 100644 index 8dfa12d..0000000 --- a/ext/ldap/tests/README +++ /dev/null @@ -1,128 +0,0 @@ -To ease testing LDAP-Setups we've created a vagrant-setup. - -Prerequisits: -============= - -You will need vagrant on your box. Get it from https://www.vagrantup.com - -Usage: -====== - -To use it follow these steps: - -* Create a Vagrant-file with the following content. -* Go to that directory and run "vagrant up" - -``` -$setup = <<<SETUP -apt-get update - -DEBIAN_FRONTEND=noninteractive aptitude install -q -y slapd ldap-utils - -export SLAPPASS=`slappasswd -s password` - -echo "dn: olcDatabase={1}hdb,cn=config -changetype: modify -replace: olcSuffix -olcSuffix: dc=nodomain -- -replace: olcRootDN -olcRootDN: dc=admin,dc=nodomain -- -replace: olcRootPW -olcRootPW: ${SLAPPASS}" | ldapmodify -Y EXTERNAL -H ldapi:/// - -echo "dn: dc=nodomain -objectClass: dcObject -objectClass: organization -o: Example -dc: example - -dn: ou=extldap,dc=nodomain -objectClass: organizationalUnit -ou: extldap" | ldapadd -c -x -H ldap://localhost:389 -D "dc=admin,dc=nodomain" -w password -SETUP - -Vagrant.configure(2) do |config| - config.vm.box = "ubuntu/trusty64" - config.vm.network "private_network", ip: "192.168.33.10" - config.vm.provision "shell", inline: $setup -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 - -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: - -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" - -CAVEAT: The current setup does not (yet) test secure connections. - - -======== -OLD README - -Most tests here relies on the availability of an LDAP server configured with TLS. - -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. -Otherwise you may alter these configuration files: - - (/etc/openldap/)slapd.conf: ------------------------------------------------------------ -TLSCACertificateFile /etc/openldap/ssl/server.pem -TLSCertificateFile /etc/openldap/ssl/server.pem -TLSCertificateKeyFile /etc/openldap/ssl/server.pem -TLSVerifyClient never - -# hdb is used instead of bdb as it enables the usage of referrals & aliases -database hdb -suffix "dc=my-domain,dc=com" -checkpoint 32 30 -rootdn "cn=Manager,dc=my-domain,dc=com" -rootpw secret -directory /var/lib/openldap-data -index objectClass eq - -authz-regexp - uid=Manager,cn=digest-md5,cn=auth - cn=Manager,dc=my-domain,dc=com - - -(/etc/openldap/)ldap.conf: ------------------------------------------------------------ -TLS_REQCERT never - -Tests configuration: -=========================================================== -The following environment variables may be defined: -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) -LDAP_TEST_USER (default: cn=Manager,dc=my-domain,dc=com) DN used for binding -LDAP_TEST_SASL_USER (default: Manager) SASL user used for SASL binding -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: -=========================================================== -Davide Mendolia <idaf1er@gmail.com> -Patrick Allaert <patrick.allaert@gmail.com> -Côme Bernigaud <mcmic@php.net> diff --git a/ext/ldap/tests/README.md b/ext/ldap/tests/README.md new file mode 100644 index 0000000..ef96f7b --- /dev/null +++ b/ext/ldap/tests/README.md @@ -0,0 +1,146 @@ +# The ldap extension tests + +To ease testing LDAP-Setups we've created a vagrant-setup. + +## Prerequisites + +You will need [vagrant](https://www.vagrantup.com) on your box. + +## Usage + +To use it follow these steps: + +* Create a `Vagrantfile` with the following content. +* Go to that directory and run "vagrant up" + +```Vagrantfile +$setup = <<<SETUP +apt-get update + +DEBIAN_FRONTEND=noninteractive aptitude install -q -y slapd ldap-utils + +export SLAPPASS=`slappasswd -s password` + +echo "dn: olcDatabase={1}hdb,cn=config +changetype: modify +replace: olcSuffix +olcSuffix: dc=nodomain +- +replace: olcRootDN +olcRootDN: dc=admin,dc=nodomain +- +replace: olcRootPW +olcRootPW: ${SLAPPASS}" | ldapmodify -Y EXTERNAL -H ldapi:/// + +echo "dn: dc=nodomain +objectClass: dcObject +objectClass: organization +o: Example +dc: example + +dn: ou=extldap,dc=nodomain +objectClass: organizationalUnit +ou: extldap" | ldapadd -c -x -H ldap://localhost:389 -D "dc=admin,dc=nodomain" -w password +SETUP + +Vagrant.configure(2) do |config| + config.vm.box = "ubuntu/trusty64" + config.vm.network "private_network", ip: "192.168.33.10" + config.vm.provision "shell", inline: $setup +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. + +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`. + +CAVEAT: The current setup does not (yet) test secure connections. + +## Old README + +Most tests here rely on the availability of an LDAP server configured with TLS. + +### Client/Server configuration + +OpenLDAP 2.4.31 has been used with the configuration below. + +Notes: + +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 + +```txt +TLSCACertificateFile /etc/openldap/ssl/server.pem +TLSCertificateFile /etc/openldap/ssl/server.pem +TLSCertificateKeyFile /etc/openldap/ssl/server.pem +TLSVerifyClient never + +# hdb is used instead of bdb as it enables the usage of referrals & aliases +database hdb +suffix "dc=my-domain,dc=com" +checkpoint 32 30 +rootdn "cn=Manager,dc=my-domain,dc=com" +rootpw secret +directory /var/lib/openldap-data +index objectClass eq + +authz-regexp + uid=Manager,cn=digest-md5,cn=auth + cn=Manager,dc=my-domain,dc=com +``` + +#### (/etc/openldap/)ldap.conf + +```txt +TLS_REQCERT never +``` + +#### 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) +LDAP_TEST_USER (default: cn=Manager,dc=my-domain,dc=com) DN used for binding +LDAP_TEST_SASL_USER (default: Manager) SASL user used for SASL binding +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 + +* 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 920f5ef..0000000 --- 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 0000000..afdac41 --- /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 5321d1f..0000000 --- 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 0000000..ecc2919 --- /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 3bfda25..0000000 --- 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 0000000..ce6bf2d --- /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 + ```
« previous php.cvs (#106144) next »