From da087a74c789a1d7da37ff9dfb972408382aaac5 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Sat, 9 Dec 2023 02:58:01 +0530 Subject: [PATCH] feat: helper make commands to install and test mcaptcha --- Makefile | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b786743..601d16e 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,12 @@ define configure_cache ansible-playbook -i $(INVENTORY) -f 10 ./ansible/cache.yml endef +define configure_mcaptcha + . ./venv/bin/activate && \ + ansible-playbook -i $(INVENTORY) -f 10 ./ansible/mcaptcha.yml +endef + + define test_base . ./venv/bin/activate && \ @@ -49,6 +55,19 @@ define test_cache endef +define test_mcaptcha + . ./venv/bin/activate && \ + cd tests/mcaptcha/ && \ + ANSIBLE_REMOTE_USER=root \ + py.test --hosts='ansible://mcaptcha_hosts' \ + -n 10 \ + --verbose \ + --ansible-inventory="../../${INVENTORY}" \ + base.py + +endef + + define test_locust . ./venv/bin/activate && \ @@ -88,6 +107,13 @@ conf.dos: ## Configure all DoS VMs conf.cache: ## Configure all cache VMs $(call configure_cache) +# ```bash +# INVENTORY=./terraform/dos/hosts.ini make conf.mcaptcha +# ``` +conf.mcaptcha: ## Configure all mcaptcha VMs + $(call configure_mcaptcha) + + # ```bash # INVENTORY=./terraform/dos/hosts.ini make conf.ping # ``` @@ -105,7 +131,8 @@ test.base: ## Test base configuration on all VMs test.cache: ## Test cache configuration $(call test_cache) - +test.mcaptcha: ## Test mcaptcha configuration + $(call test_mcaptcha) 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}'