Blame tests/p_mysql/60_mysqld55_conn_test.sh

Christoph Galuschka 72f89d
#!/bin/sh
Christoph Galuschka 72f89d
Christoph Galuschka 36e953
t_Log "Running $0 - mysqld client can talk to mysql55 server."
Christoph Galuschka 110e92
Christoph Galuschka 36e953
if [ $centos_ver -gt 5 ]
Christoph Galuschka 110e92
then
Christoph Galuschka 36e953
  t_Log 'mysql55 is only avialable on C5, skipping'
Christoph Galuschka 110e92
  t_CheckExitStatus 0       
Christoph Galuschka 110e92
  exit 0
Christoph Galuschka 110e92
fi
Christoph Galuschka 110e92
Christoph Galuschka 72f89d
HostName=$(hostname -s)
Christoph Galuschka 72f89d
MySqlHostName=$(mysql -N -B -u root -e "show variables like 'hostname'" | cut -f 2 | cut -d . -f 1)
Christoph Galuschka 72f89d
if [ $HostName = ${MySqlHostName} ]; then
Christoph Galuschka 72f89d
	ret_val=0
Christoph Galuschka 72f89d
else
Christoph Galuschka 72f89d
	ret_val=1
Christoph Galuschka 72f89d
fi
Christoph Galuschka 72f89d
t_CheckExitStatus $ret_val
Christoph Galuschka 72f89d
Christoph Galuschka 72f89d
t_Log "Running $0 - mysqld listening test."
Christoph Galuschka 72f89d
grep 'skip-networking' /etc/my.cnf > /dev/null
Christoph Galuschka 72f89d
if [ $? -eq 1 ]; then
Christoph Galuschka 72f89d
	# FIXME: Test is very basic
Christoph Galuschka 72f89d
	nc -d -w 1 localhost 3306 >/dev/null 2>&1
Christoph Galuschka 72f89d
	t_CheckExitStatus $?
Christoph Galuschka 72f89d
else
Christoph Galuschka 72f89d
	t_Log "Skipped, looks like networking is disabled for mysql"
Christoph Galuschka 72f89d
fi