nixosTests.cassandra_4: handleTest -> runTest

This commit is contained in:
Sizhe Zhao 2025-06-07 19:05:33 +08:00
parent 2e4fac6dfd
commit f4a714d8d5
No known key found for this signature in database
GPG Key ID: ED1807251A7DA08F
2 changed files with 149 additions and 148 deletions

View File

@ -290,7 +290,10 @@ in
calibre-server = import ./calibre-server.nix { inherit pkgs runTest; }; calibre-server = import ./calibre-server.nix { inherit pkgs runTest; };
canaille = runTest ./canaille.nix; canaille = runTest ./canaille.nix;
castopod = runTest ./castopod.nix; castopod = runTest ./castopod.nix;
cassandra_4 = handleTest ./cassandra.nix { testPackage = pkgs.cassandra_4; }; cassandra = runTest {
imports = [ ./cassandra.nix ];
_module.args.getPackage = pkgs: pkgs.cassandra;
};
centrifugo = runTest ./centrifugo.nix; centrifugo = runTest ./centrifugo.nix;
ceph-multi-node = handleTestOn [ "aarch64-linux" "x86_64-linux" ] ./ceph-multi-node.nix { }; ceph-multi-node = handleTestOn [ "aarch64-linux" "x86_64-linux" ] ./ceph-multi-node.nix { };
ceph-single-node = handleTestOn [ "aarch64-linux" "x86_64-linux" ] ./ceph-single-node.nix { }; ceph-single-node = handleTestOn [ "aarch64-linux" "x86_64-linux" ] ./ceph-single-node.nix { };

View File

@ -1,13 +1,12 @@
import ./make-test-python.nix (
{ {
pkgs, pkgs,
lib, lib,
testPackage ? pkgs.cassandra, getPackage ? pkgs: pkgs.cassandra_4,
... ...
}: }:
let let
testPackage = getPackage pkgs;
clusterName = "NixOS Automated-Test Cluster"; clusterName = "NixOS Automated-Test Cluster";
testRemoteAuth = lib.versionAtLeast testPackage.version "3.11"; testRemoteAuth = lib.versionAtLeast testPackage.version "3.11";
jmxRoles = [ jmxRoles = [
{ {
@ -31,13 +30,13 @@ import ./make-test-python.nix (
[ 1 -eq "$(echo "$(${getHeapLimitCommand}) < ${numMaxHeapSize}" | ${pkgs.bc}/bin/bc)" ] [ 1 -eq "$(echo "$(${getHeapLimitCommand}) < ${numMaxHeapSize}" | ${pkgs.bc}/bin/bc)" ]
''; '';
cassandraCfg = ipAddress: { cassandraCfg = pkgs: ipAddress: {
enable = true; enable = true;
inherit clusterName; inherit clusterName;
listenAddress = ipAddress; listenAddress = ipAddress;
rpcAddress = ipAddress; rpcAddress = ipAddress;
seedAddresses = [ "192.168.1.1" ]; seedAddresses = [ "192.168.1.1" ];
package = testPackage; package = getPackage pkgs;
maxHeapSize = "${numMaxHeapSize}M"; maxHeapSize = "${numMaxHeapSize}M";
heapNewSize = "100M"; heapNewSize = "100M";
inherit jmxPort; inherit jmxPort;
@ -46,7 +45,7 @@ import ./make-test-python.nix (
ipAddress: extra: ipAddress: extra:
{ pkgs, config, ... }: { pkgs, config, ... }:
rec { rec {
environment.systemPackages = [ testPackage ]; environment.systemPackages = [ (getPackage pkgs) ];
networking = { networking = {
firewall.allowedTCPPorts = [ firewall.allowedTCPPorts = [
7000 7000
@ -61,7 +60,7 @@ import ./make-test-python.nix (
} }
]; ];
}; };
services.cassandra = cassandraCfg ipAddress // extra; services.cassandra = cassandraCfg pkgs ipAddress // extra;
}; };
in in
{ {
@ -159,4 +158,3 @@ import ./make-test-python.nix (
inherit testPackage; inherit testPackage;
}; };
} }
)