#!/bin/bash # Author: Karanbir Singh # Athmane Madjoudj # Christoph Galuschka t_Log "Running $0 - install a minimal lamp stack, and test it" # MySQL # starting with 5.10, we have to differ between mysql55 and mysql if [ $centos_ver = 5 ] then t_ServiceControl mysqld stop t_ServiceControl mysql55-mysqld start else exit 0 fi t_ServiceControl httpd restart # Initializing a small MySQL db cat >/tmp/mysql-QA.sql </var/www/html/mysql.php < EOF #################################################### # testing #################################################### curl -s http://localhost/mysql.php t_Log "Performing basic LAMP test" content=`echo "select * from qatests.tests where name='mysqltest'"|mysql -B --skip-column-names` # Clean up mysql -u root -e 'drop database qatests;' service httpd stop if [ "$content" = "mysqltest" ] ; then ret_val=0; else ret_val=1; fi t_CheckExitStatus $ret_val