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;
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;

View File

@ -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")
'';
}