mirror of
https://github.com/PR0M3TH3AN/VoxVera.git
synced 2026-10-27 09:40:40 +00:00
feat: harden docker runtime validation
This commit is contained in:
1 parent
004cce2a4f
commit
83e9e3d511
32 files changed
+1360
-40
No files matched your search
@@ -14,6 +14,7 @@ from voxvera.platforms import base as platform_base
|
||||
from voxvera.platforms import linux as platform_linux
|
||||
from voxvera.platforms import macos as platform_macos
|
||||
from voxvera.platforms import windows as platform_windows
|
||||
from voxvera.platforms import docker as platform_docker
|
||||
|
||||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
|
||||
@@ -53,10 +54,20 @@ def test_help(capsys):
|
||||
|
||||
def test_get_platform_adapter_linux(monkeypatch):
|
||||
monkeypatch.setattr(platform, "system", lambda: "Linux")
|
||||
monkeypatch.delenv("VOXVERA_RUNTIME", raising=False)
|
||||
monkeypatch.setattr(platform_docker.DockerPlatformAdapter, "is_container_runtime", lambda self: False)
|
||||
adapter = get_platform_adapter(cli_module=cli)
|
||||
assert adapter.platform_id == "linux_cli_systemd"
|
||||
|
||||
|
||||
def test_get_platform_adapter_docker(monkeypatch):
|
||||
monkeypatch.setattr(platform, "system", lambda: "Linux")
|
||||
monkeypatch.setenv("VOXVERA_RUNTIME", "docker")
|
||||
monkeypatch.setattr(platform_docker.DockerPlatformAdapter, "is_container_runtime", lambda self: True)
|
||||
adapter = get_platform_adapter(cli_module=cli)
|
||||
assert adapter.platform_id == "docker_cli"
|
||||
|
||||
|
||||
def test_get_platform_adapter_macos(monkeypatch):
|
||||
monkeypatch.setattr(platform, "system", lambda: "Darwin")
|
||||
adapter = get_platform_adapter(cli_module=cli)
|
||||
|
||||
@@ -76,6 +76,27 @@ def test_release_artifact_validation_is_wired_into_binaries_workflow():
|
||||
assert "platform-status --json" in script_text
|
||||
assert "init --non-interactive" in script_text
|
||||
|
||||
|
||||
def test_docker_runtime_assets_are_present():
|
||||
dockerfile = (REPO_ROOT / "Dockerfile").read_text(encoding="utf-8")
|
||||
dockerignore = REPO_ROOT / ".dockerignore"
|
||||
entrypoint = REPO_ROOT / "scripts" / "docker-entrypoint.sh"
|
||||
healthcheck = REPO_ROOT / "scripts" / "docker-healthcheck.sh"
|
||||
runtime_smoke = REPO_ROOT / "scripts" / "docker-runtime-smoke.sh"
|
||||
ci_workflow = (REPO_ROOT / ".github" / "workflows" / "ci.yml").read_text(encoding="utf-8")
|
||||
docker_doc = (REPO_ROOT / "docs" / "templates" / "docker.md").read_text(encoding="utf-8")
|
||||
|
||||
assert dockerignore.exists()
|
||||
assert entrypoint.exists()
|
||||
assert healthcheck.exists()
|
||||
assert runtime_smoke.exists()
|
||||
assert "tini" in dockerfile
|
||||
assert "docker-entrypoint.sh" in dockerfile
|
||||
assert "docker-healthcheck.sh" in dockerfile
|
||||
assert "HEALTHCHECK" in dockerfile
|
||||
assert "scripts/docker-runtime-smoke.sh" in ci_workflow
|
||||
assert "starts an in-container Tor daemon" in docker_doc
|
||||
|
||||
def test_locale_completeness():
|
||||
"""Verify that all non-English locales have the same keys as English."""
|
||||
locales_dir = REPO_ROOT / "voxvera" / "locales"
|
||||
|
||||
Reference in new issue
Block a user