Debian Codegraph @

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

raw
1 # ==== Purpose ====
2 #
3 # This test case was configured to have group_replication_start_on_boot enabled
4 # (default value of the variable) for the first server.
5 #
6 # The server has the plug-in installed, but will fail to startup it because of
7 # missing configurations. The test case will assert that the proper error
8 # messages were logged at server's error log.
9 #
10 # ==== Related Bugs and Worklogs ====
11 #
12 # BUG#23524460 CHANGE GROUP_REPLICATION_START_ON_BOOT OPTION DEFAULT TO ON
13 #
14 --source include/have_group_replication_plugin.inc
15
16 SET SESSION sql_log_bin= 0;
17 CALL mtr.add_suppression("The group_replication_group_name option is mandatory");
18 CALL mtr.add_suppression("Unable to start Group Replication on boot");
19 SET SESSION sql_log_bin= 1;
20
21 --echo
22 --echo ###########################################################
23 --echo # 1. Assert the failed startup messages on server error log
24
25 # File to GREP
26 # We need the log from the initialization phase, we set it to the exact path
27 # in the opt file.
28 --let $assert_file=$MYSQLTEST_VARDIR/log/mysqld.1.err
29 # Each test will log only one warning line
30 --let $assert_count= 1
31
32 --let $assert_select=.* \[ERROR\] \[[^]]*\] \[[^]]*\] Plugin group_replication reported: 'The group_replication_group_name option is mandatory'
33 --let $assert_text= The GR plug-in reported an error on group name option being mandatory
34 --source include/assert_grep.inc
35
36 --let $assert_select=.* \[ERROR\] \[[^]]*\] \[[^]]*\] Plugin group_replication reported: 'Unable to start Group Replication on boot'
37 --let $assert_text= The GR plug-in reported an error stating it was unable to start Group Replication on boot
38 --source include/assert_grep.inc
39
40 --echo
41 --echo ####################################################################
42 --echo # 2. Assert global group_replication_start_on_boot variable behavior
43
44 --let $assert_text= group_replication_start_on_boot is true by default on startup
45 --let $assert_cond= @@GLOBAL.group_replication_start_on_boot = TRUE
46 --source include/assert.inc
47
48 SET @@GLOBAL.group_replication_start_on_boot = FALSE;
49 --let $assert_text= group_replication_start_on_boot can be turned off
50 --let $assert_cond= @@GLOBAL.group_replication_start_on_boot = FALSE
51 --source include/assert.inc
52
53 # Basic check: Test that variable doesn't accept invalid inputs.
54 --error ER_WRONG_VALUE_FOR_VAR
55 SET GLOBAL group_replication_start_on_boot= NULL;
56
57 --error ER_WRONG_VALUE_FOR_VAR
58 SET GLOBAL group_replication_start_on_boot= "a";
59
60 --error ER_WRONG_TYPE_FOR_VAR
61 SET GLOBAL group_replication_start_on_boot= 1.2;
62
63 # Check default value.
64 SET @@GLOBAL.group_replication_start_on_boot = DEFAULT;
65 --let $assert_text= group_replication_start_on_boot is true when default value is set
66 --let $assert_cond= @@GLOBAL.group_replication_start_on_boot = TRUE
67 --source include/assert.inc
68
69 --echo
70 --echo ############
71 --echo # 3. Cleanup
72
73 --source include/gr_clear_configuration.inc