nixpkgs/nixos/tests/mysql.nix

24 lines
574 B
Nix
Raw Normal View History

import ./make-test.nix {
2014-06-28 18:04:49 +04:00
name = "mysql";
nodes = {
master =
{ pkgs, config, ... }:
{
services.mysql.enable = true;
2014-02-28 19:16:57 +04:00
services.mysql.replication.role = "master";
services.mysql.initialDatabases = [ { name = "testdb"; schema = ./testdb.sql; } ];
2014-02-28 15:16:57 +04:00
services.mysql.package = pkgs.mysql;
};
};
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");
'';
}