#2769: initial commit of user account actions

This commit is contained in:
Czar Echavez
2024-07-24 16:38:06 +01:00
parent e67b4b54ce
commit 173f110fb2
5 changed files with 87 additions and 1 deletions

View File

@@ -458,6 +458,9 @@ def game_and_agent():
{"type": "HOST_NIC_DISABLE"},
{"type": "NETWORK_PORT_ENABLE"},
{"type": "NETWORK_PORT_DISABLE"},
{"type": "NODE_ACCOUNTS_CHANGEPASSWORD"},
{"type": "NODE_SESSIONS_REMOTE_LOGIN"},
{"type": "NODE_SESSIONS_REMOTE_LOGOUT"},
]
action_space = ActionManager(

View File

@@ -0,0 +1,38 @@
# © Crown-owned copyright 2024, Defence Science and Technology Laboratory UK
def test_remote_logon(game_and_agent):
"""Test that the remote session login action works."""
game, agent = game_and_agent
action = (
"NODE_SESSIONS_REMOTE_LOGIN",
{"node_id": 0},
)
agent.store_action(action)
game.step()
# TODO Assert that there is a logged in user
def test_remote_logoff(game_and_agent):
"""Test that the remote session logout action works."""
game, agent = game_and_agent
action = (
"NODE_SESSIONS_REMOTE_LOGIN",
{"node_id": 0},
)
agent.store_action(action)
game.step()
# TODO Assert that there is a logged in user
action = (
"NODE_SESSIONS_REMOTE_LOGOUT",
{"node_id": 0},
)
agent.store_action(action)
game.step()
# TODO Assert the user has logged out