From 06d3c70c3e528048f04e177d9df968030caea284 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Fri, 22 Jan 2021 17:24:00 +0200 Subject: [PATCH] PTH map got removed because it wasn't working. No point in testing code which we know doesn't work of feature we don't use --- .../cc/services/reporting/test_pth_report.py | 59 ------------------- 1 file changed, 59 deletions(-) delete mode 100644 monkey/monkey_island/cc/services/reporting/test_pth_report.py diff --git a/monkey/monkey_island/cc/services/reporting/test_pth_report.py b/monkey/monkey_island/cc/services/reporting/test_pth_report.py deleted file mode 100644 index e5fc9aa9a..000000000 --- a/monkey/monkey_island/cc/services/reporting/test_pth_report.py +++ /dev/null @@ -1,59 +0,0 @@ -import uuid - -from monkey_island.cc.models import Monkey -from monkey_island.cc.services.reporting.pth_report import PTHReportService - - -class TestPTHReportServiceGenerateMapNodes(): - def test_generate_map_nodes(self): - assert PTHReportService.generate_map_nodes() == [] - - windows_monkey_with_services = Monkey( - guid=str(uuid.uuid4()), - hostname="A_Windows_PC_1", - critical_services=["aCriticalService", "Domain Controller"], - ip_addresses=["1.1.1.1", "2.2.2.2"], - description="windows 10" - ) - windows_monkey_with_services.save() - - windows_monkey_with_no_services = Monkey( - guid=str(uuid.uuid4()), - hostname="A_Windows_PC_2", - critical_services=[], - ip_addresses=["3.3.3.3"], - description="windows 10" - ) - windows_monkey_with_no_services.save() - - linux_monkey = Monkey( - guid=str(uuid.uuid4()), - hostname="A_Linux_PC", - ip_addresses=["4.4.4.4"], - description="linux ubuntu" - ) - linux_monkey.save() - - map_nodes = PTHReportService.generate_map_nodes() - - assert 2 == len(map_nodes) - - def test_generate_map_nodes_parsing(self): - monkey_id = str(uuid.uuid4()) - hostname = "A_Windows_PC_1" - windows_monkey_with_services = Monkey( - guid=monkey_id, - hostname=hostname, - critical_services=["aCriticalService", "Domain Controller"], - ip_addresses=["1.1.1.1"], - description="windows 10" - ) - windows_monkey_with_services.save() - - map_nodes = PTHReportService.generate_map_nodes() - - assert map_nodes[0]["id"] == monkey_id - assert map_nodes[0]["label"] == "A_Windows_PC_1 : 1.1.1.1" - assert map_nodes[0]["group"] == "critical" - assert len(map_nodes[0]["services"]) == 2 - assert map_nodes[0]["hostname"] == hostname