Container: Vault-Prüfung ohne festen Dateiaufbau (wie systemd)
Deploy mindnet DEV (Container) / deploy (push) Successful in 50s
Deploy mindnet DEV (Container) / deploy (push) Successful in 50s
Der Preflight verlangte _system/dictionary/edge_vocabulary.md, die es nur im NAS-Vault gibt. Der Dev-Vault vault_master ist anders aufgebaut, systemd prüft nichts davon. Jetzt: Vault muss lesbar und nicht leer sein; eine bestimmte Datei nur noch optional über MINDNET_VAULT_SENTINEL. Default für MINDNET_VAULT_ROOT wie in app/config.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6a2ab522fc
commit
347ca50e71
4 files changed
+47
-19
No files matched your search
@@ -107,13 +107,11 @@ def test_no_cloud_keys_needs_no_ack(env):
|
||||
|
||||
# --- Vault / NAS -----------------------------------------------------------------------
|
||||
|
||||
def _vault(tmp_path, with_sentinel=True):
|
||||
def _vault(tmp_path, with_content=True):
|
||||
root = tmp_path / "vault"
|
||||
root.mkdir()
|
||||
if with_sentinel:
|
||||
sentinel = root / "_system" / "dictionary" / "edge_vocabulary.md"
|
||||
sentinel.parent.mkdir(parents=True)
|
||||
sentinel.write_text("# vocab", encoding="utf-8")
|
||||
if with_content:
|
||||
(root / "notiz.md").write_text("# Notiz", encoding="utf-8")
|
||||
return root
|
||||
|
||||
|
||||
@@ -125,7 +123,21 @@ def test_vault_missing_directory(env, tmp_path):
|
||||
|
||||
def test_vault_empty_mountpoint_is_detected(env, tmp_path):
|
||||
# Ausgefallenes NAS: Mountpunkt existiert, ist aber leer.
|
||||
env.setenv("MINDNET_VAULT_ROOT", str(_vault(tmp_path, with_sentinel=False)))
|
||||
env.setenv("MINDNET_VAULT_ROOT", str(_vault(tmp_path, with_content=False)))
|
||||
with pytest.raises(ep.PreflightError, match="leer"):
|
||||
ep.check_vault()
|
||||
|
||||
|
||||
def test_vault_needs_no_specific_file_by_default(env, tmp_path):
|
||||
# Wie systemd: jeder Vault-Aufbau ist zulässig (vault_master hat kein _system/).
|
||||
env.setenv("MINDNET_VAULT_ROOT", str(_vault(tmp_path)))
|
||||
env.setattr(ep, "_is_read_only_mount", lambda path: True)
|
||||
ep.check_vault()
|
||||
|
||||
|
||||
def test_vault_optional_sentinel_is_enforced(env, tmp_path):
|
||||
env.setenv("MINDNET_VAULT_ROOT", str(_vault(tmp_path)))
|
||||
env.setenv("MINDNET_VAULT_SENTINEL", "_system/dictionary/edge_vocabulary.md")
|
||||
with pytest.raises(ep.PreflightError, match="Sentinel"):
|
||||
ep.check_vault()
|
||||
|
||||
|
||||
Reference in new issue
Block a user