forked from p15670423/monkey
BB: Rename IslandConfigParser -> TestConfigurationParser
Even though the names start with "test", they shouldn't cause any issues since we only run "test_blackbox.py".
This commit is contained in:
parent
2764069aec
commit
379ada7a24
|
@ -3,7 +3,7 @@ from typing import Iterable
|
|||
from envs.monkey_zoo.blackbox.test_configurations.test_configuration import TestConfiguration
|
||||
|
||||
|
||||
class IslandConfigParser:
|
||||
class TestConfigurationParser:
|
||||
@staticmethod
|
||||
def get_target_ips(test_configuration: TestConfiguration) -> Iterable[str]:
|
||||
return test_configuration.agent_configuration.propagation.network_scan.targets.subnets
|
|
@ -7,8 +7,8 @@ import pytest
|
|||
from envs.monkey_zoo.blackbox.analyzers.communication_analyzer import CommunicationAnalyzer
|
||||
from envs.monkey_zoo.blackbox.analyzers.zerologon_analyzer import ZerologonAnalyzer
|
||||
from envs.monkey_zoo.blackbox.gcp_test_machine_list import GCP_TEST_MACHINE_LIST
|
||||
from envs.monkey_zoo.blackbox.island_client.island_config_parser import IslandConfigParser
|
||||
from envs.monkey_zoo.blackbox.island_client.monkey_island_client import MonkeyIslandClient
|
||||
from envs.monkey_zoo.blackbox.island_client.test_configuration_parser import TestConfigurationParser
|
||||
from envs.monkey_zoo.blackbox.log_handlers.test_logs_handler import TestLogsHandler
|
||||
from envs.monkey_zoo.blackbox.test_configurations import (
|
||||
depth_1_a_test_configuration,
|
||||
|
@ -91,7 +91,7 @@ class TestMonkeyBlackbox:
|
|||
):
|
||||
analyzer = CommunicationAnalyzer(
|
||||
island_client,
|
||||
IslandConfigParser.get_target_ips(test_configuration),
|
||||
TestConfigurationParser.get_target_ips(test_configuration),
|
||||
)
|
||||
log_handler = TestLogsHandler(
|
||||
test_name, island_client, TestMonkeyBlackbox.get_log_dir_path()
|
||||
|
@ -146,7 +146,7 @@ class TestMonkeyBlackbox:
|
|||
zero_logon_analyzer = ZerologonAnalyzer(island_client, expected_creds)
|
||||
communication_analyzer = CommunicationAnalyzer(
|
||||
island_client,
|
||||
IslandConfigParser.get_target_ips(zerologon_test_configuration),
|
||||
TestConfigurationParser.get_target_ips(zerologon_test_configuration),
|
||||
)
|
||||
log_handler = TestLogsHandler(
|
||||
test_name, island_client, TestMonkeyBlackbox.get_log_dir_path()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import logging
|
||||
from time import sleep
|
||||
|
||||
from envs.monkey_zoo.blackbox.island_client.island_config_parser import IslandConfigParser
|
||||
from envs.monkey_zoo.blackbox.island_client.test_configuration_parser import TestConfigurationParser
|
||||
from envs.monkey_zoo.blackbox.tests.basic_test import BasicTest
|
||||
from envs.monkey_zoo.blackbox.utils.test_timer import TestTimer
|
||||
|
||||
|
@ -36,7 +36,7 @@ class ExploitationTest(BasicTest):
|
|||
|
||||
def print_test_starting_info(self):
|
||||
LOGGER.info("Started {} test".format(self.name))
|
||||
machine_list = ", ".join(IslandConfigParser.get_target_ips(self.test_configuration))
|
||||
machine_list = ", ".join(TestConfigurationParser.get_target_ips(self.test_configuration))
|
||||
LOGGER.info(f"Machines participating in test: {machine_list}")
|
||||
print("")
|
||||
|
||||
|
|
Loading…
Reference in New Issue