forked from mtusi2026/mtusi2026lab7
на оценку 4
This commit is contained in:
@@ -1,13 +1,29 @@
|
||||
PYTHON ?= python3
|
||||
BASE_URL ?= https://localhost:8443
|
||||
CA_FILE ?=
|
||||
BASE_URL ?= https://127.0.0.1:8443
|
||||
CA_FILE ?= secrets/pki/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 init-secrets bootstrap up down check validate test load test-security test-security-grade3 test-security-grade4 test-acl-grade4 test-state-pruning-grade4 test-telemetry-leak-grade4 test-rate-limit-grade3 test-openbao-policy test-openbao-lifecycle-grade4 rotate-secret-grade4 rotate-leaf-grade4 scan-grade4 test-persistence test-failover argon2-benchmark login-dos-benchmark cleanup-lab
|
||||
|
||||
help:
|
||||
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
|
||||
@echo "init-secrets, bootstrap, up, down, check, validate, test, load"
|
||||
@echo "test-security-grade3, test-security-grade4, test-acl-grade4, test-state-pruning-grade4"
|
||||
@echo "test-rate-limit-grade3, test-openbao-policy, test-openbao-lifecycle-grade4"
|
||||
@echo "rotate-secret-grade4, rotate-leaf-grade4, scan-grade4, cleanup-lab"
|
||||
|
||||
init-secrets:
|
||||
./scripts/init-secrets.sh
|
||||
|
||||
bootstrap: init-secrets
|
||||
./scripts/bootstrap-dependencies.sh
|
||||
./scripts/bootstrap-openbao.sh
|
||||
|
||||
up: bootstrap
|
||||
docker compose up -d --build
|
||||
|
||||
down:
|
||||
docker compose down --remove-orphans
|
||||
|
||||
check:
|
||||
$(PYTHON) scripts/check_contract.py
|
||||
@@ -21,13 +37,55 @@ test:
|
||||
load:
|
||||
$(PYTHON) tests/load.py --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
|
||||
test-security:
|
||||
$(PYTHON) tests/security.py --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
|
||||
test-security-grade3:
|
||||
./tests/security_grade3.sh
|
||||
|
||||
test-security-grade4:
|
||||
./tests/security_grade4.sh
|
||||
|
||||
test-acl-grade4:
|
||||
./tests/acl_audit_grade4.sh
|
||||
|
||||
test-state-pruning-grade4:
|
||||
./tests/state_pruning_grade4.sh
|
||||
|
||||
test-telemetry-leak-grade4:
|
||||
./tests/telemetry_leak_grade4.sh
|
||||
|
||||
test-rate-limit-grade3:
|
||||
$(PYTHON) tests/rate_limit_grade3.py --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
|
||||
test-openbao-policy:
|
||||
./tests/openbao_policy.sh
|
||||
|
||||
test-openbao-lifecycle-grade4:
|
||||
./tests/openbao_lifecycle_grade4.sh
|
||||
|
||||
rotate-secret-grade4:
|
||||
./scripts/rotate-secret-grade4.sh
|
||||
|
||||
rotate-leaf-grade4:
|
||||
./scripts/rotate-leaf-grade4.sh
|
||||
|
||||
scan-grade4:
|
||||
./scripts/scan-grade4.sh
|
||||
|
||||
test-persistence:
|
||||
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable restart hook"; exit 2)
|
||||
@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 to your implemented executable stop-one hook"; exit 2)
|
||||
@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-security:
|
||||
$(PYTHON) tests/security.py --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
argon2-benchmark:
|
||||
go test -run '^$$' -bench BenchmarkHashPasswordGrade3 -benchtime=5x ./internal/security
|
||||
|
||||
login-dos-benchmark:
|
||||
go test -run '^$$' -bench BenchmarkVerifyPasswordGrade4 -benchtime=20x ./internal/security
|
||||
|
||||
cleanup-lab:
|
||||
./scripts/cleanup-lab.sh
|
||||
|
||||
Reference in New Issue
Block a user