cluster/services/consul: adjust test
This commit is contained in:
parent
fe50d53c91
commit
9c260fd0f7
1 changed files with 2 additions and 6 deletions
|
@ -1,8 +1,4 @@
|
||||||
{ lib, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
defaults.options.services.locksmith = lib.mkSinkUndeclaredOptions { };
|
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
@ -11,12 +7,12 @@
|
||||||
with subtest("should form cluster"):
|
with subtest("should form cluster"):
|
||||||
nodes = [ n for n in machines if n != nowhere ]
|
nodes = [ n for n in machines if n != nowhere ]
|
||||||
for machine in nodes:
|
for machine in nodes:
|
||||||
machine.succeed("systemctl start consul-ready.service")
|
machine.succeed("systemctl start consul-ready.target")
|
||||||
for machine in nodes:
|
for machine in nodes:
|
||||||
consulConfig = json.loads(machine.succeed("cat /etc/consul.json"))
|
consulConfig = json.loads(machine.succeed("cat /etc/consul.json"))
|
||||||
addr = consulConfig["addresses"]["http"]
|
addr = consulConfig["addresses"]["http"]
|
||||||
port = consulConfig["ports"]["http"]
|
port = consulConfig["ports"]["http"]
|
||||||
setEnv = f"CONSUL_HTTP_ADDR={addr}:{port}"
|
setEnv = f"CONSUL_HTTP_ADDR={addr}:{port} CONSUL_HTTP_TOKEN_FILE=/run/locksmith/consul-systemManagementToken"
|
||||||
memberList = machine.succeed(f"{setEnv} consul members --status=alive")
|
memberList = machine.succeed(f"{setEnv} consul members --status=alive")
|
||||||
for machine2 in nodes:
|
for machine2 in nodes:
|
||||||
assert machine2.name in memberList
|
assert machine2.name in memberList
|
||||||
|
|
Loading…
Reference in a new issue