export engine_type=innodb
perl ./mysql-test-run.pl --start-and-exit rpl_alter

# Uncomment one of the following three lines based on the replication mode to test
../bin/mysql --user=root --port=9306 --protocol=tcp -e"set global binlog_format=statement;"
#../bin/mysql --user=root --port=9306 --protocol=tcp -e"set global binlog_format=mixed;"
#../bin/mysql --user=root --port=9306 --protocol=tcp -e"set global binlog_format=row;"

../bin/mysql --user=root --port=9306 --protocol=tcp -e"show variables like '%binlog_format%';"
echo "Verify the correct binlog format is set (Hit any key to continue) "
read zzz
../bin/mysql --user=root --port=9308 --protocol=tcp -e"start slave;"
../bin/mysql --user=root --port=9308 --protocol=tcp -e"show slave status\G"
echo "Verify replication has started (Hit any key to continue - Clients will start) "
read zzz

# Uncomment one of the following three lines based on the replication mode to test
perl ./mysql-test-run.pl --stress --stress-init-file=rpl_SBR_init.txt --stress-test-file=rpl_sys_test.txt --stress-test-duration=30 --stress-threads=5 --user=root --extern --socket=./var/tmp/master.sock
#perl ./mysql-test-run.pl --stress --stress-init-file=rpl_MBR_init.txt --stress-test-file=rpl_sys_test.txt --stress-test-duration=30 --stress-threads=5 --user=root --extern --socket=./var/tmp/master.sock
#perl ./mysql-test-run.pl --stress --stress-init-file=rpl_RBR_init.txt --stress-test-file=rpl_sys_test.txt --stress-test-duration=30 --stress-threads=5 --user=root --extern --socket=./var/tmp/master.sock

ps -ef | grep mysqld
