From 452028f221034722bedb635d3afc80e3dae13f0b Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 22 Jun 2022 09:27:47 -0700 Subject: [PATCH] UT: Replace Hadoop with MSSQL in test data Previously, in the UT data, Hadoop had only windows in the "supported_os" field in the config. Now that that field is stripped out from the config, the supported OSes are picked up from the main code (from `SUPPORTED_OS` in the master's `Exploiter` class) which has both winodws and linux for Hadoop. This caused the tests to fail. This commit changes the UT data to include the MSSQL exploiter (windows only) instead of the Hadoop exploiter. The tests pass now. --- .../unit_tests/infection_monkey/master/test_exploiter.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/monkey/tests/unit_tests/infection_monkey/master/test_exploiter.py b/monkey/tests/unit_tests/infection_monkey/master/test_exploiter.py index 42b64821f..f48dc74d4 100644 --- a/monkey/tests/unit_tests/infection_monkey/master/test_exploiter.py +++ b/monkey/tests/unit_tests/infection_monkey/master/test_exploiter.py @@ -38,7 +38,7 @@ def exploiter_config(): return { "options": {"dropper_path_linux": "/tmp/monkey"}, "brute_force": [ - {"name": "HadoopExploiter", "options": {"timeout": 10}}, + {"name": "MSSQLExploiter", "options": {"timeout": 10}}, {"name": "SSHExploiter", "options": {}}, {"name": "WmiExploiter", "options": {"timeout": 10}}, ], @@ -105,11 +105,11 @@ def test_exploiter(callback, hosts, hosts_to_exploit, run_exploiters): host_exploit_combos = get_host_exploit_combos_from_call_args_list(callback.call_args_list) assert ("ZerologonExploiter", hosts[0]) in host_exploit_combos - assert ("HadoopExploiter", hosts[0]) in host_exploit_combos + assert ("MSSQLExploiter", hosts[0]) in host_exploit_combos assert ("SSHExploiter", hosts[0]) in host_exploit_combos assert ("WmiExploiter", hosts[0]) in host_exploit_combos assert ("ZerologonExploiter", hosts[1]) in host_exploit_combos - assert ("HadoopExploiter", hosts[1]) in host_exploit_combos + assert ("MSSQLExploiter", hosts[1]) in host_exploit_combos assert ("WmiExploiter", hosts[1]) in host_exploit_combos assert ("SSHExploiter", hosts[1]) in host_exploit_combos @@ -196,6 +196,6 @@ def test_all_exploiters_run_on_unknown_host(callback, hosts, hosts_to_exploit, r host_exploit_combos = get_host_exploit_combos_from_call_args_list(callback.call_args_list) assert ("ZerologonExploiter", hosts[0]) in host_exploit_combos - assert ("HadoopExploiter", hosts[0]) in host_exploit_combos + assert ("MSSQLExploiter", hosts[0]) in host_exploit_combos assert ("SSHExploiter", host) in host_exploit_combos assert ("WmiExploiter", hosts[0]) in host_exploit_combos