From d9ed06d7652750637eb8db22e54e1f02ec885b64 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Thu, 30 Jul 2020 12:41:25 +0300 Subject: [PATCH] BB quickfixes: fixed island client authentication bug ("JWT" -> "bearer" in auth header), improved readme a bit. --- envs/monkey_zoo/blackbox/README.md | 7 ++++--- .../blackbox/island_client/monkey_island_requests.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/envs/monkey_zoo/blackbox/README.md b/envs/monkey_zoo/blackbox/README.md index fa4fdc02a..30855b855 100644 --- a/envs/monkey_zoo/blackbox/README.md +++ b/envs/monkey_zoo/blackbox/README.md @@ -2,7 +2,8 @@ ### Prerequisites 1. Download google sdk: https://cloud.google.com/sdk/docs/ 2. Download service account key for MonkeyZoo project (if you deployed MonkeyZoo via terraform scripts then you already have it). -GCP console -> IAM -> service accounts(you can use the same key used to authenticate terraform scripts) +GCP console -> IAM -> service accounts(you can use the same key used to authenticate terraform scripts). +Place the key in `envs/monkey_zoo/gcp_keys/gcp_key.json`. 3. Deploy the relevant branch + complied executables to the Island machine on GCP. ### Running the tests @@ -21,8 +22,8 @@ Example run command: `monkey\envs\monkey_zoo\blackbox>python -m pytest -s --island=35.207.152.72:5000 test_blackbox.py` #### Running in PyCharm -Configure a PyTest configuration with the additional arguments `-s --island=35.207.152.72` on the -`monkey\envs\monkey_zoo\blackbox`. +Configure a PyTest configuration with the additional arguments `-s --island=35.207.152.72`, and to run from +directory `monkey\envs\monkey_zoo\blackbox`. ### Running telemetry performance test diff --git a/envs/monkey_zoo/blackbox/island_client/monkey_island_requests.py b/envs/monkey_zoo/blackbox/island_client/monkey_island_requests.py index 743cb4146..7e2418d6f 100644 --- a/envs/monkey_zoo/blackbox/island_client/monkey_island_requests.py +++ b/envs/monkey_zoo/blackbox/island_client/monkey_island_requests.py @@ -104,4 +104,4 @@ class MonkeyIslandRequests(object): @_Decorators.refresh_jwt_token def get_jwt_header(self): - return {"Authorization": "JWT " + self.token} + return {"Authorization": "Bearer " + self.token}