Commit 95003eab authored by Julius Goryavsky's avatar Julius Goryavsky

MDEV-19950: Galera test failure on galera_ssl_upgrade

The test requires adaptation for MariaDB, which is done
in this patch. In addition, this patch includes a fix for
the SST script startup code that adds escaping for special
characters on the command line (in case they are contained
in the arguments to mysqld). The fix does not require
separate tests, as the required tests are already part
of the mtr suite for Galera.
parent 362dcf9e
......@@ -23,7 +23,6 @@ galera_mdl_race : MDEV-21524: galera.galera_mdl_race MTR failed: query 'reap' su
galera_parallel_simple : MDEV-20318 galera.galera_parallel_simple fails
galera_partition : MDEV-21806: galera.galera_partition MTR failed: failed to recover from DONOR state
galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim
galera_ssl_upgrade : MDEV-19950 Galera test failure on galera_ssl_upgrade
galera_sst_mariabackup_encrypt_with_key : MDEV-21484 galera_sst_mariabackup_encrypt_with_key
galera_var_node_address : MDEV-20485 Galera test failure
galera_wan : MDEV-17259 Test failure on galera.galera_wan
......
#
# Extract base_port from galera node.
#
# Convert "... base_port = N; ..." to "N; ..."
--let $s1 = `SELECT SUBSTR(@@wsrep_provider_options, LOCATE('base_port =', @@wsrep_provider_options) + LENGTH('base_port = '))`
# Convert "N; ..." to "N"
--let $_NODE_GALERAPORT = `SELECT SUBSTR('$s1', 1, LOCATE(';', '$s1') - 1)`
......@@ -4,12 +4,17 @@ VARIABLE_VALUE = 'Synced'
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
connection node_1;
connection node_2;
connection node_1;
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
connection node_2;
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
connection node_1;
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
!include ../galera_2nodes.cnf
[mysqld.1]
wsrep_provider_options='base_port=@mysqld.1.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/cakey.pem'
wsrep_provider_options='base_port=@mysqld.1.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem'
[mysqld.2]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/cakey.pem'
wsrep_provider_options='base_port=@mysqld.2.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem'
......@@ -6,15 +6,26 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_ssl_communication.inc
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
# Setup galera ports
--connection node_1
--source suite/galera/include/galera_base_port.inc
--let $NODE_GALERAPORT_1 = $_NODE_GALERAPORT
--connection node_2
--source suite/galera/include/galera_base_port.inc
--let $NODE_GALERAPORT_2 = $_NODE_GALERAPORT
# 2. Restart node #1 with a socket.ssl_ca that includes both the new and the old certificate
--connection node_1
--source include/shutdown_mysqld.inc
--let $start_mysqld_params = --wsrep-cluster-address=gcomm://127.0.0.1:$NODE_GALERAPORT_2 --wsrep_provider_options=base_port=$NODE_GALERAPORT_1;socket.ssl=yes;socket.ssl_ca=$MYSQL_TEST_DIR/std_data/galera-upgrade-ca-cert.pem;socket.ssl_cert=$MYSQL_TEST_DIR/std_data/cacert.pem;socket.ssl_key=$MYSQL_TEST_DIR/std_data/cakey.pem
--let $restart_noprint = 1
--let $start_mysqld_params = --wsrep-cluster-address=gcomm://127.0.0.1:$NODE_GALERAPORT_2 --wsrep_provider_options=base_port=$NODE_GALERAPORT_1;socket.ssl=yes;socket.ssl_ca=$MYSQL_TEST_DIR/std_data/galera-upgrade-ca-cert.pem;socket.ssl_cert=$MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=$MYSQL_TEST_DIR/std_data/galera-key.pem
--source include/start_mysqld.inc
--source include/wait_until_connected_again.inc
......
......@@ -707,8 +707,20 @@ static size_t estimate_cmd_len (bool* extra_args)
char c;
while ((c = *arg++) != 0)
{
/* A whitespace or a single quote requires double quotation marks: */
if (isspace(c) || c == '\'')
/*
Space, single quote, ampersand, and I/O redirection characters
require text to be enclosed in double quotes:
*/
if (isspace(c) || c == '\'' || c == '&' || c == '|' ||
#ifdef __WIN__
c == '>' || c == '<')
#else
/*
The semicolon is used to separate shell commands, so it must be
enclosed in double quotes as well:
*/
c == '>' || c == '<' || c == ';')
#endif
{
quotation= true;
}
......@@ -731,10 +743,19 @@ static size_t estimate_cmd_len (bool* extra_args)
while ((c = *arg++) != 0)
{
/*
A whitespace or a single quote requires double
quotation marks:
Space, single quote, ampersand, and I/O redirection characters
require text to be enclosed in double quotes:
*/
if (isspace(c) || c == '\'' || c == '&' || c == '|' ||
#ifdef __WIN__
c == '>' || c == '<')
#else
/*
The semicolon is used to separate shell commands, so it must be
enclosed in double quotes as well:
*/
if (isspace(c) || c == '\'')
c == '>' || c == '<' || c == ';')
#endif
{
quotation= true;
}
......@@ -815,8 +836,20 @@ static void copy_orig_argv (char* cmd_str)
char c;
while ((c = *arg_scan++) != 0)
{
/* A whitespace or a single quote requires double quotation marks: */
if (isspace(c) || c == '\'')
/*
Space, single quote, ampersand, and I/O redirection characters
require text to be enclosed in double quotes:
*/
if (isspace(c) || c == '\'' || c == '&' || c == '|' ||
#ifdef __WIN__
c == '>' || c == '<')
#else
/*
The semicolon is used to separate shell commands, so it must be
enclosed in double quotes as well:
*/
c == '>' || c == '<' || c == ';')
#endif
{
quotation= true;
}
......@@ -890,10 +923,19 @@ static void copy_orig_argv (char* cmd_str)
while ((c = *arg_scan++) != 0)
{
/*
A whitespace or a single quote requires double
quotation marks:
Space, single quote, ampersand, and I/O redirection characters
require text to be enclosed in double quotes:
*/
if (isspace(c) || c == '\'' || c == '&' || c == '|' ||
#ifdef __WIN__
c == '>' || c == '<')
#else
/*
The semicolon is used to separate shell commands, so it must be
enclosed in double quotes as well:
*/
if (isspace(c) || c == '\'')
c == '>' || c == '<' || c == ';')
#endif
{
quotation= true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment