From 0ed61ec79ba3f1a5f604949caecca26dfc7f80df Mon Sep 17 00:00:00 2001 From: Charlie Crane Date: Tue, 30 Jul 2024 15:54:08 +0100 Subject: [PATCH] #2706 - Updates to terminal and host_node documentation, removal of redundant terminal unit test --- .../network/nodes/host_node.rst | 2 ++ .../system/services/terminal.rst | 1 + .../_system/_services/test_terminal.py | 19 ------------------- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/docs/source/simulation_components/network/nodes/host_node.rst b/docs/source/simulation_components/network/nodes/host_node.rst index 301cd783..b8aae098 100644 --- a/docs/source/simulation_components/network/nodes/host_node.rst +++ b/docs/source/simulation_components/network/nodes/host_node.rst @@ -49,3 +49,5 @@ fundamental network operations: 5. **NTP (Network Time Protocol) Client:** Synchronises the host's clock with network time servers. 6. **Web Browser:** A simulated application that allows the host to request and display web content. + +7. **Terminal:** A simulated service that allows the host to connect to remote hosts and execute commands. diff --git a/docs/source/simulation_components/system/services/terminal.rst b/docs/source/simulation_components/system/services/terminal.rst index 4d1285d1..4b02a6db 100644 --- a/docs/source/simulation_components/system/services/terminal.rst +++ b/docs/source/simulation_components/system/services/terminal.rst @@ -41,6 +41,7 @@ to provide User Credential authentication when receiving/processing commands. Terminal acts as the interface between the user/component and both the Session and Requests Managers, facilitating the passing of requests to both. +A more detailed example of how to use the Terminal class can be found in the Terminal-Processing jupyter notebook. Python """""" diff --git a/tests/unit_tests/_primaite/_simulator/_system/_services/test_terminal.py b/tests/unit_tests/_primaite/_simulator/_system/_services/test_terminal.py index 8ec20394..d4592228 100644 --- a/tests/unit_tests/_primaite/_simulator/_system/_services/test_terminal.py +++ b/tests/unit_tests/_primaite/_simulator/_system/_services/test_terminal.py @@ -278,22 +278,3 @@ def test_network_simulation(basic_network): terminal_1: Terminal = client_1.software_manager.software.get("Terminal") assert terminal_1.login(username="admin", password="Admin123!", ip_address="10.0.2.2") is False - - -def test_terminal_receives_requests(game_and_agent_fixture: Tuple[PrimaiteGame, ProxyAgent]): - game, agent = game_and_agent_fixture - - network: Network = game.simulation.network - computer_a: Computer = network.get_node_by_hostname("client_1") - terminal_a: Terminal = computer_a.software_manager.software.get("Terminal") - - computer_b: Computer = network.get_node_by_hostname("client_2") - - assert terminal_a.is_connected is False - - action = ("TERMINAL_LOGIN", {"username": "admin", "password": "Admin123!"}) - - agent.store_action(action) - game.step() - - assert terminal_a.is_connected is True