polardbxengine/mysql-test/suite/ndb/t/ndb_startup.test

61 lines
2.1 KiB
Plaintext

--source include/have_ndb.inc
--source include/have_debug.inc
--source include/not_asan.inc
let MYSQLD_DATADIR= `select @@datadir`;
# Setup path to server output log file
let $error_log= $MYSQLTEST_VARDIR/log/my_restart.err;
# Setup MYSQLD_CMD_11 with correct group suffix to first
# mysqld in the cluster
let $MYSQLD_CMD_11 = `select REPLACE("$MYSQLD_CMD",
"defaults-group-suffix=.1",
"defaults-group-suffix=.1.1")`;
let $args= --loose-console > $error_log 2>&1;
# Use innodb-read-only to avoid that innodb starts recovery
# threads etc. since that will only cause mystery crashes
# when the mysqld startup is aborted due to the invalid
# option tests performed below. Would have been nice to
# skip innodb for these test but that is not an option in 5.7
let $args = --innodb-read-only $args;
# Ignore the warning generated by ndbcluster's binlog thread
# when mysqld is restarted
--disable_query_log ONCE
call mtr.add_suppression("mysqld startup An incident event has been written");
--echo # Stop the running server
let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.1.expect;
--exec echo "wait" > $restart_file
--shutdown_server
--source include/wait_until_disconnected.inc
--echo # Start server with provoked error in ndbcluster_init()
--echo # - the mysqld should write an error to the log and shutdown
--error 1
--exec $MYSQLD_CMD_11 --debug="+d,ndbcluster_init_fail1" $args;
--echo # Check the log file for expected error
let SEARCH_PATTERN= ndbcluster_init_abort1;
let SEARCH_FILE= $error_log;
--source include/search_pattern.inc
--remove_file $SEARCH_FILE
--echo # Start server with another provoked error in ndbcluster_init()
--echo # - the mysqld should write an error to the log and shutdown
--error 1
--exec $MYSQLD_CMD_11 --debug="+d,ndbcluster_init_fail2" $args;
--echo # Check the log file for expected error
let SEARCH_PATTERN= ndbcluster_init_abort2;
let SEARCH_FILE= $error_log;
--source include/search_pattern.inc
--remove_file $SEARCH_FILE
--echo # Cleanup
--enable_reconnect
--exec echo "restart" > $restart_file
--source include/wait_until_connected_again.inc