diff --git a/monkey/monkey_island/cc/event_queue/i_island_event_queue.py b/monkey/monkey_island/cc/event_queue/i_island_event_queue.py index bf1fcf2cc..cf123c3e2 100644 --- a/monkey/monkey_island/cc/event_queue/i_island_event_queue.py +++ b/monkey/monkey_island/cc/event_queue/i_island_event_queue.py @@ -5,7 +5,7 @@ from . import IslandEventSubscriber class IslandEventTopic(Enum): - AGENT_CONNECTED = auto() + AGENT_REGISTERED = auto() CLEAR_SIMULATION_DATA = auto() RESET_AGENT_CONFIGURATION = auto() SET_ISLAND_MODE = auto() diff --git a/monkey/monkey_island/cc/setup/island_event_handlers.py b/monkey/monkey_island/cc/setup/island_event_handlers.py index fa036a8fe..6b4cb8c53 100644 --- a/monkey/monkey_island/cc/setup/island_event_handlers.py +++ b/monkey/monkey_island/cc/setup/island_event_handlers.py @@ -30,7 +30,7 @@ def setup_island_event_handlers(container: DIContainer): def _subscribe_agent_registration_events( island_event_queue: IIslandEventQueue, container: DIContainer ): - topic = IslandEventTopic.AGENT_CONNECTED + topic = IslandEventTopic.AGENT_REGISTERED island_event_queue.subscribe(topic, container.resolve(handle_agent_registration)) diff --git a/monkey/tests/unit_tests/monkey_island/cc/event_queue/test_pypubsub_island_event_queue.py b/monkey/tests/unit_tests/monkey_island/cc/event_queue/test_pypubsub_island_event_queue.py index 206009727..91af47fa0 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/event_queue/test_pypubsub_island_event_queue.py +++ b/monkey/tests/unit_tests/monkey_island/cc/event_queue/test_pypubsub_island_event_queue.py @@ -40,7 +40,7 @@ def test_subscribe_publish__no_event_body( topic=IslandEventTopic.CLEAR_SIMULATION_DATA, subscriber=event_queue_subscriber ) - event_queue.publish(topic=IslandEventTopic.AGENT_CONNECTED) + event_queue.publish(topic=IslandEventTopic.AGENT_REGISTERED) event_queue.publish(topic=IslandEventTopic.CLEAR_SIMULATION_DATA) event_queue.publish(topic=IslandEventTopic.RESET_AGENT_CONFIGURATION) @@ -64,9 +64,9 @@ def test_subscribe_publish__with_event_body( event = "my event!" my_callable = MyCallable() - event_queue.subscribe(topic=IslandEventTopic.AGENT_CONNECTED, subscriber=my_callable) + event_queue.subscribe(topic=IslandEventTopic.AGENT_REGISTERED, subscriber=my_callable) - event_queue.publish(topic=IslandEventTopic.AGENT_CONNECTED, event=event) + event_queue.publish(topic=IslandEventTopic.AGENT_REGISTERED, event=event) event_queue.publish(topic=IslandEventTopic.CLEAR_SIMULATION_DATA) event_queue.publish(topic=IslandEventTopic.RESET_AGENT_CONFIGURATION) @@ -84,10 +84,10 @@ def test_keep_subscriber_in_scope(event_queue: IIslandEventQueue): def subscribe(): # fn will go out of scope after subscribe() returns. fn = MyCallable() - event_queue.subscribe(topic=IslandEventTopic.AGENT_CONNECTED, subscriber=fn) + event_queue.subscribe(topic=IslandEventTopic.AGENT_REGISTERED, subscriber=fn) subscribe() - event_queue.publish(topic=IslandEventTopic.AGENT_CONNECTED) + event_queue.publish(topic=IslandEventTopic.AGENT_REGISTERED) assert MyCallable.called