forked from p34709852/monkey
1a784791fd | ||
---|---|---|
.. | ||
analyzers | ||
island_client | ||
island_configs | ||
log_handlers | ||
tests | ||
utils | ||
README.md | ||
__init__.py | ||
conftest.py | ||
pytest.ini | ||
requirements.txt | ||
test_blackbox.py |
README.md
Automatic blackbox tests
Prerequisites
- Download google sdk: https://cloud.google.com/sdk/docs/
- 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)
- 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
Run the following 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
.
Running telemetry performance test
To run telemetry performance test follow these steps:
- Gather monkey telemetries.
- Enable "Export monkey telemetries" in Configuration -> Internal -> Tests if you don't have exported telemetries already.
- Run monkey and wait until infection is done.
- All telemetries are gathered in
monkey/test_telems
- Run telemetry performance test.
- Move directory
monkey/test_telems
toenvs/monkey_zoo/blackbox/tests/performance/test_telems
- (Optional) Use
envs/monkey_zoo/blackbox/tests/performance/utils/telem_parser.py
to multiply telemetries gathered.- Run
telem_parser.py
scrip with working directory set tomonkey\envs\monkey_zoo\blackbox
- Pass integer to indicate the multiplier. For example running
telem_parser.py 4
will replicate telemetries 4 times. - If you're using pycharm check "Emulate terminal in output console" on debug/run configuraion.
- Run
- Run blackbox tests, telemetry performance test will run as part of it.
- Move directory