about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorIzorkin <izorkin@elven.pw>2020-05-07 21:53:10 +0300
committerIzorkin <izorkin@elven.pw>2020-05-14 17:29:40 +0300
commitf52700fc146493fc185848200901b561e266cbda (patch)
tree37bf3db7e7fc7a0a9976adead8aaee8de1ad0a82 /nixos/tests
parent90f30032f3a8349fced2b29614562477cc6f33c9 (diff)
downloadnixlib-f52700fc146493fc185848200901b561e266cbda.tar
nixlib-f52700fc146493fc185848200901b561e266cbda.tar.gz
nixlib-f52700fc146493fc185848200901b561e266cbda.tar.bz2
nixlib-f52700fc146493fc185848200901b561e266cbda.tar.lz
nixlib-f52700fc146493fc185848200901b561e266cbda.tar.xz
nixlib-f52700fc146493fc185848200901b561e266cbda.tar.zst
nixlib-f52700fc146493fc185848200901b561e266cbda.zip
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.
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/mysql/mysql-replication.nix12
1 files 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"
     )
   '';
 })