summaryrefslogtreecommitdiffstats
path: root/nixos/tests/cassandra.nix
diff options
context:
space:
mode:
authorDaniel Schaefer <git@danielschaefer.me>2019-04-09 04:02:49 +0200
committerDaniel Schaefer <git@danielschaefer.me>2019-06-13 04:36:41 +0200
commit6778ee186299ab56f141785a88abfb76f6814147 (patch)
treee7822264938fab52810b044d554adbc50b728fb5 /nixos/tests/cassandra.nix
parentc1991fb18d2a58eefeba0a49bb683eb4e561263f (diff)
nixos/cassandra: Fix test by listening on IP
Seems like you can't have a node as its own seed when it's listening on an interface instead of an IP. At least the way it was done in the test doesn't work and I can't figure out any other way than to just listen on the IP address instead.
Diffstat (limited to 'nixos/tests/cassandra.nix')
-rw-r--r--nixos/tests/cassandra.nix20
1 files changed, 9 insertions, 11 deletions
diff --git a/nixos/tests/cassandra.nix b/nixos/tests/cassandra.nix
index 60d0c6d76068..40d6b238dc02 100644
--- a/nixos/tests/cassandra.nix
+++ b/nixos/tests/cassandra.nix
@@ -2,25 +2,23 @@ import ./make-test.nix ({ pkgs, ...}:
let
# Change this to test a different version of Cassandra:
testPackage = pkgs.cassandra;
- cassandraCfg =
+ cassandraCfg = hostname:
{ enable = true;
- listenAddress = null;
- listenInterface = "eth1";
- rpcAddress = null;
- rpcInterface = "eth1";
+ listenAddress = hostname;
+ rpcAddress = hostname;
extraConfig =
{ start_native_transport = true;
seed_provider =
[{ class_name = "org.apache.cassandra.locator.SimpleSeedProvider";
- parameters = [ { seeds = "cass0"; } ];
+ parameters = [ { seeds = "192.168.1.1"; } ];
}];
};
package = testPackage;
};
- nodeCfg = extra: {pkgs, config, ...}:
+ nodeCfg = hostname: extra: {pkgs, config, ...}:
{ environment.systemPackages = [ testPackage ];
networking.firewall.enable = false;
- services.cassandra = cassandraCfg // extra;
+ services.cassandra = cassandraCfg hostname // extra;
virtualisation.memorySize = 1024;
};
in
@@ -28,9 +26,9 @@ in
name = "cassandra-ci";
nodes = {
- cass0 = nodeCfg {};
- cass1 = nodeCfg {};
- cass2 = nodeCfg { jvmOpts = [ "-Dcassandra.replace_address=cass1" ]; };
+ cass0 = nodeCfg "192.168.1.1" {};
+ cass1 = nodeCfg "192.168.1.2" {};
+ cass2 = nodeCfg "192.168.1.3" { jvmOpts = [ "-Dcassandra.replace_address=cass1" ]; };
};
testScript = ''