From 1cce7426921568590d942988397b3709afd8d296 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Mon, 21 Feb 2022 16:02:00 +0530 Subject: [PATCH] UT: Fix UTs as per changes to ExploiterResultData and ExploitTelem --- .../unit_tests/infection_monkey/master/test_propagator.py | 8 ++++---- .../infection_monkey/telemetry/test_exploit_telem.py | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/monkey/tests/unit_tests/infection_monkey/master/test_propagator.py b/monkey/tests/unit_tests/infection_monkey/master/test_propagator.py index f8decace8..06be41c71 100644 --- a/monkey/tests/unit_tests/infection_monkey/master/test_propagator.py +++ b/monkey/tests/unit_tests/infection_monkey/master/test_propagator.py @@ -254,14 +254,14 @@ def test_exploiter_result_processing( if ip.endswith(".1"): if data["exploiter"].startswith("PowerShell"): - assert data["result"] + assert data["propagation_result"] else: - assert not data["result"] + assert not data["propagation_result"] elif ip.endswith(".3"): if data["exploiter"].startswith("PowerShell"): - assert not data["result"] + assert not data["propagation_result"] else: - assert data["result"] + assert data["propagation_result"] def test_scan_target_generation(telemetry_messenger_spy, mock_ip_scanner, mock_victim_host_factory): diff --git a/monkey/tests/unit_tests/infection_monkey/telemetry/test_exploit_telem.py b/monkey/tests/unit_tests/infection_monkey/telemetry/test_exploit_telem.py index 982299947..0adf69651 100644 --- a/monkey/tests/unit_tests/infection_monkey/telemetry/test_exploit_telem.py +++ b/monkey/tests/unit_tests/infection_monkey/telemetry/test_exploit_telem.py @@ -34,13 +34,14 @@ RESULT = False @pytest.fixture def exploit_telem_test_instance(): - return ExploitTelem(EXPLOITER_NAME, HOST, RESULT, EXPLOITER_INFO, EXPLOITER_ATTEMPTS) + return ExploitTelem(EXPLOITER_NAME, HOST, RESULT, RESULT, EXPLOITER_INFO, EXPLOITER_ATTEMPTS) def test_exploit_telem_send(exploit_telem_test_instance, spy_send_telemetry): exploit_telem_test_instance.send() expected_data = { - "result": RESULT, + "exploitation_result": RESULT, + "propagation_result": RESULT, "machine": HOST_AS_DICT, "exploiter": EXPLOITER_NAME, "info": EXPLOITER_INFO,