The Simulacrum: Stage 2 #109

Merged
max merged 2 commits from pr-simulacrum-stage-2 into master 2024-08-14 00:34:12 +03:00
4 changed files with 25 additions and 7 deletions

View file

@ -22,6 +22,11 @@ in
];
ready = ./ready.nix;
};
simulacrum = {
enable = true;
deps = [ "wireguard" ];
settings = ./test.nix;
};
};
dns.records."consul-remote.internal".consulService = "consul-remote";

View file

@ -0,0 +1,20 @@
{
testScript = ''
import json
start_all()
with subtest("should form cluster"):
nodes = [ n for n in machines if n != nowhere ]
for machine in nodes:
machine.succeed("systemctl start consul-ready.service")
for machine in nodes:
consulConfig = json.loads(machine.succeed("cat /etc/consul.json"))
addr = consulConfig["addresses"]["http"]
port = consulConfig["ports"]["http"]
setEnv = f"CONSUL_HTTP_ADDR={addr}:{port}"
memberList = machine.succeed(f"{setEnv} consul members --status=alive")
for machine2 in nodes:
assert machine2.name in memberList
'';
}

View file

@ -29,7 +29,6 @@ in
reflection = ./reflection;
shell-config = ./shell-config;
ssh = ./ssh;
system-info = ./system-info;
system-recovery = ./system-recovery;
systemd-extras = ./systemd-extras;
tested = ./tested;
@ -56,7 +55,6 @@ in
motd
networking
nix-config-server
system-info
system-recovery
tested
];

View file

@ -1,5 +0,0 @@
{ depot, ... }:
{
system.configurationRevision = depot.rev or null;
}