nixosTests.hbase{2,_2_4,_2_5,3}: handleTest -> runTest

This commit is contained in:
Sizhe Zhao 2025-07-09 12:48:05 +08:00
parent a698ac1214
commit 2522b5207f
No known key found for this signature in database
GPG Key ID: ED1807251A7DA08F
2 changed files with 46 additions and 40 deletions

View File

@ -649,10 +649,22 @@ in
harmonia = runTest ./harmonia.nix; harmonia = runTest ./harmonia.nix;
headscale = runTest ./headscale.nix; headscale = runTest ./headscale.nix;
healthchecks = runTest ./web-apps/healthchecks.nix; healthchecks = runTest ./web-apps/healthchecks.nix;
hbase2 = handleTest ./hbase.nix { package = pkgs.hbase2; }; hbase2 = runTest {
hbase_2_5 = handleTest ./hbase.nix { package = pkgs.hbase_2_5; }; imports = [ ./hbase.nix ];
hbase_2_4 = handleTest ./hbase.nix { package = pkgs.hbase_2_4; }; _module.args.getPackage = pkgs: pkgs.hbase2;
hbase3 = handleTest ./hbase.nix { package = pkgs.hbase3; }; };
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; hedgedoc = runTest ./hedgedoc.nix;
herbstluftwm = runTest ./herbstluftwm.nix; herbstluftwm = runTest ./herbstluftwm.nix;
homebox = runTest ./homebox.nix; homebox = runTest ./homebox.nix;

View File

@ -1,39 +1,33 @@
import ./make-test-python.nix ( { getPackage, lib, ... }:
{ {
pkgs, name = "hbase-standalone";
lib,
package ? pkgs.hbase,
...
}:
{
name = "hbase-standalone";
meta = with lib.maintainers; { meta = with lib.maintainers; {
maintainers = [ illustris ]; 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 = { testScript = ''
hbase = start_all()
{ pkgs, ... }: hbase.wait_for_unit("hbase.service")
{ hbase.wait_until_succeeds("echo \"create 't1','f1'\" | sudo -u hbase hbase shell -n")
services.hbase-standalone = { assert "NAME => 'f1'" in hbase.succeed("echo \"describe 't1'\" | sudo -u hbase hbase shell -n")
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")
'';
}
)