Blame tests/p_mysql/mysqld_conn_test.sh

Karanbir Singh 0b5bb2
#!/bin/sh
Karanbir Singh 0b5bb2
Karanbir Singh 64acec
t_Log "Running $0 - mysqld client can talk to mysql server."
Karanbir Singh 64acec
HostName=$(hostname --fqdn)
Karanbir Singh 64acec
MySqlHostName=$(mysql -N -B -u root -e "show variables like 'hostname'" | cut -f 2)
Karanbir Singh 64acec
if [ $HostName = ${MySqlHostName} ]; then
Karanbir Singh 64acec
	ret_val=0
Karanbir Singh 64acec
else
Karanbir Singh 64acec
	ret_val=1
Karanbir Singh 64acec
fi
Karanbir Singh 64acec
t_CheckExitStatus $ret_val
Karanbir Singh 2dd0be
Karanbir Singh 64acec
t_Log "Running $0 - mysqld listening test."
Karanbir Singh 64acec
grep 'skip-networking' /etc/my.cnf > /dev/null
Karanbir Singh 64acec
if [ ?$ -eq 1 ]; then
Karanbir Singh 64acec
	# FIXME: Test is very basic
Karanbir Singh 64acec
	nc -d -w 1 localhost 3306 >/dev/null 2>&1
Karanbir Singh 64acec
	t_CheckExitStatus $?
Karanbir Singh 64acec
else
Karanbir Singh 64acec
	t_Log "Skipped, looks like networking is disabled for mysql"
Karanbir Singh 64acec
fi