Debian Codegraph @

mysql-test/suite/group_replication/t/gr_member_host_port.test

raw
1 ################################################################################
2 # Verify performance_schema.replication_group_members.MEMBER_HOST
3 # and MEMBER_PORT are set correctly
4 #
5 # Test:
6 # 0. The test requires one server.
7 # 1. Verify that when startup options report-host is not set, its value shown
8 # on MEMBER_PORT value is as defined on rpl_1slave_base.cnf
9 # 2. Verify that when startup options report-port is not set, the MEMBER_PORT
10 # set equal to system variable port.
11 # 3. Verify that when startup options report-host and report-port are set,
12 # performance_schema.replication_group_members.MEMBER_HOST and MEMBER_PORT
13 # set equal to report-host and report-port.
14 # 4. Clean up.
15 ################################################################################
16 --let $group_replication_group_name= `SELECT UUID()`
17 --source include/have_group_replication_plugin.inc
18 --source include/force_restart.inc
19
20 --connection server1
21 --source include/start_and_bootstrap_group_replication.inc
22
23 --echo #####################################################################
24 --echo # 1.a Verify that when startup options report-host is not set, its value
25 --echo # shown on MEMBER_PORT value is as defined on rpl_1slave_base.cnf
26
27 --let $assert_text= The performance_schema.replication_group_members.MEMBER_HOST matches with hostname system variable
28 --let $assert_cond= "[SELECT MEMBER_HOST FROM performance_schema.replication_group_members]" = "127.0.0.1";
29 --source include/assert.inc
30
31 --echo #####################################################################
32 --echo # 1.b Verify that when startup options report-port is not set,
33 --echo # the MEMBER_PORT is set equal to system variable port.
34
35 --let $assert_text= The performance_schema.replication_group_members.MEMBER_PORT matches with port system variable
36 --let $assert_cond= "[SELECT MEMBER_PORT FROM performance_schema.replication_group_members]" = "[SELECT @@port]";
37 --source include/assert.inc
38
39 --echo #####################################################################
40 --echo # 2. Verify that when startup options report-host and report-port are
41 --echo # set, performance_schema.replication_group_members.MEMBER_HOST and
42 --echo # MEMBER_PORT are set equal to report-host and report-port.
43
44 --let $new_host= server1-test-host
45 --let $new_port= 1999
46
47 # restart server with report-host and report-port parameters
48 --let $allow_rpl_inited=1
49 --let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
50 --let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
51 --let $restart_parameters=restart:--report-host=$new_host --report-port=$new_port --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds
52 --replace_result $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS
53 --source include/restart_mysqld.inc
54
55 # renable connection
56 --let $rpl_connection_name= server1
57 --source include/rpl_connection.inc
58 --enable_reconnect
59
60 --source include/start_and_bootstrap_group_replication.inc
61
62 --let $assert_text= The performance_schema.replication_group_members.MEMBER_HOST matches with report-host startup option
63 --let $assert_cond= "[SELECT MEMBER_HOST FROM performance_schema.replication_group_members]" = "$new_host";
64 --source include/assert.inc
65
66 --let $assert_text= The performance_schema.replication_group_members.MEMBER_PORT matches with report-port startup option
67 --let $assert_cond= "[SELECT MEMBER_PORT FROM performance_schema.replication_group_members]" = "$new_port";
68 --source include/assert.inc
69
70 --source include/stop_group_replication.inc
71
72 # clean up
73 --let $restart_parameters=