From 16e8443134fd77f500e57f80c541717c4839168d Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Wed, 6 Jul 2022 15:45:13 +0200 Subject: [PATCH] Island: Add TODO to return default config in reporting Notes in services for not fixing the failing tests until we remove the ConfigService --- monkey/monkey_island/cc/services/reporting/report.py | 1 + monkey/tests/unit_tests/monkey_island/cc/services/conftest.py | 4 +++- .../cc/services/telemetry/processing/credentials/conftest.py | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/monkey/monkey_island/cc/services/reporting/report.py b/monkey/monkey_island/cc/services/reporting/report.py index de696cda3..60d2d33ed 100644 --- a/monkey/monkey_island/cc/services/reporting/report.py +++ b/monkey/monkey_island/cc/services/reporting/report.py @@ -392,6 +392,7 @@ class ReportService: @staticmethod def get_config_exploits(): exploits_config_value = EXPLOITER_CLASSES_PATH + # TODO: Return default config here default_exploits = ConfigService.get_default_config(False) for namespace in exploits_config_value: default_exploits = default_exploits[namespace] diff --git a/monkey/tests/unit_tests/monkey_island/cc/services/conftest.py b/monkey/tests/unit_tests/monkey_island/cc/services/conftest.py index aaf3c0abe..10e5d9377 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/services/conftest.py +++ b/monkey/tests/unit_tests/monkey_island/cc/services/conftest.py @@ -15,7 +15,9 @@ def PORT(): @pytest.fixture def config(monkeypatch): - config = ConfigService.get_default_config(True) + # Note: ConfigService is going away, don't try to fix the UT using + # this fixture + config = ConfigService.get_config(True) return config diff --git a/monkey/tests/unit_tests/monkey_island/cc/services/telemetry/processing/credentials/conftest.py b/monkey/tests/unit_tests/monkey_island/cc/services/telemetry/processing/credentials/conftest.py index 0088995f3..e34d232ff 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/services/telemetry/processing/credentials/conftest.py +++ b/monkey/tests/unit_tests/monkey_island/cc/services/telemetry/processing/credentials/conftest.py @@ -14,7 +14,9 @@ fake_ip_address = "192.168.56.1" def fake_mongo(monkeypatch, uses_encryptor): mongo = mongoengine.connection.get_connection() monkeypatch.setattr("monkey_island.cc.services.config.mongo", mongo) - config = ConfigService.get_default_config() + # Note: ConfigService is going away, don't try to fix UT using + # this fixture + config = ConfigService.get_config() ConfigService.update_config(config, should_encrypt=True)