config root man

Current Path : /usr/opt/mysql57/mysql-test/t/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/opt/mysql57/mysql-test/t/m_i_db.test

# Purpose : To check cases related to mysql_install_db for WL#7688
# Author  : Prabeen Pradhan
# Date    : 11th Jun 2014
#############################################################

# This test takes around 300 seconds. So let us run it only in --big-test mode
--source include/big_test.inc
--source include/not_embedded.inc
--source include/not_windows.inc
--source include/have_no_undo_tablespaces.inc

--echo # Basic cases related to mysql_install_db
let BASEDIR= `select @@basedir`;
let DDIR=$MYSQL_TMP_DIR/installdb_test;
let adminuser=root;
let adminhost=localhost;
let rndpwdfile=$MYSQL_TMP_DIR/.mysql_secret;
let sslstate=;
--mkdir $DDIR

--exec echo $MYSQL_TMP_DIR/.mysql_secret > $MYSQL_TMP_DIR/readpwdfilepath.txt
--echo # Execute m_i_db without any options where the file MYSQL_TMP_DIR/.mysql_secret is not there. Start server and try to login with root credentials.
let midparam="--random-password-file=$rndpwdfile";
--perl
$filename=$ENV{"MYSQL_TMP_DIR"}."/.mysql_secret";
unlink $filename;
EOF
--source include/m_i_db_startsvr.inc
--source include/m_i_db_common.inc
disconnect conn_root;
connect (conn_root,localhost,$adminuser,,);
select count(*) from mysql.user;
--echo # Execute m_i_db without any options where MYSQL_TMP_DIR/.mysql_secret is there. Start server and try to login with root credentials.
let midparam="--random-password-file=$rndpwdfile";
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--source include/m_i_db_common.inc
--echo # with --insecure where the file MYSQL_TMP_DIR/.mysql_secret is not there. Start server and try to login with root credentials
let midparam=--insecure;
--perl
$filename=$ENV{"MYSQL_TMP_DIR"}."/.mysql_secret";
unlink $filename;
EOF
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--source include/m_i_db_common.inc
--echo # Check the behavior of the option --admin-user
let adminuser=test_user;
let midparam=--admin-user=$adminuser --insecure;
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--source include/m_i_db_common.inc

let midparam=--admin-user=$adminuser --random-password-file=$rndpwdfile;
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--source include/m_i_db_common.inc
--perl
$filename=$ENV{"MYSQL_TMP_DIR"}."/.mysql_secret";
unlink $filename;
EOF
--echo # Check the behavior of the option --login-path when passed with --login-file
let adminuser=test_user2;
let MYSQL_TEST_LOGIN_FILE=$MYSQL_TMP_DIR/m_i_db1.cnf;
--exec $MYSQL_CONFIG_EDITOR set --login-path=credential1 --user=$adminuser --host=localhost
--exec $MYSQL_CONFIG_EDITOR set --login-path=credential2 --user=test_user3 --host=127.0.0.1

let midparam=--admin-user=test_user1 --login-file=$MYSQL_TMP_DIR/m_i_db1.cnf --login-path=credential1 --insecure;
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--source include/m_i_db_common.inc

--echo # Check the behavior when login-path is not passed, but only --login-file
let adminuser=test_user2;
let MYSQL_TEST_LOGIN_FILE=$MYSQL_TMP_DIR/m_i_db2.cnf;
--exec $MYSQL_CONFIG_EDITOR set --login-path=client --user=$adminuser --host=localhost
--exec $MYSQL_CONFIG_EDITOR set --login-path=credential2 --user=test_user3 --host=127.0.0.1

let midparam=--admin-user=test_user1 --login-file=$MYSQL_TMP_DIR/m_i_db2.cnf --insecure;
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--source include/m_i_db_common.inc

--echo # Check the behavior of the option --admin-user
--perl
$filename=$ENV{"MYSQL_TMP_DIR"}."/.mysql_secret";
unlink $filename;
EOF
let adminuser=test_user;
let midparam=--admin-user=$adminuser --insecure;
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--source include/m_i_db_common.inc
--echo # Now without the option --insecure
let midparam=--admin-user=$adminuser --random-password-file=$rndpwdfile;
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--source include/m_i_db_common.inc
--perl
$filename=$ENV{"MYSQL_TMP_DIR"}."/.mysql_secret";
unlink $filename;
EOF
--echo # Check the behavior of the option --admin-host
let adminuser=root;
let adminhost=127.0.0.1;
let sslstate=;
let midparam=--admin-host=$adminhost --random-password-file=$rndpwdfile;
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--source include/m_i_db_common.inc

--perl
$filename=$ENV{"MYSQL_TMP_DIR"}."/.mysql_secret";
unlink $filename;
EOF
let midparam=--admin-host=$adminhost --insecure;
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--source include/m_i_db_common.inc

--echo # Check the behavior of the option --admin-host when passed along with --admin-path
let adminuser=root;
let adminhost=localhost;
let MYSQL_TEST_LOGIN_FILE=$MYSQL_TMP_DIR/m_i_db3.cnf;
--exec $MYSQL_CONFIG_EDITOR set --login-path=credential1 --host=$adminhost
let midparam=--admin-host=invalidhost --login-file=$MYSQL_TMP_DIR/m_i_db3.cnf --login-path=credential1 --insecure;
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--source include/m_i_db_common.inc

--echo # Check the behavior of the option --admin-require-ssl when no value is passed with the option
let adminuser=root;
let adminhost=localhost;
let sslstate=SSL;
let midparam=--admin-require-ssl --random-password-file=$rndpwdfile;
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--disable_query_log
--error 1045
connect (conn_root,$adminhost,$adminuser,$passwd,,,,);
--enable_query_log
--source include/m_i_db_common.inc

--perl
$filename=$ENV{"MYSQL_TMP_DIR"}."/.mysql_secret";
unlink $filename;
EOF
let midparam=--admin-require-ssl --insecure;
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--disable_query_log
--error 1045
connect (conn_root,$adminhost,$adminuser,$passwd,,,,);
--enable_query_log
--source include/m_i_db_common.inc
--echo # Check the behavior of the option --admin-require-ssl when ON is passed with the option
let adminuser=root;
let adminhost=localhost;
let sslstate=SSL;
let midparam=--admin-require-ssl=ON --random-password-file=$rndpwdfile;
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--disable_query_log
--error 1045
connect (conn_root,$adminhost,$adminuser,$passwd,,,,);
--enable_query_log
--source include/m_i_db_common.inc

--perl
$filename=$ENV{"MYSQL_TMP_DIR"}."/.mysql_secret";
unlink $filename;
EOF
let midparam=--admin-require-ssl --insecure;
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--disable_query_log
--error 1045
connect (conn_root,$adminhost,$adminuser,$passwd,,,,);
--enable_query_log
--source include/m_i_db_common.inc

--echo # Check the behavior of the option --admin-require-ssl when OFF is passed with the option
let adminuser=root;
let adminhost=localhost;
let sslstate=;
let midparam=--admin-require-ssl=OFF --random-password-file=$rndpwdfile;

--source include/m_i_db_startsvr.inc
disconnect conn_root;
--source include/m_i_db_common.inc

--perl
$filename=$ENV{"MYSQL_TMP_DIR"}."/.mysql_secret";
unlink $filename;
EOF
let midparam=--admin-require-ssl=OFF --insecure;
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--source include/m_i_db_common.inc

--echo # Check the behavior of the option --admin-require-ssl when invalid value is passed with the option
let adminuser=root;
let adminhost=localhost;
let sslstate=;
let midparam=--admin-require-ssl=ABC --random-password-file=$rndpwdfile;

--source include/m_i_db_startsvr.inc
disconnect conn_root;
--source include/m_i_db_common.inc

--perl
$filename=$ENV{"MYSQL_TMP_DIR"}."/.mysql_secret";
unlink $filename;
EOF
let midparam=--admin-require-ssl=ABC --insecure;
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--source include/m_i_db_common.inc
--echo # Invoke mysql_install_db with --random-password-file=<valid path of file> where the file at specified path does not exist 
--exec echo $MYSQL_TMP_DIR/secretfile.txt > $MYSQL_TMP_DIR/readpwdfilepath.txt
let midparam=--random-password-file=$MYSQL_TMP_DIR/secretfile.txt;
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--source include/m_i_db_common.inc

--echo # Below case is, when --random-password-file already exists
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--source include/m_i_db_common.inc

--perl
$filename1=$ENV{"$MYSQL_TMP_DIR"}."/secretfile.txt";
$filename2=$ENV{"$MYSQL_TMP_DIR"}."/.mysql_secret";
unlink $filename1;
unlink $filename2;
EOF
--exec echo $MYSQL_TMP_DIR/.mysql_secret > $MYSQL_TMP_DIR/readpwdfilepath.txt
let midparam=--random-password-file=$MYSQL_TMP_DIR/secretfile.txt --insecure;
--source include/m_i_db_startsvr.inc
disconnect conn_root;
--source include/m_i_db_common.inc

--echo # Reset mtr state 
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server 
--source include/wait_until_disconnected.inc
--perl
use File::Path 'rmtree';
$DDIR=$ENV{"MYSQL_TMP_DIR"}."/installdb_test";
rmtree([ "$DDIR" ]);
$filename1=$ENV{"MYSQL_TMP_DIR"}."/.mysql_secret";
$filename2=$ENV{"MYSQL_TMP_DIR"}."/readpwd.inc";
$filename3=$ENV{"MYSQL_TMP_DIR"}."/readpwdfilepath.txt";
$filename4=$ENV{"MYSQL_TMP_DIR"}."/secretfile.txt";
$filename5=$ENV{"MYSQL_TMP_DIR"}."/m_i_db1.cnf";
$filename6=$ENV{"MYSQL_TMP_DIR"}."/m_i_db2.cnf";
$filename7=$ENV{"MYSQL_TMP_DIR"}."/m_i_db3.cnf";
unlink $filename1;
unlink $filename2;
unlink $filename3;
unlink $filename4;
unlink $filename5;
unlink $filename6;
unlink $filename7;
EOF
--exec echo "restart:" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc
disconnect conn_root;
connect (conn_root,localhost,root,,);
--echo "execution finished............

Man Man