Server IP : 185.86.78.101 / Your IP : 216.73.216.124 Web Server : Apache System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/server/mysql/mysql-test/t/ |
Upload File : |
# 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............