summary refs log tree commit diff
path: root/nixos/tests/mysql.nix
blob: 7251c4a86499fde7e534bbad38f2f083c278f3e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import ./make-test.nix ({ pkgs, ...} : {
  name = "mysql";
  meta = with pkgs.stdenv.lib.maintainers; {
    maintainers = [ eelco chaoflow shlevy ];
  };

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

      {
        services.mysql.enable = true;
        services.mysql.initialDatabases = [ { name = "testdb"; schema = ./testdb.sql; } ];
        services.mysql.package = pkgs.mysql;
      };
  };

  testScript = ''
    startAll;

    $master->waitForUnit("mysql");
    $master->succeed("echo 'use testdb; select * from tests' | mysql -u root -N | grep 4");
  '';
})