From dd0c5047438eac5756daac06c0c964cb0de98cf9 Mon Sep 17 00:00:00 2001 From: vakarisz Date: Thu, 29 Sep 2022 11:52:57 +0300 Subject: [PATCH] UT: Add machines and node to report tests --- .../cc/services/reporting/test_report.py | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 monkey/tests/unit_tests/monkey_island/cc/services/reporting/test_report.py diff --git a/monkey/tests/unit_tests/monkey_island/cc/services/reporting/test_report.py b/monkey/tests/unit_tests/monkey_island/cc/services/reporting/test_report.py new file mode 100644 index 000000000..89930871c --- /dev/null +++ b/monkey/tests/unit_tests/monkey_island/cc/services/reporting/test_report.py @@ -0,0 +1,34 @@ +from ipaddress import IPv4Interface + +from monkey_island.cc.models import CommunicationType, Machine, Node + +ISLAND_MACHINE = Machine( + id=0, + island=True, + hardware_id=5, + network_interfaces=[IPv4Interface("10.10.10.99/24")], +) + +MACHINE_A = Machine( + id=1, + hardware_id=9, + network_interfaces=[IPv4Interface("10.10.10.1/24")], +) + +MACHINE_B = Machine( + id=2, + hardware_id=9, + network_interfaces=[IPv4Interface("10.10.10.2/24")], +) + +MACHINE_C = Machine( + id=3, + hardware_id=9, + network_interfaces=[IPv4Interface("10.10.10.3/24")], +) + +NODES = [ + Node(id=1, connections={"2", CommunicationType.EXPLOITED}), + Node(id=0, connections={"1", CommunicationType.SCANNED}), + Node(id=3, connections={"0", CommunicationType.CC}), +]