forked from p34709852/monkey
Just some more skeleton code
This commit is contained in:
parent
c611903baf
commit
0f5f01c4b1
|
@ -0,0 +1,2 @@
|
|||
ISLAND_SERVER_ADDRESS = "1.2.3.4"
|
||||
ISLAND_SERVER_URL_FORMAT = "https://{IP}/{resource}".format(IP=ISLAND_SERVER_ADDRESS)
|
|
@ -0,0 +1 @@
|
|||
THIS IS AN EXAMPLE FILE.
|
|
@ -1,6 +1,9 @@
|
|||
import pytest
|
||||
import unittest
|
||||
|
||||
import requests
|
||||
|
||||
from config import *
|
||||
|
||||
|
||||
class TestMonkeyBlackbox(unittest.TestCase):
|
||||
@classmethod
|
||||
|
@ -11,5 +14,15 @@ class TestMonkeyBlackbox(unittest.TestCase):
|
|||
def tearDownClass(cls):
|
||||
print("Killing all GCP machines...")
|
||||
|
||||
def test_1_plus_1(self):
|
||||
assert 1 + 1 == 2
|
||||
def generic_blackbox_test_case(self, config_file_path, analyzers):
|
||||
self.load_config_into_server(config_file_path)
|
||||
self.run_local_monkey_on_island()
|
||||
for analyzer in analyzers:
|
||||
assert analyzer.analyze_test_results()
|
||||
|
||||
def load_config_into_server(self, config_file_path):
|
||||
print("uploading {} to {}".format(config_file_path, ISLAND_SERVER_ADDRESS))
|
||||
|
||||
def run_local_monkey_on_island(self):
|
||||
print("Trying to run local monkey on {}".format(ISLAND_SERVER_ADDRESS))
|
||||
print(requests.get(ISLAND_SERVER_URL_FORMAT.format(resource="api"), verify=False).text)
|
||||
|
|
Loading…
Reference in New Issue