Files
mtusi2026lab7/Makefile
T
makkelay 1d146756d7
Skeleton contracts / contracts (pull_request) Canceled after 0s
[+] add project
2026-12-05 22:05:31 +03:00

54 lines
1.7 KiB
Makefile

PYTHON ?= python3
BASE_URL ?= https://localhost:8443
CA_FILE ?= secrets/pki/ca.crt
ACTION_SCRIPT ?=
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
COMPOSE ?= docker compose
.PHONY: help bootstrap up down logs check validate test load test-persistence test-failover test-security test-mtls
help:
@echo "bootstrap: create local CA/certificates and ignored secrets"
@echo "up: provision and start the secured Compose stack"
@echo "down: stop services without deleting persistent volumes"
@echo "check: structure, contracts and Python syntax; validate: full OpenAPI"
@echo "test: HTTPS smoke; test-security: trusted/untrusted CA check; test-mtls: API identity checks"
bootstrap:
./scripts/bootstrap-local-stack.sh
up:
./scripts/start-stack.sh
down:
$(COMPOSE) down
logs:
$(COMPOSE) logs --tail=100 -f
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)
test-mtls:
$(COMPOSE) --profile test run --rm --no-deps mtls-probe