From 6778ee186299ab56f141785a88abfb76f6814147 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Tue, 9 Apr 2019 04:02:49 +0200 Subject: 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. --- nixos/tests/cassandra.nix | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'nixos') 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 = '' -- cgit v1.2.3