From 670a23799673d732778b71a4bc025f9b22e7f64e Mon Sep 17 00:00:00 2001 From: "Christian R. Garcia" Date: Wed, 3 Jan 2024 14:26:05 -0800 Subject: [PATCH] Add test password to Makefile --- Makefile | 4 ++++ deploymentTemplate/api.yml | 5 +++++ deploymentTemplate/config.json | 2 +- deploymentTemplate/secrets.yml | 1 + tests/test_utils.py | 2 ++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fa82bcb..841f40b 100644 --- a/Makefile +++ b/Makefile @@ -55,6 +55,9 @@ export SERVICE_NAME := pods # SERVICE_PASS to use throughout. Must be filled. export SERVICE_PASS := password +# TEST_ABACO_SERVICE_PASSWORD to use throughout. Must be filled for testing (it has ability to create tokens) +export TEST_ABACO_SERVICE_PASS := changeme + # STATIC_NFS_IP to use throughout. Must be filled. export STATIC_NFS_IP := 10.96.175.175 @@ -85,6 +88,7 @@ up: vars build @sed -i 's/"version".*/"version": "$(TAG)",/g' config.json @sed -i 's/MAKEFILE_SERVICE_NAME/$(SERVICE_NAME)/g' * @sed -i 's/MAKEFILE_SERVICE_PASS/$(SERVICE_PASS)/g' * + @sed -i 's/MAKEFILE_TEST_ABACO_SERVICE_PASS/$(TEST_ABACO_SERVICE_PASS)/g' * @sed -i 's/MAKEFILE_STATIC_NFS_IP/$(STATIC_NFS_IP)/g' * @sed -i 's/MAKEFILE_TAG/$(TAG)/g' * @echo " 🔥 : Running burnup." diff --git a/deploymentTemplate/api.yml b/deploymentTemplate/api.yml index c9808ac..ba2002f 100644 --- a/deploymentTemplate/api.yml +++ b/deploymentTemplate/api.yml @@ -40,6 +40,11 @@ spec: secretKeyRef: name: tapis-MAKEFILE_SERVICE_NAME-secrets key: service-password + - name: TEST_ABACO_SERVICE_PASSWORD + valueFrom: + secretKeyRef: + name: tapis-MAKEFILE_SERVICE_NAME-secrets + key: test-abaco-service-password - name: POSTGRES_USERNAME value: pods-admin - name: POSTGRES_PASSWORD diff --git a/deploymentTemplate/config.json b/deploymentTemplate/config.json index 7020ed6..28ae308 100644 --- a/deploymentTemplate/config.json +++ b/deploymentTemplate/config.json @@ -5,7 +5,7 @@ "service_site_id": "tacc", "service_name": "pods", "service_password": "$env{SERVICE_PASSWORD}", - "test_abaco_service_password": "FILLTHISFORTESTING", + "test_abaco_service_password": "$env{TEST_ABACO_SERVICE_PASSWORD}", "tenants": [ "tacc", "dev", diff --git a/deploymentTemplate/secrets.yml b/deploymentTemplate/secrets.yml index fc4c43f..5953805 100644 --- a/deploymentTemplate/secrets.yml +++ b/deploymentTemplate/secrets.yml @@ -7,6 +7,7 @@ stringData: service-password: MAKEFILE_SERVICE_PASS rabbitmq-password: adminadmin postgres-password: adminadmin + test-abaco-service-password: MAKEFILE_TEST_ABACO_SERVICE_PASS --- diff --git a/tests/test_utils.py b/tests/test_utils.py index 2990e08..2cd29c7 100755 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -21,6 +21,8 @@ def get_service_tapis_client(): sk_url = os.environ.get('sk_url', conf.primary_site_admin_tenant_base_url) tenant_id = os.environ.get('tenant', 'admin') test_abaco_service_password = os.environ.get('test_abaco_service_password', conf.test_abaco_service_password) + if test_abaco_service_password == "changeme": + raise KeyError("test_abaco_service_password must be set in config or env for tests to run (it creates tokens)") jwt = os.environ.get('jwt', None) resource_set = os.environ.get('resource_set', 'local') custom_spec_dict = os.environ.get('custom_spec_dict', None)