summary refs log tree commit diff
path: root/tests/mysql.nix
blob: cb8f124790937ba6df7c78d25f67efe4399f747e (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");
  '';
}