3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos/tests/mysql.nix
Peter Hoeg 5b468ea6b1 nixos mysql: make start-up more robust (#41010)
1) Change start-type to ```notify``` when running MariaDB so that we don't have to busy-wait for the
socket to appear.

2) Do not manually create the directory under /run as we can get systemd to do
that for us. This opens up the possibility later for not having to launch as root.
2018-05-24 16:42:16 +02:00

25 lines
576 B
Nix

import ./make-test.nix ({ pkgs, ...} : {
name = "mysql";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ eelco chaoflow shlevy ];
};
nodes = {
master =
{ pkgs, config, ... }:
{
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");
'';
})