diff --git a/tests/p_mysql/0-install_mysqld.sh b/tests/p_mysql/0-install_mysqld.sh index 46b96f1..f055837 100755 --- a/tests/p_mysql/0-install_mysqld.sh +++ b/tests/p_mysql/0-install_mysqld.sh @@ -4,19 +4,20 @@ t_Log "Running $0 - installing and starting mysql server." -if [ $centos_ver -gt 6 ] -then - t_Log 'mysql is only supported on C5 and C6, skipping' - t_CheckExitStatus 0 - exit 0 -fi - # MySQL # starting with 5.10, we have to add mysql55 -if [ $centos_ver = 5 ] -then - t_InstallPackage mysql55-mysql-server mysql-server nc + +if [ "$centos_ver" = "7" ] ; then + my_packages="mariadb mariadb-server nc" + mysql_service="mariadb" +elif [ "$centos_ver" = "5" ] ;then + my_packages="mysql mysql-server nc mysql55-mysql-server" + mysql_service="mysqld" else - t_InstallPackage mysql-server nc + my_packages="mysql mysql-server nc" + mysql_service="mysqld" fi -t_ServiceControl mysqld start >/dev/null 2>&1 + +t_InstallPackage ${my_packages} + +t_ServiceControl ${mysql_service} start >/dev/null 2>&1 diff --git a/tests/p_mysql/10_mysqld_conn_test.sh b/tests/p_mysql/10_mysqld_conn_test.sh index 9a9eaf8..edf5d73 100755 --- a/tests/p_mysql/10_mysqld_conn_test.sh +++ b/tests/p_mysql/10_mysqld_conn_test.sh @@ -2,12 +2,6 @@ t_Log "Running $0 - mysqld client can talk to mysql server." -if [ $centos_ver -gt 6 ] -then - t_Log 'mysql is only supported on C5 and C6, skipping' - t_CheckExitStatus 0 - exit 0 -fi HostName=$(hostname -s) MySqlHostName=$(mysql -N -B -u root -e "show variables like 'hostname'" | cut -f 2 | cut -d . -f 1) @@ -25,7 +19,7 @@ t_Log "Running $0 - mysqld listening test." grep 'skip-networking' /etc/my.cnf > /dev/null if [ $? -eq 1 ]; then # FIXME: Test is very basic - nc -d -w 1 localhost 3306 >/dev/null 2>&1 + >/dev/null 2>&1 >/dev/tcp/localhost/3306 t_CheckExitStatus $? else t_Log "Skipped, looks like networking is disabled for mysql"