mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-10 16:45:51 +03:00
23 lines
509 B
Nix
23 lines
509 B
Nix
|
{ 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");
|
||
|
'';
|
||
|
}
|