config root man

Current Path : /home/usr.opt/mysql57/mysql-test/suite/rpl/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 : //home/usr.opt/mysql57/mysql-test/suite/rpl/t/rpl_perfschema_connect_config.test

# ==== Purpose ====
#
# This test script serves as the functionality testing for the table
# performance_schema.replication_connection_configuration. Test for ddl and dml
# operations is a part of the perfschema suite. The ddl/dml tests are named:
# 1) ddl_replication_connection_configuration.test and
# 2) dml_replication_connection_configuration.test.
#
# This test script does the following:

#  - On master, the table returns an empty set.
#  - We perform all other testing on connection "slave". So, the below points
#    are checked on slave only.
#  - Verify that SELECT works for every field in the table.
#  - The SELECT per field produces an output similar to the corresponding field
#    in SHOW SLAVE STATUS(SSS), if there is one.
#  - If there is no matching field in SSS, we resort to other method of testing
#    those fields.
#
# The follwing scenarios are tested:
#
#  - Test each field on a fresh replication setup.
#  - Change configuration parameters using CHANGE MASTER TO and verify that
#    these changes are seen in SELECTs from PS table.
#  - Verify that, the change in values are correctly shown by the table.
#  - Start server with gtid-mode=on and test the AUTO_POSITION field.
#
#  ==== Related Worklog ====
#
#  WL#3656: PERFORMANCE SCHEMA table for SHOW SLAVE STATUS
#  Bug#18174719: P_S.REPLICATION_CONNECTION_CONFIGURATION'S COL
#                SSL_CRL_PATH THROWS WARNING 1366
#  WL#7817: RPL Monitoring: Move status variables to replication P_S tables
#           for multi-source monitoring

source include/master-slave.inc;
source include/have_ssl_communication.inc;
source include/have_binlog_format_mixed.inc;

call mtr.add_suppression("Master command COM_REGISTER_SLAVE failed.");
# This warning supression is added here to  avoid the test failing
# due to Bug#16580366. The warning supression can be removed after
# the bug is fixed.
call mtr.add_suppression(" * does not exist in the InnoDB internal");

let $assert_text= On master, the table should return an empty set.;
let $assert_cond= [select count(*) from performance_schema.replication_connection_configuration] = 0;
source include/assert.inc;

--connection slave

--echo
--echo # Verify that SELECT works for every field and produces an output
--echo # similar to the corresponding field in SHOW SLAVE STATUS(SSS).
--echo

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
let $ps_value= query_get_value(select Host from performance_schema.replication_connection_configuration, Host, 1);
let $assert_text= Value returned by SSS and PS table for Host should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_Port, 1);
let $ps_value= query_get_value(select Port from performance_schema.replication_connection_configuration, Port, 1);
let $assert_text= Value returned by SSS and PS table for Port should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_User, 1);
let $ps_value= query_get_value(select User from performance_schema.replication_connection_configuration, User, 1);
let $assert_text= Value returned by SSS and PS table for User should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_Bind, 1);
let $ps_value= query_get_value(select Network_Interface from performance_schema.replication_connection_configuration, Network_Interface, 1);
let $assert_text= Value returned by SSS and PS table for Network_Interface should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Auto_Position, 1);
let $ps_value= query_get_value(select Auto_Position from performance_schema.replication_connection_configuration, Auto_Position, 1);
let $assert_text= Value returned by SSS and PS table for Auto_Position should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_SSL_Allowed, 1);
let $ps_value= query_get_value(select SSL_Allowed from performance_schema.replication_connection_configuration, SSL_Allowed, 1);
let $assert_text= Value returned by SSS and PS table for SSL_Allowed should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_SSL_CA_File, 1);
let $ps_value= query_get_value(select SSL_CA_File from performance_schema.replication_connection_configuration, SSL_CA_File, 1);
let $assert_text= Value returned by SSS and PS table for SSL_CA_File should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_SSL_CA_Path, 1);
let $ps_value= query_get_value(select SSL_CA_Path from performance_schema.replication_connection_configuration, SSL_CA_Path, 1);
let $assert_text= Value returned by SSS and PS table for SSL_CA_Path should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_SSL_Cert, 1);
let $ps_value= query_get_value(select SSL_Certificate from performance_schema.replication_connection_configuration, SSL_Certificate, 1);
let $assert_text= Value returned by SSS and PS table for SSL_Certificate should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_SSL_Cipher, 1);
let $ps_value= query_get_value(select SSL_Cipher from performance_schema.replication_connection_configuration, SSL_Cipher, 1);
let $assert_text= Value returned by SSS and PS table for SSL_Cipher should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_SSL_Key, 1);
let $ps_value= query_get_value(select SSL_Key from performance_schema.replication_connection_configuration, SSL_Key, 1);
let $assert_text= Value returned by SSS and PS table for SSL_Key should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_SSL_Verify_Server_Cert, 1);
let $ps_value= query_get_value(select SSL_Verify_Server_Certificate from performance_schema.replication_connection_configuration, SSL_Verify_Server_Certificate, 1);
let $assert_text= Value returned by SSS and PS table for SSL_Verify_Server_Certificate should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_SSL_Crl, 1);
let $ps_value= query_get_value(select SSL_Crl_File from performance_schema.replication_connection_configuration, SSL_Crl_File, 1);
let $assert_text= Value returned by SSS and PS table for SSL_Crl_File should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_SSL_Crlpath, 1);
let $ps_value= query_get_value(select SSL_Crl_Path from performance_schema.replication_connection_configuration, SSL_Crl_Path, 1);
let $assert_text= Value returned by SSS and PS table for SSL_Crl_Path should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Connect_Retry, 1);
let $ps_value= query_get_value(select Connection_Retry_Interval from performance_schema.replication_connection_configuration, Connection_Retry_Interval, 1);
let $assert_text= Value returned by SSS and PS table for Connection_Retry_Interval should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_Retry_Count, 1);
let $ps_value= query_get_value(select Connection_Retry_Count from performance_schema.replication_connection_configuration, Connection_Retry_Count, 1);
let $assert_text= Value returned by SSS and PS table for Connection_Retry_Count should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

--echo
--echo # Heartbeat_Interval is part of I_S and P_S. We will compare the
--echo # two to make sure both match.
--echo

let $is_value= query_get_value(select Variable_Value from information_schema.GLOBAL_STATUS where variable_name= 'Slave_heartbeat_period', Variable_Value, 1);
let $ps_value= query_get_value(select Heartbeat_Interval from performance_schema.replication_connection_configuration, Heartbeat_Interval, 1);
let $assert_text= Value returned by IS and PS table for Heartbeat_Interval should be same.;
let $assert_cond= $is_value = $ps_value;
source include/assert.inc;

--echo
--echo # Change configuration parameters and verify that these changes
--echo # are shown correctly by SELECTs from PS table.
--echo

# create a user for replication that requires ssl encryption
--connection master
set @orig_sql_mode= @@sql_mode;
set sql_mode= (select replace(@@sql_mode,'NO_AUTO_CREATE_USER',''));
grant replication slave on *.* to replssl@localhost require ssl;
set sql_mode= @orig_sql_mode;
--source include/sync_slave_sql_with_master.inc

# Setup slave to use SSL for connection to master
--source include/stop_slave.inc
replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR;
replace_column 2 ####;
eval change master to
  master_user= 'replssl',
  master_password= '',
  master_retry_count= 1,
  master_ssl= 1,
  master_ssl_ca= '$MYSQL_TEST_DIR/std_data/cacert.pem',
  master_ssl_cert= '$MYSQL_TEST_DIR/std_data/client-cert.pem',
  master_ssl_key= '$MYSQL_TEST_DIR/std_data/client-key.pem';

--echo
--echo # Checking SSL parameters, they were empty in tests done in the
--echo # previous section.
--echo

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_SSL_Allowed, 1);
let $ps_value= query_get_value(select SSL_Allowed from performance_schema.replication_connection_configuration, SSL_Allowed, 1);
let $assert_text= Value returned by SSS and PS table for SSL_Allowed should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_SSL_CA_File, 1);
let $ps_value= query_get_value(select SSL_CA_File from performance_schema.replication_connection_configuration, SSL_CA_File, 1);
let $assert_text= Value returned by SSS and PS table for SSL_CA_File should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_SSL_CA_Path, 1);
let $ps_value= query_get_value(select SSL_CA_Path from performance_schema.replication_connection_configuration, SSL_CA_Path, 1);
let $assert_text= Value returned by SSS and PS table for SSL_CA_Path should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_SSL_Cert, 1);
let $ps_value= query_get_value(select SSL_Certificate from performance_schema.replication_connection_configuration, SSL_Certificate, 1);
let $assert_text= Value returned by SSS and PS table for SSL_Certificate should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_SSL_Cipher, 1);
let $ps_value= query_get_value(select SSL_Cipher from performance_schema.replication_connection_configuration, SSL_Cipher, 1);
let $assert_text= Value returned by SSS and PS table for SSL_Cipher should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_SSL_Key, 1);
let $ps_value= query_get_value(select SSL_Key from performance_schema.replication_connection_configuration, SSL_Key, 1);
let $assert_text= Value returned by SSS and PS table for SSL_Key should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_SSL_Verify_Server_Cert, 1);
let $ps_value= query_get_value(select SSL_Verify_Server_Certificate from performance_schema.replication_connection_configuration, SSL_Verify_Server_Certificate, 1);
let $assert_text= Value returned by SSS and PS table for SSL_Verify_Server_Certificate should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

# We cannot set master_ssl=1 when both ssl_crl and ssl_crlpath are used in
# CHANGE MASTER. (See bug#18165937)
change master to master_ssl=0;
replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR;
replace_column 2 ####;
eval change master to master_ssl_crl= '$MYSQL_TEST_DIR/std_data/crl-client-revoked.crl', master_ssl_crlpath= '$MYSQL_TEST_DIR/std_data/crldir';

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_SSL_Crl, 1);
let $ps_value= query_get_value(select SSL_Crl_File from performance_schema.replication_connection_configuration, SSL_Crl_File, 1);
let $assert_text= Value returned by SSS and PS table for SSL_Crl_File should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_SSL_Crlpath, 1);
let $ps_value= query_get_value(select SSL_Crl_Path from performance_schema.replication_connection_configuration, SSL_Crl_Path, 1);
let $assert_text= Value returned by SSS and PS table for SSL_Crl_Path should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $sss_value= query_get_value(SHOW SLAVE STATUS, Master_TLS_Version, 1);
let $ps_value= query_get_value(select Tls_Version from performance_schema.replication_connection_configuration, Tls_Version, 1);
let $assert_text= Value returned by SSS and PS table for TLS version should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;
 
--echo
--echo # Test with servers in gtid-mode=on.
--echo

let $rpl_server_number= 1;
let $rpl_start_with_gtids= 1;
source include/rpl_restart_server.inc;

let $rpl_server_number= 2;
let $rpl_start_with_gtids= 1;
source include/rpl_restart_server.inc;

--connection slave

--echo
--echo # 1) Test for Auto_position= 0.
--echo

let $sss_value= query_get_value(SHOW SLAVE STATUS, Auto_Position, 1);
let $ps_value= query_get_value(select Auto_Position from performance_schema.replication_connection_configuration, Auto_Position, 1);
let $assert_text= Value returned by SSS and PS table for Auto_Position should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

replace_column 2 ####;
change master to
 master_user = 'root',
 master_auto_position= 1;

--echo
--echo # 2) Test for Auto_position= 1.
--echo

let $sss_value= query_get_value(SHOW SLAVE STATUS, Auto_Position, 1);
let $ps_value= query_get_value(select Auto_Position from performance_schema.replication_connection_configuration, Auto_Position, 1);
let $assert_text= Value returned by SSS and PS table for Auto_Position should be same.;
let $assert_cond= "$sss_value" = "$ps_value";
source include/assert.inc;

let $rpl_only_running_threads= 1;
source include/rpl_end.inc;

Man Man