From 975f89b6ef4608813624941a7dac411f006c7f4e Mon Sep 17 00:00:00 2001 From: Christoph Galuschka Date: Nov 09 2013 18:23:40 +0000 Subject: php tests now reflect both mysql and mysql55 on C5 --- diff --git a/tests/p_php/20-php-mysql-test.sh b/tests/p_php/20-php-mysql-test.sh index 458cfb7..dbdc180 100755 --- a/tests/p_php/20-php-mysql-test.sh +++ b/tests/p_php/20-php-mysql-test.sh @@ -12,12 +12,11 @@ t_InstallPackage php-mysql #starting with 5.10 we need to reflect mysql55 if [ $centos_ver = 5 ] then - t_InstallPackage mysql55-mysql-server nc - t_ServiceControl mysql55-mysqld start >/dev/null 2>&1 + t_InstallPackage mysql-server mysql55-mysql-server nc else t_InstallPackage mysql-server nc - t_ServiceControl mysqld start >/dev/null 2>&1 fi +t_ServiceControl mysqld start >/dev/null 2>&1 #create a little DB to use CREATE='/var/tmp/mysql-php-QA.sql' @@ -81,3 +80,4 @@ t_CheckExitStatus $? #cleaning up /bin/rm $READ $CREATE $INSERT +mysql -u root -e 'drop database phptests' >/dev/null 2>&1 diff --git a/tests/p_php/25-php-mysql55-test.sh b/tests/p_php/25-php-mysql55-test.sh new file mode 100755 index 0000000..ef847cc --- /dev/null +++ b/tests/p_php/25-php-mysql55-test.sh @@ -0,0 +1,81 @@ +y#!/bin/sh +# Author: Athmane Madjoudj +# Author: Christoph Galuschka +# reusing the script from LAMP-Tests + +t_Log "Running $0 - php-cli basic interaction with mysql test." + +# Install php-mysql-module +t_InstallPackage php-mysql + +# we need a working and running mysql server +#starting with 5.10 we need to reflect mysql55 +if [ $centos_ver = 5 ] +then + t_ServiceControl mysqld stop + t_ServiceControl mysql55-mysqld start >/dev/null 2>&1 +fi + +#create a little DB to use +CREATE='/var/tmp/mysql-php-QA.sql' + +cat >$CREATE <$INSERT < +EOF + +php $INSERT +if [ $? -ne 0 ] + then + t_Log "Inserting into DB failed" + exit 1 +fi + +# create PHP script to read from DB +READ='/var/tmp/read.php' +cat >$READ < +EOF + +# If we execute the script and get '1' it works (1 entry should be in the DB) +php $READ | grep -q '1' + +t_CheckExitStatus $? + +#cleaning up +/bin/rm $READ $CREATE $INSERT +mysql -u root -e 'drop database phptests' >/dev/null 2>&1