From de978be955cfbba1156a0cdd16cc9c780be7e8d4 Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Wed, 5 Jun 2019 12:57:46 +0300 Subject: [PATCH 1/2] remove '-u root' from create_user*.sh Call of MariaDB client from local machine with sudo with '-u root' parameter does not work with 10.4 --- maxscale-system-test/create_user.sh | 2 +- maxscale-system-test/create_user_galera.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/maxscale-system-test/create_user.sh b/maxscale-system-test/create_user.sh index 1eb0cb8f2..b8b6064b7 100755 --- a/maxscale-system-test/create_user.sh +++ b/maxscale-system-test/create_user.sh @@ -1,6 +1,6 @@ #!/bin/bash -mysql -u root --force $1 <& /dev/null +mysql --force $1 <& /dev/null DROP USER IF EXISTS '$node_user'@'%'; CREATE USER '$node_user'@'%' IDENTIFIED BY '$node_password'; diff --git a/maxscale-system-test/create_user_galera.sh b/maxscale-system-test/create_user_galera.sh index a2c231184..e7eff8738 100755 --- a/maxscale-system-test/create_user_galera.sh +++ b/maxscale-system-test/create_user_galera.sh @@ -4,14 +4,14 @@ for ((i=0;i<100;i++)) do - mysql -ss -u root $1 -e 'show status like "wsrep_ready"' | grep 'ON' && break || sleep 1 + mysql -ss $1 -e 'show status like "wsrep_ready"' | grep 'ON' && break || sleep 1 done # The removal of the anonymous ''@'localhost' user is done in a somewhat crude # way. The proper way would be to do a secure installation or drop the users # with DROP USER statements. -mysql -u root --force < Date: Wed, 5 Jun 2019 13:42:39 +0300 Subject: [PATCH 2/2] run create_user* under sudo --- maxscale-system-test/mariadb_nodes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maxscale-system-test/mariadb_nodes.cpp b/maxscale-system-test/mariadb_nodes.cpp index f4e8baa2c..230bbc833 100644 --- a/maxscale-system-test/mariadb_nodes.cpp +++ b/maxscale-system-test/mariadb_nodes.cpp @@ -354,7 +354,7 @@ void Mariadb_nodes::create_users(int node) // Create users for replication as well as the users that are used by the tests sprintf(str, "%s/create_user.sh", test_dir); copy_to_node(node, str, access_homedir[node]); - ssh_node_f(node, false, + ssh_node_f(node, true, "export node_user=\"%s\"; export node_password=\"%s\"; %s/create_user.sh %s", user_name, password, access_homedir[0], socket_cmd[0]); } @@ -463,7 +463,7 @@ int Galera_nodes::start_galera() sprintf(str, "%s/create_user_galera.sh", test_dir); copy_to_node_legacy(str, "~/", 0); - ssh_node_f(0, false, "export galera_user=\"%s\"; export galera_password=\"%s\"; ./create_user_galera.sh %s", + ssh_node_f(0, true, "export galera_user=\"%s\"; export galera_password=\"%s\"; ./create_user_galera.sh %s", user_name, password, socket_cmd[0]);