1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-01 18:12:46 +00:00
nixpkgs/nixos/tests/mysql.nix

23 lines
489 B
Nix
Raw Normal View History

{ 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");
'';
}