File: gr_ssl_mode_basic.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 (102 lines) | stat: -rw-r--r-- 3,831 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#
# Validate that Group Replication ssl mode option values.
#
# Steps:
#   1. Set invalid values to ssl mode, all must fail.
#   2. Set ssl mode using its enum index.
#   3. Set ssl mode valid values.
#   4. Clean up.
#
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc

--let $rpl_connection_name= server2
--source include/rpl_connection.inc
SET @group_replication_ssl_mode_save= @@GLOBAL.group_replication_ssl_mode;
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET @group_replication_ssl_mode_save= @@GLOBAL.group_replication_ssl_mode;


--echo
--echo ############################################################
--echo # 1. Set invalid values to ssl mode, all must fail.
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL group_replication_ssl_mode= -1;

--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL group_replication_ssl_mode= 4;

--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL group_replication_ssl_mode= "foo";

--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL group_replication_ssl_mode= NULL;


--echo
--echo ############################################################
--echo # 2. Set ssl mode using its enum index.
SET GLOBAL group_replication_ssl_mode= 0;
--let $assert_text= group_replication_ssl_mode must be set to DISABLED
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_ssl_mode]" = "DISABLED"
--source include/assert.inc

SET GLOBAL group_replication_ssl_mode= 1;
--let $assert_text= group_replication_ssl_mode must be set to REQUIRED
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_ssl_mode]" = "REQUIRED"
--source include/assert.inc

SET GLOBAL group_replication_ssl_mode= 2;
--let $assert_text= group_replication_ssl_mode must be set to VERIFY_CA
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_ssl_mode]" = "VERIFY_CA"
--source include/assert.inc

SET GLOBAL group_replication_ssl_mode= 3;
--let $assert_text= group_replication_ssl_mode must be set to VERIFY_IDENTITY
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_ssl_mode]" = "VERIFY_IDENTITY"
--source include/assert.inc


--echo
--echo ############################################################
--echo # 3. Set ssl mode valid values.
SET GLOBAL group_replication_ssl_mode= DISABLED;
--let $assert_text= group_replication_ssl_mode must be set to DISABLED
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_ssl_mode]" = "DISABLED"
--source include/assert.inc

SET GLOBAL group_replication_ssl_mode= REQUIRED;
--let $assert_text= group_replication_ssl_mode must be set to REQUIRED
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_ssl_mode]" = "REQUIRED"
--source include/assert.inc

SET GLOBAL group_replication_ssl_mode= VERIFY_CA;
--let $assert_text= group_replication_ssl_mode must be set to VERIFY_CA
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_ssl_mode]" = "VERIFY_CA"
--source include/assert.inc

SET GLOBAL group_replication_ssl_mode= VERIFY_IDENTITY;
--let $assert_text= group_replication_ssl_mode must be set to VERIFY_IDENTITY
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_ssl_mode]" = "VERIFY_IDENTITY"
--source include/assert.inc

SET GLOBAL group_replication_ssl_mode= DEFAULT;
--let $assert_text= group_replication_ssl_mode must be set to DISABLED
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_ssl_mode]" = "DISABLED"
--source include/assert.inc


--echo
--echo ############################################################
--echo # 4. Clean up.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET GLOBAL group_replication_ssl_mode= @group_replication_ssl_mode_save;

--let $rpl_connection_name= server2
--source include/rpl_connection.inc
SET GLOBAL group_replication_ssl_mode= @group_replication_ssl_mode_save;

--source include/group_replication_end.inc