feat(dashboard): tab Infrastructura, panouri colapsabile si compacte
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KddsXCqEbKMhdFJDYbAsx8
This commit is contained in:
@@ -450,6 +450,40 @@ def test_valoare_necunoscuta_pentru_auth_nu_deschide_panoul(server, state_dir):
|
||||
assert server.call("/api/status")[0] == 401
|
||||
|
||||
|
||||
# --- tab Infrastructura ------------------------------------------------------
|
||||
|
||||
def test_infra_run_id_inexistent(server):
|
||||
server.login()
|
||||
status, data, _ = server.call("/api/infra/run", {"id": "nu-exista", "dry_run": False})
|
||||
assert status == 400
|
||||
assert not data["ok"]
|
||||
|
||||
|
||||
def test_infra_run_ignora_campurile_in_plus(server, monkeypatch):
|
||||
"""Payload-ul poate purta cmd/host straine -- api.py trebuie sa apeleze
|
||||
infra_actions.run doar cu (id, dry_run), restul se ignora."""
|
||||
server.login()
|
||||
apeluri = []
|
||||
|
||||
def fake_run(action_id, dry_run):
|
||||
apeluri.append((action_id, dry_run))
|
||||
return {"ok": True, "code": 200, "host": "pvemini"}
|
||||
|
||||
import infra_actions
|
||||
monkeypatch.setattr(infra_actions, "run", fake_run)
|
||||
status, data, _ = server.call("/api/infra/run", {
|
||||
"id": "oprire", "dry_run": True, "cmd": "rm -rf /", "host": "x",
|
||||
})
|
||||
assert status == 200 and data["ok"]
|
||||
assert apeluri == [("oprire", True)]
|
||||
|
||||
|
||||
def test_infra_log_id_invalid(server):
|
||||
server.login()
|
||||
status, _, _ = server.call("/api/infra/log?id=../x")
|
||||
assert status == 400
|
||||
|
||||
|
||||
def test_identitatea_tailscale_e_doar_pentru_jurnal(server_fara_auth):
|
||||
"""Antetul pus de `tailscale serve` se raporteaza, dar nu decide accesul:
|
||||
pe localhost lipseste, si totusi cererea trece."""
|
||||
|
||||
Reference in New Issue
Block a user