diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 4fd1c64693ac..b85e78e8cb51 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -649,10 +649,22 @@ in harmonia = runTest ./harmonia.nix; headscale = runTest ./headscale.nix; healthchecks = runTest ./web-apps/healthchecks.nix; - hbase2 = handleTest ./hbase.nix { package = pkgs.hbase2; }; - hbase_2_5 = handleTest ./hbase.nix { package = pkgs.hbase_2_5; }; - hbase_2_4 = handleTest ./hbase.nix { package = pkgs.hbase_2_4; }; - hbase3 = handleTest ./hbase.nix { package = pkgs.hbase3; }; + hbase2 = runTest { + imports = [ ./hbase.nix ]; + _module.args.getPackage = pkgs: pkgs.hbase2; + }; + hbase_2_5 = runTest { + imports = [ ./hbase.nix ]; + _module.args.getPackage = pkgs: pkgs.hbase_2_5; + }; + hbase_2_4 = runTest { + imports = [ ./hbase.nix ]; + _module.args.getPackage = pkgs: pkgs.hbase_2_4; + }; + hbase3 = runTest { + imports = [ ./hbase.nix ]; + _module.args.getPackage = pkgs: pkgs.hbase3; + }; hedgedoc = runTest ./hedgedoc.nix; herbstluftwm = runTest ./herbstluftwm.nix; homebox = runTest ./homebox.nix; diff --git a/nixos/tests/hbase.nix b/nixos/tests/hbase.nix index 12afa3a2d221..25af5e495a4a 100644 --- a/nixos/tests/hbase.nix +++ b/nixos/tests/hbase.nix @@ -1,39 +1,33 @@ -import ./make-test-python.nix ( - { - pkgs, - lib, - package ? pkgs.hbase, - ... - }: - { - name = "hbase-standalone"; +{ getPackage, lib, ... }: +{ + name = "hbase-standalone"; - meta = with lib.maintainers; { - maintainers = [ illustris ]; + 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 + ]; }; - nodes = { - hbase = - { pkgs, ... }: - { - 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 = with pkgs; [ - 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") - ''; - } -) + 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") + ''; +}