This commit is contained in:
2026-11-20 15:30:33 +03:00
parent 20afc2c790
commit 36a56b3fe3
187 changed files with 431228 additions and 291 deletions
+36 -19
View File
@@ -1,33 +1,50 @@
PYTHON ?= python3
BASE_URL ?= https://localhost:8443
CA_FILE ?=
CA_FILE ?= $(CURDIR)/.local/trust/ca.crt
ACTION_SCRIPT ?=
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
.PHONY: help check validate test load test-persistence test-failover test-security
.PHONY: help bootstrap up down check validate lint format test test-security test-lab7 test-lifecycle test-audit test-attachments test-api-regressions test-persistence test-failover test-both-failovers verify-lab7 scan
help:
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
@echo "bootstrap; check validate lint; test test-security; test-lab7; test-lifecycle; test-audit; test-both-failovers; scan"
bootstrap:
$(PYTHON) scripts/lab7.py bootstrap
up: bootstrap
down:
docker compose down
check:
$(PYTHON) scripts/check_contract.py
validate:
$(PYTHON) scripts/validate_openapi.py
lint:
$(PYTHON) -m ruff check src
$(PYTHON) -m ruff format --check src
format:
$(PYTHON) -m ruff check --fix src
$(PYTHON) -m ruff format src
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)
test-lab7:
$(PYTHON) tests/lab7_security.py
test-lifecycle:
$(PYTHON) tests/lab7_lifecycle.py
test-audit:
$(PYTHON) tests/lab7_audit.py
test-attachments:
$(PYTHON) tests/attachments.py --base-url "$(BASE_URL)" $(TLS_ARGS)
test-api-regressions:
$(PYTHON) tests/api_regressions.py --base-url "$(BASE_URL)" $(TLS_ARGS)
test-persistence:
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT=scripts/restart.sh"; 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=scripts/stop-one.sh"; exit 2)
$(PYTHON) tests/resilience.py --mode failover --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
test-both-failovers:
$(PYTHON) scripts/test-failovers.py
verify-lab7:
$(PYTHON) scripts/verify-lab7.py
scan:
$(PYTHON) scripts/scan.py