Files
mtusi2026lab7/Makefile
mayorovasonya 7353ab97a6 Лаб7: mTLS, Argon2id, OpenBao и исследование отзыва worker
Майорова Софья, БВТ2301, на 5. Трек1. HTTPS/TLS/ACL,18 API tests,13 pipeline groups,3 compromise runs,clean clone,persistence. Original tests/API contract preserved; residual CVE triage in REPORT/security.
2026-11-20 14:48:26 +03:00

48 lines
1.6 KiB
Makefile

PYTHON ?= python3
BASE_URL ?= https://localhost:8443
CA_FILE ?=
ACTION_SCRIPT ?=
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
.PHONY: help check validate test load test-persistence test-failover test-security
help:
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
check:
$(PYTHON) scripts/check_contract.py
validate:
$(PYTHON) scripts/validate_openapi.py
test:
$(PYTHON) tests/smoke.py --base-url "$(BASE_URL)" $(TLS_ARGS)
load:
$(PYTHON) tests/load.py --base-url "$(BASE_URL)" $(TLS_ARGS)
test-persistence:
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable restart hook"; exit 2)
$(PYTHON) tests/resilience.py --mode persistence --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
test-failover:
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable stop-one hook"; exit 2)
$(PYTHON) tests/resilience.py --mode failover --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
test-security:
$(PYTHON) tests/security.py --base-url "$(BASE_URL)" $(TLS_ARGS)
.PHONY: test-student
test-student:
BASE_URL="$(BASE_URL)" CA_FILE="$(CA_FILE)" $(PYTHON) -m unittest discover -s student-tests -p 'test_*.py' -v
.PHONY: up test-internal-security research scan
up:
python3 scripts/start.py
test-internal-security:
docker compose --profile tools run --rm --no-deps audit /app/student-tests/tls_audit.py
research:
BASE_URL="$(BASE_URL)" CA_FILE="$(CA_FILE)" python3 student-tests/research.py
scan:
python3 student-tests/scan_images.py