1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-25 15:11:35 +00:00
nixpkgs/nixos/tests/zookeeper.nix

35 lines
842 B
Nix
Raw Normal View History

2019-11-06 06:54:37 +00:00
import ./make-test-python.nix ({ pkgs, ...} : {
2017-11-02 17:59:10 +00:00
name = "zookeeper";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ nequissimus ];
};
nodes = {
server = { ... }: {
2017-11-02 17:59:10 +00:00
services.zookeeper = {
enable = true;
};
networking.firewall.allowedTCPPorts = [ 2181 ];
};
};
testScript = ''
2019-11-06 06:54:37 +00:00
start_all()
2017-11-02 17:59:10 +00:00
2019-11-06 06:54:37 +00:00
server.wait_for_unit("zookeeper")
server.wait_for_unit("network.target")
server.wait_for_open_port(2181)
2017-11-02 17:59:10 +00:00
2019-11-06 06:54:37 +00:00
server.wait_until_succeeds(
"${pkgs.zookeeper}/bin/zkCli.sh -server localhost:2181 create /foo bar"
)
server.wait_until_succeeds(
"${pkgs.zookeeper}/bin/zkCli.sh -server localhost:2181 set /foo hello"
)
server.wait_until_succeeds(
"${pkgs.zookeeper}/bin/zkCli.sh -server localhost:2181 get /foo | grep hello"
)
2017-11-02 17:59:10 +00:00
'';
})