File: gr_start_on_boot.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-- 2,882 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
# ==== Purpose ====
#
# This test case was configured to have group_replication_start_on_boot enabled
# (default value of the variable) for the first server.
#
# The server has the plug-in installed, but will fail to startup it because of
# missing configurations. The test case will assert that the proper error
# messages were logged at server's error log.
#
# ==== Related Bugs and Worklogs ====
#
# BUG#23524460 CHANGE GROUP_REPLICATION_START_ON_BOOT OPTION DEFAULT TO ON
#
--source include/have_group_replication_plugin.inc

SET SESSION sql_log_bin= 0;
CALL mtr.add_suppression("The group_replication_group_name option is mandatory");
CALL mtr.add_suppression("Unable to start Group Replication on boot");
SET SESSION sql_log_bin= 1;

--echo
--echo ###########################################################
--echo # 1. Assert the failed startup messages on server error log

# File to GREP
# We need the log from the initialization phase, we set it to the exact path
# in the opt file.
--let $assert_file=$MYSQLTEST_VARDIR/log/mysqld.1.err
# Each test will log only one warning line
--let $assert_count= 1

--let $assert_select=.* \[ERROR\] \[[^]]*\] \[[^]]*\] Plugin group_replication reported: 'The group_replication_group_name option is mandatory'
--let $assert_text= The GR plug-in reported an error on group name option being mandatory
--source include/assert_grep.inc

--let $assert_select=.* \[ERROR\] \[[^]]*\] \[[^]]*\] Plugin group_replication reported: 'Unable to start Group Replication on boot'
--let $assert_text= The GR plug-in reported an error stating it was unable to start Group Replication on boot
--source include/assert_grep.inc

--echo
--echo ####################################################################
--echo # 2. Assert global group_replication_start_on_boot variable behavior

--let $assert_text= group_replication_start_on_boot is true by default on startup
--let $assert_cond= @@GLOBAL.group_replication_start_on_boot = TRUE
--source include/assert.inc

SET @@GLOBAL.group_replication_start_on_boot = FALSE;
--let $assert_text= group_replication_start_on_boot can be turned off
--let $assert_cond= @@GLOBAL.group_replication_start_on_boot = FALSE
--source include/assert.inc

# Basic check: Test that variable doesn't accept invalid inputs.
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL group_replication_start_on_boot= NULL;

--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL group_replication_start_on_boot= "a";

--error ER_WRONG_TYPE_FOR_VAR
SET GLOBAL group_replication_start_on_boot= 1.2;

# Check default value.
SET @@GLOBAL.group_replication_start_on_boot = DEFAULT;
--let $assert_text= group_replication_start_on_boot is true when default value is set
--let $assert_cond= @@GLOBAL.group_replication_start_on_boot = TRUE
--source include/assert.inc

--echo
--echo ############
--echo # 3. Cleanup

--source include/gr_clear_configuration.inc