summary refs log tree commit diff
path: root/tests/mysql.nix
blob: 65785c8fdb50084d5ca08304de5d6a3d75ffd3b8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ pkgs, ... }:

{
  nodes = {
    master =
      { pkgs, config, ... }:

      {
        services.mysql.enable = true;
	services.mysql.replication.role = "master";
	services.mysql.initialDatabases = [ { name = "testdb"; schema = ./testdb.sql; } ];
      };
  };

  testScript = ''
    startAll;

    $master->waitForJob("mysql");
    $master->sleep(10); # Hopefully this is long enough!!
    $master->mustSucceed("echo 'use testdb; select * from tests' | mysql -u root -N | grep 4");
  '';
}