diff options
author | Daniel Schaefer <git@danielschaefer.me> | 2019-04-09 04:02:49 +0200 |
---|---|---|
committer | Daniel Schaefer <git@danielschaefer.me> | 2019-06-13 04:36:41 +0200 |
commit | 6778ee186299ab56f141785a88abfb76f6814147 (patch) | |
tree | e7822264938fab52810b044d554adbc50b728fb5 /nixos | |
parent | c1991fb18d2a58eefeba0a49bb683eb4e561263f (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')
-rw-r--r-- | nixos/tests/cassandra.nix | 20 |
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 = '' |