File: gr_member_host_port.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (73 lines) | stat: -rw-r--r-- 3,750 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
################################################################################
# Verify performance_schema.replication_group_members.MEMBER_HOST
# and MEMBER_PORT are set correctly
#
# Test:
# 0. The test requires one server.
# 1. Verify that when startup options report-host is not set, its value shown
#    on MEMBER_PORT value is as defined on rpl_1slave_base.cnf
# 2.  Verify that when startup options report-port is not set, the MEMBER_PORT
#     set equal to system variable port.
# 3. Verify that when startup options report-host and report-port are set,
#    performance_schema.replication_group_members.MEMBER_HOST and MEMBER_PORT
#    set equal to report-host and report-port.
# 4. Clean up.
################################################################################
--let $group_replication_group_name= `SELECT UUID()`
--source include/have_group_replication_plugin.inc
--source include/force_restart.inc

--connection server1
--source include/start_and_bootstrap_group_replication.inc

--echo #####################################################################
--echo # 1.a Verify that when startup options report-host is not set, its value
--echo # shown on MEMBER_PORT value is as defined on rpl_1slave_base.cnf

--let $assert_text= The performance_schema.replication_group_members.MEMBER_HOST matches with hostname system variable
--let $assert_cond= "[SELECT MEMBER_HOST FROM performance_schema.replication_group_members]" = "127.0.0.1";
--source include/assert.inc

--echo #####################################################################
--echo # 1.b Verify that when startup options report-port is not set,
--echo # the MEMBER_PORT is set equal to system variable port.

--let $assert_text= The performance_schema.replication_group_members.MEMBER_PORT matches with port system variable
--let $assert_cond= "[SELECT MEMBER_PORT FROM performance_schema.replication_group_members]" = "[SELECT @@port]";
--source include/assert.inc

--echo #####################################################################
--echo # 2. Verify that when startup options report-host and report-port are
--echo # set, performance_schema.replication_group_members.MEMBER_HOST and
--echo # MEMBER_PORT are set equal to report-host and report-port.

--let $new_host= server1-test-host
--let $new_port= 1999

# restart server with report-host and report-port parameters
--let $allow_rpl_inited=1
--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
--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
--replace_result $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS
--source include/restart_mysqld.inc

# renable connection
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--enable_reconnect

--source include/start_and_bootstrap_group_replication.inc

--let $assert_text= The performance_schema.replication_group_members.MEMBER_HOST matches with report-host startup option
--let $assert_cond= "[SELECT MEMBER_HOST FROM performance_schema.replication_group_members]" = "$new_host";
--source include/assert.inc

--let $assert_text= The performance_schema.replication_group_members.MEMBER_PORT matches with report-port startup option
--let $assert_cond= "[SELECT MEMBER_PORT FROM performance_schema.replication_group_members]" = "$new_port";
--source include/assert.inc

--source include/stop_group_replication.inc

# clean up
--let $restart_parameters=