From 909dfd644e52f849a384168e97554983e58e265d Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Fri, 20 Jun 2025 07:48:55 +0000 Subject: [PATCH] add more groups for group-replication infras --- test/tap/groups/groups.json | 34 +++++++------- .../groups/mysql84-gr-g1/pre-proxysql.bash | 44 +++++++++++++++++++ .../groups/mysql90-gr-g1/pre-proxysql.bash | 44 +++++++++++++++++++ .../groups/mysql91-gr-g1/pre-proxysql.bash | 44 +++++++++++++++++++ .../groups/mysql92-gr-g1/pre-proxysql.bash | 44 +++++++++++++++++++ .../groups/mysql93-gr-g1/pre-proxysql.bash | 44 +++++++++++++++++++ 6 files changed, 237 insertions(+), 17 deletions(-) create mode 100644 test/tap/groups/mysql84-gr-g1/pre-proxysql.bash create mode 100644 test/tap/groups/mysql90-gr-g1/pre-proxysql.bash create mode 100644 test/tap/groups/mysql91-gr-g1/pre-proxysql.bash create mode 100644 test/tap/groups/mysql92-gr-g1/pre-proxysql.bash create mode 100644 test/tap/groups/mysql93-gr-g1/pre-proxysql.bash diff --git a/test/tap/groups/groups.json b/test/tap/groups/groups.json index 8e95df972..de7fe6268 100644 --- a/test/tap/groups/groups.json +++ b/test/tap/groups/groups.json @@ -1,27 +1,27 @@ { - "admin-listen_on_unix-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql90-g1","mysql91-g1","mysql92-g1","mysql93-g1" ], - "admin_show_create_table-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql90-g1","mysql91-g1","mysql92-g1","mysql93-g1" ], - "admin_show_fields_from-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql90-g1","mysql91-g1","mysql92-g1","mysql93-g1" ], - "admin_show_table_status-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql90-g1","mysql91-g1","mysql92-g1","mysql93-g1" ], - "admin_various_commands2-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql90-g1","mysql91-g1","mysql92-g1","mysql93-g1" ], - "admin_various_commands3-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql90-g1","mysql91-g1","mysql92-g1","mysql93-g1" ], - "admin_various_commands-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql90-g1","mysql91-g1","mysql92-g1","mysql93-g1" ], - "basic-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql90-g1","mysql91-g1","mysql92-g1","mysql93-g1" ], - "charset_unsigned_int-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql90-g1","mysql91-g1","mysql92-g1","mysql93-g1" ], + "admin-listen_on_unix-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql84-gr-g1","mysql90-g1","mysql90-gr-g1","mysql91-g1","mysql91-gr-g1","mysql92-g1","mysql92-gr-g1","mysql93-g1","mysql93-gr-g1" ], + "admin_show_create_table-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql84-gr-g1","mysql90-g1","mysql90-gr-g1","mysql91-g1","mysql91-gr-g1","mysql92-g1","mysql92-gr-g1","mysql93-g1","mysql93-gr-g1" ], + "admin_show_fields_from-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql84-gr-g1","mysql90-g1","mysql90-gr-g1","mysql91-g1","mysql91-gr-g1","mysql92-g1","mysql92-gr-g1","mysql93-g1","mysql93-gr-g1" ], + "admin_show_table_status-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql84-gr-g1","mysql90-g1","mysql90-gr-g1","mysql91-g1","mysql91-gr-g1","mysql92-g1","mysql92-gr-g1","mysql93-g1","mysql93-gr-g1" ], + "admin_various_commands2-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql84-gr-g1","mysql90-g1","mysql90-gr-g1","mysql91-g1","mysql91-gr-g1","mysql92-g1","mysql92-gr-g1","mysql93-g1","mysql93-gr-g1" ], + "admin_various_commands3-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql84-gr-g1","mysql90-g1","mysql90-gr-g1","mysql91-g1","mysql91-gr-g1","mysql92-g1","mysql92-gr-g1","mysql93-g1","mysql93-gr-g1" ], + "admin_various_commands-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql84-gr-g1","mysql90-g1","mysql90-gr-g1","mysql91-g1","mysql91-gr-g1","mysql92-g1","mysql92-gr-g1","mysql93-g1","mysql93-gr-g1" ], + "basic-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql84-gr-g1","mysql90-g1","mysql90-gr-g1","mysql91-g1","mysql91-gr-g1","mysql92-g1","mysql92-gr-g1","mysql93-g1","mysql93-gr-g1" ], + "charset_unsigned_int-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql84-gr-g1","mysql90-g1","mysql90-gr-g1","mysql91-g1","mysql91-gr-g1","mysql92-g1","mysql92-gr-g1","mysql93-g1","mysql93-gr-g1" ], "clickhouse_php_conn-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1" ], - "envvars-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql90-g1","mysql91-g1","mysql92-g1","mysql93-g1" ], - "firewall_commands1-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql90-g1","mysql91-g1","mysql92-g1","mysql93-g1" ], - "kill_connection2-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql90-g1","mysql91-g1","mysql92-g1","mysql93-g1" ], - "kill_connection3-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql90-g1","mysql91-g1","mysql92-g1","mysql93-g1" ], - "kill_connection-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql90-g1","mysql91-g1","mysql92-g1","mysql93-g1" ], + "envvars-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql84-gr-g1","mysql90-g1","mysql90-gr-g1","mysql91-g1","mysql91-gr-g1","mysql92-g1","mysql92-gr-g1","mysql93-g1","mysql93-gr-g1" ], + "firewall_commands1-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql84-gr-g1","mysql90-g1","mysql90-gr-g1","mysql91-g1","mysql91-gr-g1","mysql92-g1","mysql92-gr-g1","mysql93-g1","mysql93-gr-g1" ], + "kill_connection2-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql84-gr-g1","mysql90-g1","mysql90-gr-g1","mysql91-g1","mysql91-gr-g1","mysql92-g1","mysql92-gr-g1","mysql93-g1","mysql93-gr-g1" ], + "kill_connection3-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql84-gr-g1","mysql90-g1","mysql90-gr-g1","mysql91-g1","mysql91-gr-g1","mysql92-g1","mysql92-gr-g1","mysql93-g1","mysql93-gr-g1" ], + "kill_connection-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql84-gr-g1","mysql90-g1","mysql90-gr-g1","mysql91-g1","mysql91-gr-g1","mysql92-g1","mysql92-gr-g1","mysql93-g1","mysql93-gr-g1" ], "max_connections_ff-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1" ], "multiple_prepared_statements-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1" ], "mysql-fast_forward-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1" ], "mysql_hostgroup_attributes_config_file-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1" ], "mysql_hostgroup_attributes-servers_defaults-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1" ], - "mysql-init_connect-1-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql90-g1","mysql91-g1","mysql92-g1","mysql93-g1" ], - "mysql-init_connect-2-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql90-g1","mysql91-g1","mysql92-g1","mysql93-g1" ], - "mysql-last_insert_id-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql90-g1","mysql91-g1","mysql92-g1","mysql93-g1" ], + "mysql-init_connect-1-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql84-gr-g1","mysql90-g1","mysql90-gr-g1","mysql91-g1","mysql91-gr-g1","mysql92-g1","mysql92-gr-g1","mysql93-g1","mysql93-gr-g1" ], + "mysql-init_connect-2-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql84-gr-g1","mysql90-g1","mysql90-gr-g1","mysql91-g1","mysql91-gr-g1","mysql92-g1","mysql92-gr-g1","mysql93-g1","mysql93-gr-g1" ], + "mysql-last_insert_id-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1","mysql84-g1","mysql84-gr-g1","mysql90-g1","mysql90-gr-g1","mysql91-g1","mysql91-gr-g1","mysql92-g1","mysql92-gr-g1","mysql93-g1","mysql93-gr-g1" ], "mysql-mirror1-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1" ], "mysql-protocol_compression_level-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1" ], "mysql_query_logging_memory-t" : [ "default-g1","mysql-auto_increment_delay_multiplex=0-g1","mysql-multiplexing=false-g1","mysql-query_digests=0-g1","mysql-query_digests_keep_comment=1-g1" ], diff --git a/test/tap/groups/mysql84-gr-g1/pre-proxysql.bash b/test/tap/groups/mysql84-gr-g1/pre-proxysql.bash new file mode 100644 index 000000000..6be54bd06 --- /dev/null +++ b/test/tap/groups/mysql84-gr-g1/pre-proxysql.bash @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# +# change infra config +# inherits env from tester script +# + +[[ $(mysql --skip-ssl-verify-server-cert -h 2>&1) =~ skip-ssl-verify-server-cert ]] || export SSLOPT=--skip-ssl-verify-server-cert + +INFRA=infra-$(basename "$0" | sed 's/-g[0-9]//' | sed 's/_.*//') + +# load environment for infra +source $JENKINS_SCRIPTS_PATH/${INFRA}/.env + +# Start infra +$JENKINS_SCRIPTS_PATH/${INFRA}/docker-compose-init.bash + +# make infra default +mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='root'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='user'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='testuser'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest1'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest2'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest3'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest4'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='ssluser'; \ +LOAD MYSQL USERS TO RUNTIME; \ +SAVE MYSQL USERS TO DISK; \ +" 2>&1 | grep -vP 'mysql: .?Warning' + +mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " +DELETE FROM mysql_servers WHERE hostgroup_id IN (0,1,2,3); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (0,'mysql1.${INFRA}',3306,1,'mysql1.${INFRA}'); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (1,'mysql1.${INFRA}',3306,1,'mysql1.${INFRA}'); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (1,'mysql2.${INFRA}',3306,1,'mysql2.${INFRA}'); \ +#INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (2,'mysql2.${INFRA}',3306,1,'mysql2.${INFRA}'); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (1,'mysql3.${INFRA}',3306,1,'mysql3.${INFRA}'); \ +#INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (2,'mysql3.${INFRA}',3306,1,'mysql3.${INFRA}'); \ +LOAD MYSQL SERVERS TO RUNTIME; \ +SAVE MYSQL SERVERS TO DISK; \ +" 2>&1 | grep -vP 'mysql: .?Warning' + +# wait for infra to stabilize +sleep 10 diff --git a/test/tap/groups/mysql90-gr-g1/pre-proxysql.bash b/test/tap/groups/mysql90-gr-g1/pre-proxysql.bash new file mode 100644 index 000000000..6be54bd06 --- /dev/null +++ b/test/tap/groups/mysql90-gr-g1/pre-proxysql.bash @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# +# change infra config +# inherits env from tester script +# + +[[ $(mysql --skip-ssl-verify-server-cert -h 2>&1) =~ skip-ssl-verify-server-cert ]] || export SSLOPT=--skip-ssl-verify-server-cert + +INFRA=infra-$(basename "$0" | sed 's/-g[0-9]//' | sed 's/_.*//') + +# load environment for infra +source $JENKINS_SCRIPTS_PATH/${INFRA}/.env + +# Start infra +$JENKINS_SCRIPTS_PATH/${INFRA}/docker-compose-init.bash + +# make infra default +mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='root'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='user'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='testuser'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest1'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest2'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest3'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest4'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='ssluser'; \ +LOAD MYSQL USERS TO RUNTIME; \ +SAVE MYSQL USERS TO DISK; \ +" 2>&1 | grep -vP 'mysql: .?Warning' + +mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " +DELETE FROM mysql_servers WHERE hostgroup_id IN (0,1,2,3); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (0,'mysql1.${INFRA}',3306,1,'mysql1.${INFRA}'); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (1,'mysql1.${INFRA}',3306,1,'mysql1.${INFRA}'); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (1,'mysql2.${INFRA}',3306,1,'mysql2.${INFRA}'); \ +#INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (2,'mysql2.${INFRA}',3306,1,'mysql2.${INFRA}'); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (1,'mysql3.${INFRA}',3306,1,'mysql3.${INFRA}'); \ +#INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (2,'mysql3.${INFRA}',3306,1,'mysql3.${INFRA}'); \ +LOAD MYSQL SERVERS TO RUNTIME; \ +SAVE MYSQL SERVERS TO DISK; \ +" 2>&1 | grep -vP 'mysql: .?Warning' + +# wait for infra to stabilize +sleep 10 diff --git a/test/tap/groups/mysql91-gr-g1/pre-proxysql.bash b/test/tap/groups/mysql91-gr-g1/pre-proxysql.bash new file mode 100644 index 000000000..6be54bd06 --- /dev/null +++ b/test/tap/groups/mysql91-gr-g1/pre-proxysql.bash @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# +# change infra config +# inherits env from tester script +# + +[[ $(mysql --skip-ssl-verify-server-cert -h 2>&1) =~ skip-ssl-verify-server-cert ]] || export SSLOPT=--skip-ssl-verify-server-cert + +INFRA=infra-$(basename "$0" | sed 's/-g[0-9]//' | sed 's/_.*//') + +# load environment for infra +source $JENKINS_SCRIPTS_PATH/${INFRA}/.env + +# Start infra +$JENKINS_SCRIPTS_PATH/${INFRA}/docker-compose-init.bash + +# make infra default +mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='root'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='user'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='testuser'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest1'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest2'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest3'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest4'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='ssluser'; \ +LOAD MYSQL USERS TO RUNTIME; \ +SAVE MYSQL USERS TO DISK; \ +" 2>&1 | grep -vP 'mysql: .?Warning' + +mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " +DELETE FROM mysql_servers WHERE hostgroup_id IN (0,1,2,3); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (0,'mysql1.${INFRA}',3306,1,'mysql1.${INFRA}'); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (1,'mysql1.${INFRA}',3306,1,'mysql1.${INFRA}'); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (1,'mysql2.${INFRA}',3306,1,'mysql2.${INFRA}'); \ +#INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (2,'mysql2.${INFRA}',3306,1,'mysql2.${INFRA}'); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (1,'mysql3.${INFRA}',3306,1,'mysql3.${INFRA}'); \ +#INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (2,'mysql3.${INFRA}',3306,1,'mysql3.${INFRA}'); \ +LOAD MYSQL SERVERS TO RUNTIME; \ +SAVE MYSQL SERVERS TO DISK; \ +" 2>&1 | grep -vP 'mysql: .?Warning' + +# wait for infra to stabilize +sleep 10 diff --git a/test/tap/groups/mysql92-gr-g1/pre-proxysql.bash b/test/tap/groups/mysql92-gr-g1/pre-proxysql.bash new file mode 100644 index 000000000..6be54bd06 --- /dev/null +++ b/test/tap/groups/mysql92-gr-g1/pre-proxysql.bash @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# +# change infra config +# inherits env from tester script +# + +[[ $(mysql --skip-ssl-verify-server-cert -h 2>&1) =~ skip-ssl-verify-server-cert ]] || export SSLOPT=--skip-ssl-verify-server-cert + +INFRA=infra-$(basename "$0" | sed 's/-g[0-9]//' | sed 's/_.*//') + +# load environment for infra +source $JENKINS_SCRIPTS_PATH/${INFRA}/.env + +# Start infra +$JENKINS_SCRIPTS_PATH/${INFRA}/docker-compose-init.bash + +# make infra default +mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='root'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='user'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='testuser'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest1'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest2'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest3'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest4'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='ssluser'; \ +LOAD MYSQL USERS TO RUNTIME; \ +SAVE MYSQL USERS TO DISK; \ +" 2>&1 | grep -vP 'mysql: .?Warning' + +mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " +DELETE FROM mysql_servers WHERE hostgroup_id IN (0,1,2,3); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (0,'mysql1.${INFRA}',3306,1,'mysql1.${INFRA}'); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (1,'mysql1.${INFRA}',3306,1,'mysql1.${INFRA}'); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (1,'mysql2.${INFRA}',3306,1,'mysql2.${INFRA}'); \ +#INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (2,'mysql2.${INFRA}',3306,1,'mysql2.${INFRA}'); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (1,'mysql3.${INFRA}',3306,1,'mysql3.${INFRA}'); \ +#INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (2,'mysql3.${INFRA}',3306,1,'mysql3.${INFRA}'); \ +LOAD MYSQL SERVERS TO RUNTIME; \ +SAVE MYSQL SERVERS TO DISK; \ +" 2>&1 | grep -vP 'mysql: .?Warning' + +# wait for infra to stabilize +sleep 10 diff --git a/test/tap/groups/mysql93-gr-g1/pre-proxysql.bash b/test/tap/groups/mysql93-gr-g1/pre-proxysql.bash new file mode 100644 index 000000000..6be54bd06 --- /dev/null +++ b/test/tap/groups/mysql93-gr-g1/pre-proxysql.bash @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# +# change infra config +# inherits env from tester script +# + +[[ $(mysql --skip-ssl-verify-server-cert -h 2>&1) =~ skip-ssl-verify-server-cert ]] || export SSLOPT=--skip-ssl-verify-server-cert + +INFRA=infra-$(basename "$0" | sed 's/-g[0-9]//' | sed 's/_.*//') + +# load environment for infra +source $JENKINS_SCRIPTS_PATH/${INFRA}/.env + +# Start infra +$JENKINS_SCRIPTS_PATH/${INFRA}/docker-compose-init.bash + +# make infra default +mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='root'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='user'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='testuser'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest1'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest2'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest3'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='sbtest4'; \ +UPDATE mysql_users SET default_hostgroup=${WHG},comment='${INFRA}' WHERE username='ssluser'; \ +LOAD MYSQL USERS TO RUNTIME; \ +SAVE MYSQL USERS TO DISK; \ +" 2>&1 | grep -vP 'mysql: .?Warning' + +mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " +DELETE FROM mysql_servers WHERE hostgroup_id IN (0,1,2,3); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (0,'mysql1.${INFRA}',3306,1,'mysql1.${INFRA}'); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (1,'mysql1.${INFRA}',3306,1,'mysql1.${INFRA}'); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (1,'mysql2.${INFRA}',3306,1,'mysql2.${INFRA}'); \ +#INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (2,'mysql2.${INFRA}',3306,1,'mysql2.${INFRA}'); \ +INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (1,'mysql3.${INFRA}',3306,1,'mysql3.${INFRA}'); \ +#INSERT INTO mysql_servers (hostgroup_id,hostname,port,max_replication_lag,comment) VALUES (2,'mysql3.${INFRA}',3306,1,'mysql3.${INFRA}'); \ +LOAD MYSQL SERVERS TO RUNTIME; \ +SAVE MYSQL SERVERS TO DISK; \ +" 2>&1 | grep -vP 'mysql: .?Warning' + +# wait for infra to stabilize +sleep 10