zookeeper: Add simple test

release-18.03-flake
Tim Steinbach 2017-11-02 13:59:10 -04:00
parent ace06a2bf1
commit d27cf320cf
No known key found for this signature in database
GPG Key ID: 472BFCCA96BD0EDA
2 changed files with 29 additions and 1 deletions

View File

@ -329,7 +329,7 @@ in rec {
tests.wordpress = callTest tests/wordpress.nix {};
tests.xfce = callTest tests/xfce.nix {};
tests.xmonad = callTest tests/xmonad.nix {};
tests.zookeeper = callTest tests/zookeeper.nix {};
/* Build a bunch of typical closures so that Hydra can keep track of
the evolution of closure sizes. */

View File

@ -0,0 +1,28 @@
import ./make-test.nix ({ pkgs, ...} : {
name = "zookeeper";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ nequissimus ];
};
nodes = {
server = { pkgs, config, ... }: {
services.zookeeper = {
enable = true;
};
networking.firewall.allowedTCPPorts = [ 2181 ];
};
};
testScript = ''
startAll;
$server->waitForUnit("zookeeper");
$server->waitForUnit("network.target");
$server->waitForOpenPort(2181);
$server->waitUntilSucceeds("${pkgs.zookeeper}/bin/zkCli.sh -server localhost:2181 create /foo bar");
$server->waitUntilSucceeds("${pkgs.zookeeper}/bin/zkCli.sh -server localhost:2181 set /foo hello");
$server->waitUntilSucceeds("${pkgs.zookeeper}/bin/zkCli.sh -server localhost:2181 get /foo | grep hello");
'';
})