From 39a20f8a0f70668a9ea7770fad89d974e165339a Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 14 Sep 2017 15:49:50 +0200 Subject: fix mysql sandboxing, btw, test suite still broken --- php-pecl-mysql-xdevapi.spec | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/php-pecl-mysql-xdevapi.spec b/php-pecl-mysql-xdevapi.spec index 14c75a6..345108f 100644 --- a/php-pecl-mysql-xdevapi.spec +++ b/php-pecl-mysql-xdevapi.spec @@ -13,7 +13,7 @@ %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name mysql_xdevapi -# https://bugzilla.redhat.com/show_bug.cgi?id=1470164 +# Need work to find how to run upstream test suite %global with_tests 0%{?_with_tests:1} # After 20-json, 20-mysqlnd %global ini_name 40-%{pecl_name}.ini @@ -41,6 +41,7 @@ BuildRequires: boost-devel BuildRequires: openssl-devel %if %{with_tests} BuildRequires: community-mysql-server >= 5.7.12 +BuildRequires: %{?scl_prefix}php-mysqli %endif Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} @@ -224,7 +225,8 @@ rm -rf data mkdir data %{_libexecdir}/mysqld \ --datadir=$PWD/data \ - --initialize + --log-error=$PWD/mysql.log \ + --initialize-insecure %{_libexecdir}/mysqld \ --socket=$MYSQLX_TEST_SOCKET \ @@ -235,7 +237,7 @@ mkdir data n=15 while [ $n -gt 0 ]; do - RESPONSE=$(%{_bindir}/mysqladmin --no-defaults --socket="$MYSQL_TEST_SOCKET" --user=root ping 2>&1 || :) + RESPONSE=$(%{_bindir}/mysqladmin --no-defaults --socket="$MYSQLX_TEST_SOCKET" --user=root ping 2>&1 || :) if [ "$RESPONSE" == "mysqld is alive" ]; then break fi @@ -244,19 +246,20 @@ while [ $n -gt 0 ]; do done : Run upstream test suite -sed -e "s/localhost/$MYSQL_TEST_HOST/;s/3306/$MYSQL_TEST_PORT/" -i tests/connect.inc +export MYSQLX_TEST_HOST +export MYSQLX_TEST_PORT if [ $n -gt 0 ]; then TEST_PHP_EXECUTABLE=%{__php} \ -TEST_PHP_ARGS="-n -d extension=mysqlnd.so -d extension=json.so -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ +TEST_PHP_ARGS="-n -d extension=mysqlnd.so -d extension=json.so -d extension=mysqli.so -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ NO_INTERACTION=1 \ REPORT_EXIT_STATUS=1 \ %{__php} -n run-tests.php --show-diff || RET=1 fi : Cleanup -if [ -s $MYSQL_PID_FILE ]; then - kill $(cat $MYSQL_PID_FILE) +if [ -s $MYSQLX_PID_FILE ]; then + kill $(cat $MYSQLX_PID_FILE) fi exit $RET -- cgit