Commit c0f04072 authored by Rich Prohaska's avatar Rich Prohaska

#140 setup and run mysql tests on oracle and percona server

parent 97f1989e
...@@ -52,7 +52,7 @@ if [[ $mysqlbuild =~ (.*)-(tokudb\-.*)-(linux)-(x86_64) ]] ; then ...@@ -52,7 +52,7 @@ if [[ $mysqlbuild =~ (.*)-(tokudb\-.*)-(linux)-(x86_64) ]] ; then
system=${BASH_REMATCH[3]} system=${BASH_REMATCH[3]}
arch=${BASH_REMATCH[4]} arch=${BASH_REMATCH[4]}
else else
exit 1 echo $mysqlbuild is not a tokudb build
fi fi
if [ -d $mysql_basedir/lib/mysql ] ; then if [ -d $mysql_basedir/lib/mysql ] ; then
......
...@@ -10,7 +10,8 @@ shutdown=1 ...@@ -10,7 +10,8 @@ shutdown=1
install=1 install=1
startup=1 startup=1
s3bucket=tokutek-mysql-build s3bucket=tokutek-mysql-build
builtins="mysqlbuild shutdown install startup s3bucket" sleeptime=60
builtins="mysqlbuild shutdown install startup s3bucket sleeptime"
mysqld_args="--user=mysql --core-file --core-file-size=unlimited" mysqld_args="--user=mysql --core-file --core-file-size=unlimited"
defaultsfile="" defaultsfile=""
if [ -f /etc/$(whoami).my.cnf ] ; then if [ -f /etc/$(whoami).my.cnf ] ; then
...@@ -50,7 +51,7 @@ if [[ $mysqlbuild =~ (.*)-(tokudb\-.*)-(linux)-(x86_64) ]] ; then ...@@ -50,7 +51,7 @@ if [[ $mysqlbuild =~ (.*)-(tokudb\-.*)-(linux)-(x86_64) ]] ; then
system=${BASH_REMATCH[3]} system=${BASH_REMATCH[3]}
arch=${BASH_REMATCH[4]} arch=${BASH_REMATCH[4]}
else else
exit 1 echo $muysqlbuild is not a tokudb build
fi fi
mysqltarball=$mysqlbuild.tar.gz mysqltarball=$mysqlbuild.tar.gz
...@@ -79,6 +80,12 @@ if [ $? -ne 0 ] ; then ...@@ -79,6 +80,12 @@ if [ $? -ne 0 ] ; then
if [ $? -ne 0 ] ; then exit 1; fi if [ $? -ne 0 ] ; then exit 1; fi
fi fi
# set ldpath
ldpath=""
if [ -d /usr/local/gcc-4.7/lib64 ] ; then
ldpath="export LD_LIBRARY_PATH=/usr/local/gcc-4.7/lib64:\$LD_LIBRARY_PATH;"
fi
# shutdown mysql # shutdown mysql
if [ $shutdown -ne 0 ] ; then if [ $shutdown -ne 0 ] ; then
if [ -x /etc/init.d/mysql ] ; then if [ -x /etc/init.d/mysql ] ; then
...@@ -86,7 +93,7 @@ if [ $shutdown -ne 0 ] ; then ...@@ -86,7 +93,7 @@ if [ $shutdown -ne 0 ] ; then
else else
/usr/local/mysql/bin/mysqladmin shutdown /usr/local/mysql/bin/mysqladmin shutdown
fi fi
sleep 60 sleep $sleeptime
fi fi
pushd /usr/local pushd /usr/local
...@@ -112,6 +119,9 @@ if [ ! -d $mysqlbuild ] || [ $install -ne 0 ] ; then ...@@ -112,6 +119,9 @@ if [ ! -d $mysqlbuild ] || [ $install -ne 0 ] ; then
tar xzf $basedir/$mysqltarball tar xzf $basedir/$mysqltarball
if [ $? -ne 0 ] ; then exit 1; fi if [ $? -ne 0 ] ; then exit 1; fi
ln -s $mysqldir /usr/local/mysql ln -s $mysqldir /usr/local/mysql
if [ $? -ne 0 ] ; then exit 1; fi
ln -s $mysqldir /usr/local/$mysqlbuild
if [ $? -ne 0 ] ; then exit 1; fi
installdb=$mysqlbuild/bin/mysql_install_db installdb=$mysqlbuild/bin/mysql_install_db
if [ ! -f $installdb ] ; then if [ ! -f $installdb ] ; then
...@@ -126,17 +136,19 @@ if [ ! -d $mysqlbuild ] || [ $install -ne 0 ] ; then ...@@ -126,17 +136,19 @@ if [ ! -d $mysqlbuild ] || [ $install -ne 0 ] ; then
ln $mysqlbuild/bin/mysqld-debug $mysqlbuild/bin/mysqld ln $mysqlbuild/bin/mysqld-debug $mysqlbuild/bin/mysqld
fi fi
if [ -z "$defaultsfile" ] ; then if [ -z "$defaultsfile" ] ; then
sudo $installdb --user=mysql --basedir=$PWD/$mysqlbuild --datadir=$PWD/$mysqlbuild/data default_arg=""
else else
sudo $installdb --defaults-file=$defaultsfile --user=mysql --basedir=$PWD/$mysqlbuild --datadir=$PWD/$mysqlbuild/data default_arg="--defaults-file=$defaultsfile"
fi fi
sudo bash -c "$ldpath $installdb $default_arg --user=mysql --basedir=$PWD/$mysqlbuild --datadir=$PWD/$mysqlbuild/data"
if [ $? -ne 0 ] ; then exit 1; fi if [ $? -ne 0 ] ; then exit 1; fi
else else
# create link # create link
ln -s $mysqldir /usr/local/mysql ln -s $mysqldir /usr/local/mysql
if [ $? -ne 0 ] ; then exit 1; fi if [ $? -ne 0 ] ; then exit 1; fi
ln -s $mysqldir /usr/local/$mysqlbuild
if [ $? -ne 0 ] ; then exit 1; fi
fi fi
popd popd
...@@ -151,9 +163,14 @@ if [ $startup -ne 0 ] ; then ...@@ -151,9 +163,14 @@ if [ $startup -ne 0 ] ; then
if [ -x /etc/init.d/mysql ] ; then if [ -x /etc/init.d/mysql ] ; then
sudo setsid /etc/init.d/mysql start sudo setsid /etc/init.d/mysql start
else else
sudo -b /usr/local/mysql/bin/mysqld_safe $mysqld_args >/dev/null 2>&1 & if [ -z "$defaultsfile" ] ; then
default_arg=""
else
default_arg="--defaults-file=$defaultsfile"
fi
sudo -b bash -c "$ldpath /usr/local/mysql/bin/mysqld_safe $default_arg $mysqld_args" >/dev/null 2>&1 &
fi fi
sleep 60 sleep $sleeptime
# add mysql grants # add mysql grants
/usr/local/mysql/bin/mysql -u root -e "grant all on *.* to tokubuild@localhost" /usr/local/mysql/bin/mysql -u root -e "grant all on *.* to tokubuild@localhost"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment