summaryrefslogtreecommitdiffstats
path: root/nixos/tests/hbase.nix
blob: 337564153b732cb6c108b4f12142762e32f0cde1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
  pkgs,
  getPackage,
  lib,
  ...
}:
{
  name = "hbase-${(getPackage pkgs).version}-standalone";

  meta = with lib.maintainers; {
    maintainers = [ illustris ];
  };

  nodes.hbase =
    { pkgs, ... }:
    let
      package = getPackage pkgs;
    in
    {
      services.hbase-standalone = {
        enable = true;
        inherit package;
        # Needed for standalone mode in hbase 2+
        # This setting and standalone mode are not suitable for production
        settings."hbase.unsafe.stream.capability.enforce" = "false";
      };
      environment.systemPackages = [
        package
      ];
    };

  testScript = ''
    start_all()
    hbase.wait_for_unit("hbase.service")
    hbase.wait_until_succeeds("echo \"create 't1','f1'\" | sudo -u hbase hbase shell -n")
    assert "NAME => 'f1'" in hbase.succeed("echo \"describe 't1'\" | sudo -u hbase hbase shell -n")
  '';
}