full-setup vm test: a failed create also dumps the swarm queue's nats and auth units
This commit is contained in:
parent
8fbb3c65fd
commit
a95fdc6281
1 changed files with 10 additions and 1 deletions
|
|
@ -49,10 +49,14 @@ def diagnose(unit=None, container=None):
|
|||
where = f"--machine={container} " if container else ""
|
||||
units = [unit] if isinstance(unit, str) else list(unit or [])
|
||||
flags = " ".join(f"-u '{u}'" for u in units)
|
||||
names = " ".join(f"'{u}'" for u in units)
|
||||
for command in [
|
||||
f"systemctl {where}--failed --no-legend --no-pager",
|
||||
*(
|
||||
[f"journalctl {where}{flags} --no-pager -n 50 | tail -c 6000"]
|
||||
[
|
||||
f"systemctl {where}status {names} --no-pager -l",
|
||||
f"journalctl {where}{flags} --no-pager -n 50 | tail -c 6000",
|
||||
]
|
||||
if units
|
||||
else []
|
||||
),
|
||||
|
|
@ -81,6 +85,11 @@ def create_agent(body):
|
|||
return
|
||||
machine.sleep(10)
|
||||
diagnose("swarm-controller")
|
||||
# The queue refuses every client when its responder cannot answer. nats and
|
||||
# the responder run in the container; the units that fetch its keys and
|
||||
# certificate run on the host.
|
||||
diagnose(["nats.service", "swarm-nats-auth.service"], "swarm-nats")
|
||||
diagnose(["swarm-bao-nats-tls.service", "swarm-bao-nats-callout-xkey.service"])
|
||||
raise Exception(
|
||||
f"the controller refused to create {body['name']}: HTTP {out}: {machine.succeed('cat /root/create.out')}"
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue