ЛР 3 — БПИ2302 — Щербацевич — на 5

This commit is contained in:
2026-11-11 23:55:42 +03:00
parent 0ab3a341aa
commit 7aa4ea541b
76 changed files with 4627 additions and 34 deletions
+38
View File
@@ -0,0 +1,38 @@
#!/usr/bin/env python3
"""Запуск публичного failover на Windows и POSIX с тем же scripts/stop-one.sh."""
import os
import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def script():
if os.name == "nt":
cmd = ROOT / "scripts" / "stop-one.cmd"
if cmd.is_file():
return str(cmd)
sh = ROOT / "scripts" / "stop-one.sh"
return str(sh)
def main():
env = os.environ.copy()
command = [
sys.executable,
str(ROOT / "tests" / "resilience.py"),
"--mode",
"failover",
"--action-script",
script(),
"--base-url",
env.get("BASE_URL", "http://127.0.0.1:8080"),
]
completed = subprocess.run(command, cwd=str(ROOT), env=env)
raise SystemExit(completed.returncode)
if __name__ == "__main__":
main()