Blame tests/p_mysql/25_mysqld_grant_test.sh

Steve Barnes 724d58
#!/bin/sh
Steve Barnes 724d58
# Author: Athmane Madjoudj <athmanem@gmail.com>
Steve Barnes 724d58
Steve Barnes 724d58
t_Log "Running $0 - MySQL GRANT privileges test"
Steve Barnes 724d58
Christoph Galuschka 110e92
if [ $centos_ver -gt 6 ]
Christoph Galuschka 110e92
then
Christoph Galuschka 110e92
  t_Log 'mysql is only supported on C5 and C6, skipping'
Christoph Galuschka 110e92
  t_CheckExitStatus 0       
Christoph Galuschka 110e92
  exit 0
Christoph Galuschka 110e92
fi
Christoph Galuschka 110e92
Steve Barnes 724d58
mysql -u root -e 'create database mysql_test;'  > /dev/null 2>&1
Steve Barnes 724d58
mysql -u root -e "grant all on mysql_test.* to mysql_test@localhost identified by 'mysqltest'"  > /dev/null 2>&1
Steve Barnes 724d58
mysql -u root -e "flush privileges;" > /dev/null 2>&1
Steve Barnes 724d58
mysql -u mysql_test -pmysqltest mysql_test -e 'create table test_table(id int);' > /dev/null 2>&1
Athmane Madjoudj 3601dc
ret_val=$?
Steve Barnes 724d58
Athmane Madjoudj 3601dc
# Clean up
Athmane Madjoudj 3601dc
mysql -u root -e 'drop database mysql_test;'  > /dev/null 2>&1
Athmane Madjoudj 3601dc
Athmane Madjoudj 3601dc
t_CheckExitStatus $ret_val