# A3 cert→Host binding tests.
#   make unit         → Node/vitest: getCertSub SAN extractor + map-logic (no docker)
#   make integration  → real nginx+njs docker: positive 200 + cross-tenant 403 (needs docker+openssl)
#   make test         → both

REPO_ROOT := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))/../../../..)

.PHONY: unit integration test
unit:
	cd $(REPO_ROOT)/control-plane && npx vitest run test/getcertsub.test.ts

integration:
	bash $(dir $(lastword $(MAKEFILE_LIST)))run.sh

test: unit integration
