zookeeper: Add simple test

Changed files
+29 -1
nixos
+1 -1
nixos/release.nix
···
tests.wordpress = callTest tests/wordpress.nix {};
tests.xfce = callTest tests/xfce.nix {};
tests.xmonad = callTest tests/xmonad.nix {};
-
/* Build a bunch of typical closures so that Hydra can keep track of
the evolution of closure sizes. */
···
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. */
+28
nixos/tests/zookeeper.nix
···
···
+
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");
+
'';
+
})