monkey/envs/monkey_zoo/blackbox
Mike Salvatore 6ae7676322 BB: Pass generator instead of list comprehension to all()
This will allow a short-circuit.
2022-10-04 16:30:13 -04:00
..
analyzers BB: Refactor agent communication check 2022-10-03 14:28:22 -04:00
island_client BB: Pass generator instead of list comprehension to all() 2022-10-04 16:30:13 -04:00
log_handlers BB: Add error message when machine is missing interfaces 2022-10-03 10:14:48 -04:00
test_configurations BB: Remove 46 from depth 3 test suite as it's reserved for credential reuse 2022-09-27 17:06:39 +03:00
tests BB: Reset Island after finished test 2022-07-26 16:29:21 +02:00
utils BB: Remove config_generation_script.py 2022-07-22 17:24:53 +00:00
README.md BB, Island: Remove BB performance tests and *everything* related to it 2022-07-22 17:24:53 +00:00
__init__.py Basic skeleton for blackbox script 2019-08-27 15:52:39 +03:00
conftest.py BB: Delete "skip_powershell_reuse" mark 2022-09-27 17:28:12 +03:00
gcp_test_machine_list.py BB: Remove 46 from depth 3 test suite as it's reserved for credential reuse 2022-09-27 17:06:39 +03:00
pytest.ini Added module + filename + line number to logs output in Blackbox 2019-10-07 13:49:13 +03:00
start_all_gcp_machines.py Zoo: Remove GCPHandler class. Powershell-3-47 renamed to 2021-08-24 15:11:22 +02:00
stop_all_gcp_machines.py Zoo: Remove GCPHandler class. Powershell-3-47 renamed to 2021-08-24 15:11:22 +02:00
test_blackbox.py BB: Change powershell credential reuse test to a dedicated machine 2022-09-27 17:06:39 +03:00

README.md

Automatic blackbox tests

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). 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

In order to execute the entire test suite, you must know the external IP of the Island machine on GCP. You can find this information in the GCP Console Compute Engine/VM Instances under External IP.

Running in command line

Either run pytest from /monkey directory or set PYTHONPATH environment variable to /monkey directory so that blackbox tests can import other monkey code. Blackbox tests have following parameters:

  • --island=IP Sets island's IP
  • --no-gcp (Optional) Use for no interaction with the cloud (local test).

Example run command:

monkey\monkey>python -m pytest -s --island=35.207.152.72:5000 ..\envs\monkey_zoo\blackbox\test_blackbox.py

Running in PyCharm

Configure a PyTest configuration with the additional arguments -s --island=35.207.152.72:5000, and to run from directory monkey\envs\monkey_zoo\blackbox.