feat: make helpers to configure and test cache install
This commit is contained in:
parent
aced3188b2
commit
beeef3c7bd
1 changed files with 31 additions and 0 deletions
31
Makefile
31
Makefile
|
@ -19,6 +19,12 @@ define configure_locust
|
||||||
ansible-playbook -i $(INVENTORY) -f 10 ./ansible/locust.yml
|
ansible-playbook -i $(INVENTORY) -f 10 ./ansible/locust.yml
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define configure_cache
|
||||||
|
. ./venv/bin/activate && \
|
||||||
|
ansible-playbook -i $(INVENTORY) -f 10 ./ansible/cache.yml
|
||||||
|
endef
|
||||||
|
|
||||||
|
|
||||||
define test_base
|
define test_base
|
||||||
. ./venv/bin/activate && \
|
. ./venv/bin/activate && \
|
||||||
cd tests/ && \
|
cd tests/ && \
|
||||||
|
@ -31,6 +37,19 @@ define test_base
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define test_cache
|
||||||
|
. ./venv/bin/activate && \
|
||||||
|
cd tests/cache/ && \
|
||||||
|
ANSIBLE_REMOTE_USER=root \
|
||||||
|
py.test --hosts='ansible://mcaptcha_hosts' \
|
||||||
|
-n 10 \
|
||||||
|
--verbose \
|
||||||
|
--ansible-inventory="../../${INVENTORY}" \
|
||||||
|
base.py
|
||||||
|
|
||||||
|
endef
|
||||||
|
|
||||||
|
|
||||||
define test_locust
|
define test_locust
|
||||||
. ./venv/bin/activate && \
|
. ./venv/bin/activate && \
|
||||||
cd tests/locust/ && \
|
cd tests/locust/ && \
|
||||||
|
@ -62,6 +81,13 @@ lint: ## Lint source code
|
||||||
conf.dos: ## Configure all DoS VMs
|
conf.dos: ## Configure all DoS VMs
|
||||||
$(call configure_locust)
|
$(call configure_locust)
|
||||||
|
|
||||||
|
|
||||||
|
# ```bash
|
||||||
|
# INVENTORY=./terraform/dos/hosts.ini make conf.cache
|
||||||
|
# ```
|
||||||
|
conf.cache: ## Configure all cache VMs
|
||||||
|
$(call configure_cache)
|
||||||
|
|
||||||
# ```bash
|
# ```bash
|
||||||
# INVENTORY=./terraform/dos/hosts.ini make conf.ping
|
# INVENTORY=./terraform/dos/hosts.ini make conf.ping
|
||||||
# ```
|
# ```
|
||||||
|
@ -76,5 +102,10 @@ test: ## Run all tests
|
||||||
test.base: ## Test base configuration on all VMs
|
test.base: ## Test base configuration on all VMs
|
||||||
$(call test_base)
|
$(call test_base)
|
||||||
|
|
||||||
|
test.cache: ## Test cache configuration
|
||||||
|
$(call test_cache)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
help: ## Prints help for targets with comments
|
help: ## Prints help for targets with comments
|
||||||
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-].+:.*?## .*$$' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-].+:.*?## .*$$' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|
Loading…
Reference in a new issue