summary refs log tree commit diff
path: root/tests/mysql.nix
blob: b48850738b72250cae6bfbd3f4e39e9162368b53 (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->waitForUnit("mysql");
    $master->sleep(10); # Hopefully this is long enough!!
    $master->succeed("echo 'use testdb; select * from tests' | mysql -u root -N | grep 4");
  '';
}