выполнение lab3, track-1

This commit is contained in:
R0flyan
2026-10-23 16:16:50 +03:00
parent 0ab3a341aa
commit f5d79d1886
64 changed files with 35863 additions and 58 deletions
+18
View File
@@ -0,0 +1,18 @@
"""Run the unchanged public make targets with executable Linux action hooks."""
import argparse
from pathlib import Path
import subprocess
root = Path(__file__).resolve().parents[1]
p = argparse.ArgumentParser()
p.add_argument('target', choices=['check', 'validate', 'test', 'test-own', 'test-race', 'test-persistence', 'test-failover'])
args = p.parse_args()
command = ['docker', 'run', '--rm', '--network', 'mtusi-lab3_default',
'--mount', 'type=bind,source='+str(root)+',target=/workspace']
hooks = {'test-persistence': 'scripts/restart.sh', 'test-failover': 'scripts/stop-one.sh'}
if args.target in hooks:
command += ['--mount', 'type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock']
command += ['mtusi-messenger:lab3-tests', 'make', args.target, 'BASE_URL=http://lb:8080']
if args.target in hooks:
command += ['ACTION_SCRIPT='+hooks[args.target]]
raise SystemExit(subprocess.call(command, cwd=root))