X-Git-Url: https://git.exim.org/users/heiko/exim.git/blobdiff_plain/ba0e37b13c652435898f9b1050d6fe648875b125..ff0592132f7e1f9b871a1afb4aa23da96dc189f8:/test/scripts/2610-MySQL/2610?ds=sidebyside diff --git a/test/scripts/2610-MySQL/2610 b/test/scripts/2610-MySQL/2610 index b3e36a5a7..e59c80822 100644 --- a/test/scripts/2610-MySQL/2610 +++ b/test/scripts/2610-MySQL/2610 @@ -1,22 +1,22 @@ # mysql lookups +# The mysql-devel (or equivalent) package will be need for Exim to build, and +# the mysql-server (or mariadb-server or equivalent) package for this test to run. # # first, populate a DB to test against sudo rm -fr DIR/mysql perl -system 'mysql_install_db --datadir=DIR/mysql'; +system 'mysql_install_db --no-defaults --datadir=DIR/mysql --user=CALLER'; **** -sudo rm test-stdout +sudo rm test-stdout test-stderr # # start a db server background mysqld_safe --datadir=DIR/mysql --log-error=DIR/mysql/log --port=PORT_N --socket=DIR/mysql/sock --pid-file=DIR/mysql/pidfile **** -sleep 1 -sudo rm test-stderr-server # -# insert some data +# wait for db startup, insert some data perl -system 'mysqladmin --protocol=TCP -P PORT_N -u root create test'; +system 'mysqladmin --protocol=TCP -P PORT_N --connect_timeout=1 --wait=5 -u root create test'; system 'mysql --protocol=TCP -P PORT_N -u root -D test \ -e "CREATE TABLE them ( name text, id text ); \ INSERT INTO them VALUES ( \'Philip Hazel\', \'ph10\' ); \ @@ -26,8 +26,12 @@ system 'mysql --protocol=TCP -P PORT_N -u root -D test \ INSERT INTO them VALUES ( CONCAT(\'before\', CHAR(13), CHAR(10), \'after\'), \'newline\' ); \ INSERT INTO them VALUES ( CONCAT(\'x\', CHAR(9), \'x\'), \'tab\' ); \ INSERT INTO them VALUES ( CONCAT(CHAR(39), \'stquot\'), \'quote1\' ); \ + CREATE USER IF NOT EXISTS \'root\'@\'HOSTIPV4\', \'CALLER\'@\'HOSTIPV4\'; \ + GRANT ALL ON *.* TO \'root\'@\'HOSTIPV4\'; \ + GRANT ALL ON *.* TO \'CALLER\'@\'HOSTIPV4\'; \ "'; **** +sudo rm test-stderr-server # # exim -d-all+lookup -be