mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-01 18:25:59 +00:00
PT-1530 WIP Added encryption plugins to sandbox start
In order to be able to test encryption support in Percona Server and MySQL, we need to enable encription plugins in the sandbox. This commit adds detection of plugin libraries in the MySQL binaries directory and enables it automatically.
This commit is contained in:
@@ -51,32 +51,30 @@ echo -n "Starting MySQL test server on port PORT... "
|
||||
cwd=$PWD
|
||||
cd $BASEDIR
|
||||
|
||||
plugins=""
|
||||
pluginsparam=""
|
||||
plugindirparam=""
|
||||
encryption_plugins=""
|
||||
plugins_dir_cmd=""
|
||||
|
||||
plugins_cmd=""
|
||||
keyring_cmd=""
|
||||
|
||||
echo "basedir $BASEDIR"
|
||||
if [ -e "${BASEDIR}/lib/mysql/plugin/keyring_file.so" ]; then
|
||||
plugins="${BASEDIR}/lib/mysql/plugin/keyring_file.so"
|
||||
plugindirparam="--plugin-dir=${BASEDIR}/lib/mysql/plugin/"
|
||||
encryption_plugins="${BASEDIR}/lib/mysql/plugin/keyring_file.so"
|
||||
fi
|
||||
|
||||
if [ ! -z "$plugins" ]; then
|
||||
pluginsparam="--early-plugin-load"
|
||||
if [ ! -z "$encryption_plugins" ]; then
|
||||
plugins_cmd="--early-plugin-load=${encryption_plugins}"
|
||||
keyring_cmd="--keyring_file_data=/tmp/PORT/data/keyring"
|
||||
plugins_dir_cmd="--plugin-dir=${BASEDIR}/lib/mysql/plugin/"
|
||||
fi
|
||||
|
||||
echo "plugins: $plugins"
|
||||
echo "pluginsparam: $pluginsparam"
|
||||
|
||||
init_file="/tmp/12345/mysql-init"
|
||||
if [ -e $init_file ]; then
|
||||
$BASEDIR/bin/mysqld --defaults-file=/tmp/12345/my.sandbox.cnf -u root --init-file $init_file $pluginsparam &
|
||||
$BASEDIR/bin/mysqld --defaults-file=/tmp/12345/my.sandbox.cnf -u root --init-file $init_file $plugins_cmd $plugins_dir_cmd $keyring_cmd &
|
||||
else
|
||||
$BASEDIR/bin/mysqld --defaults-file=/tmp/12345/my.sandbox.cnf $pluginsparam $plugins $plugindirparam > /dev/null 2>&1 &
|
||||
$BASEDIR/bin/mysqld --defaults-file=/tmp/12345/my.sandbox.cnf --keyring_file_data=/tmp/12345/data/keyring $plugins_cmd $plugins_dir_cmd $keyring_cmd > /dev/null 2>&1 &
|
||||
fi
|
||||
cd $PWD
|
||||
|
||||
|
||||
# Wait for MySQL to actually be up, i.e. to respond to queries.
|
||||
for i in $(_seq 60); do
|
||||
if sandbox_is_alive; then
|
||||
|
Reference in New Issue
Block a user