From 64acecaa87f577534b89ebd4161027bb6be203a8 Mon Sep 17 00:00:00 2001 From: Karanbir Singh Date: Nov 09 2012 14:27:26 +0000 Subject: try a real client -> server test connection in mysql --- diff --git a/tests/p_mysql/mysqld_conn_test.sh b/tests/p_mysql/mysqld_conn_test.sh index 8a55a37..b89f8bc 100755 --- a/tests/p_mysql/mysqld_conn_test.sh +++ b/tests/p_mysql/mysqld_conn_test.sh @@ -1,14 +1,21 @@ #!/bin/sh -# Author: Athmane Madjoudj -t_Log "Running $0 - mysqld listening test." - -# FIXME: Test is very basic -nc -d -w 1 localhost 3306 >/dev/null 2>&1 +t_Log "Running $0 - mysqld client can talk to mysql server." +HostName=$(hostname --fqdn) +MySqlHostName=$(mysql -N -B -u root -e "show variables like 'hostname'" | cut -f 2) +if [ $HostName = ${MySqlHostName} ]; then + ret_val=0 +else + ret_val=1 +fi +t_CheckExitStatus $ret_val -t_CheckExitStatus $? - -# kb: Can we do something like : -# hn=$(mysql -N -B -u root -e "show variables like 'hostname'" | cut -f 2) -# then compare ${hn} to the real machine hostname ( `fqdn` ? ) to make sure -# they are identical +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 + t_CheckExitStatus $? +else + t_Log "Skipped, looks like networking is disabled for mysql" +fi