From f52700fc146493fc185848200901b561e266cbda Mon Sep 17 00:00:00 2001 From: Izorkin Date: Thu, 7 May 2020 21:53:10 +0300 Subject: [PATCH] nixos/tests/mysql-replication: fix test script MariaDB 10.4 introduces a number of changes to the authentication process, intended to make things easier and more intuitive. --- nixos/tests/mysql/mysql-replication.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nixos/tests/mysql/mysql-replication.nix b/nixos/tests/mysql/mysql-replication.nix index 81038dccd947..b5e003250193 100644 --- a/nixos/tests/mysql/mysql-replication.nix +++ b/nixos/tests/mysql/mysql-replication.nix @@ -59,7 +59,7 @@ in master.wait_for_open_port(3306) # Wait for testdb to be fully populated (5 rows). master.wait_until_succeeds( - "mysql -u root -D testdb -N -B -e 'select count(id) from tests' | grep -q 5" + "sudo -u mysql mysql -u mysql -D testdb -N -B -e 'select count(id) from tests' | grep -q 5" ) slave1.start() @@ -71,19 +71,21 @@ in # wait for replications to finish slave1.wait_until_succeeds( - "mysql -u root -D testdb -N -B -e 'select count(id) from tests' | grep -q 5" + "sudo -u mysql mysql -u mysql -D testdb -N -B -e 'select count(id) from tests' | grep -q 5" ) slave2.wait_until_succeeds( - "mysql -u root -D testdb -N -B -e 'select count(id) from tests' | grep -q 5" + "sudo -u mysql mysql -u mysql -D testdb -N -B -e 'select count(id) from tests' | grep -q 5" ) slave2.succeed("systemctl stop mysql") - master.succeed("echo 'insert into testdb.tests values (123, 456);' | mysql -u root -N") + master.succeed( + "echo 'insert into testdb.tests values (123, 456);' | sudo -u mysql mysql -u mysql -N" + ) slave2.succeed("systemctl start mysql") slave2.wait_for_unit("mysql") slave2.wait_for_open_port(3306) slave2.wait_until_succeeds( - "echo 'select * from testdb.tests where Id = 123;' | mysql -u root -N | grep 456" + "echo 'select * from testdb.tests where Id = 123;' | sudo -u mysql mysql -u mysql -N | grep 456" ) ''; })