From 6a5623bac61f4b9f672746d425f50d18c41e1119 Mon Sep 17 00:00:00 2001 From: Anton Danchenko Date: Tue, 17 Dec 2024 12:34:19 +0100 Subject: [PATCH] test_: set proxy creds (#6211) --- _assets/ci/Jenkinsfile.tests-rpc | 5 +++++ tests-functional/clients/status_backend.py | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/_assets/ci/Jenkinsfile.tests-rpc b/_assets/ci/Jenkinsfile.tests-rpc index ad08c340752..e93553b7c05 100644 --- a/_assets/ci/Jenkinsfile.tests-rpc +++ b/_assets/ci/Jenkinsfile.tests-rpc @@ -47,6 +47,11 @@ pipeline { credentialsId: 'codecov-repository-upload-token', variable: 'CODECOV_TOKEN' ), + usernamePassword( + credentialsId: "api-proxy-devel", + usernameVariable: 'STATUS_BUILD_PROXY_USER', + passwordVariable: 'STATUS_BUILD_PROXY_PASSWORD' + ), ]) { nix.shell('make test-functional', pure: false) } diff --git a/tests-functional/clients/status_backend.py b/tests-functional/clients/status_backend.py index 430a0a74712..cc80fc4c79a 100644 --- a/tests-functional/clients/status_backend.py +++ b/tests-functional/clients/status_backend.py @@ -130,6 +130,22 @@ def init_status_backend(self, data_dir=USER_DIR): } return self.api_valid_request(method, data) + def _set_proxy_credentials(self, data): + if not "STATUS_BUILD_PROXY_USER" in os.environ: + return data + + user = os.environ["STATUS_BUILD_PROXY_USER"] + password = os.environ["STATUS_BUILD_PROXY_PASSWORD"] + + data["StatusProxyMarketUser"] = user + data["StatusProxyMarketPassword"] = password + data["StatusProxyBlockchainUser"] = user + data["StatusProxyBlockchainPassword"] = password + + data["StatusProxyEnabled"] = True + data["StatusProxyStageName"] = "test" + return data + def create_account_and_login( self, data_dir=USER_DIR, @@ -146,6 +162,7 @@ def create_account_and_login( "logEnabled": True, "logLevel": "DEBUG", } + data = self._set_proxy_credentials(data) return self.api_valid_request(method, data) def restore_account_and_login( @@ -183,6 +200,7 @@ def restore_account_and_login( } ], } + data = self._set_proxy_credentials(data) return self.api_valid_request(method, data) def login(self, keyUid, user=user_1): @@ -192,6 +210,7 @@ def login(self, keyUid, user=user_1): "keyUid": keyUid, "kdfIterations": 256000, } + data = self._set_proxy_credentials(data) return self.api_valid_request(method, data) def logout(self, user=user_1):