#2869 - More YAML/test fixes to address failures

This commit is contained in:
Charlie Crane
2024-12-17 12:47:54 +00:00
parent 3b1b74fb3a
commit 770896200b
7 changed files with 16 additions and 12 deletions

View File

@@ -60,6 +60,9 @@ agents:
start_step: 5
frequency: 4
variance: 3
action_probabilities:
0: 0.4
1: 0.6
simulation:
network:

View File

@@ -85,6 +85,9 @@ agents:
start_step: 5
frequency: 4
variance: 3
action_probabilities:
0: 0.4
1: 0.6
simulation:

View File

@@ -92,6 +92,9 @@ agents:
reward_function:
reward_components:
- type: DUMMY
agent_settings:
flatten_obs: True
action_masking: False
simulation:
network:

View File

@@ -49,7 +49,7 @@ def test_application_install_uninstall_on_uc2():
cfg = yaml.safe_load(f)
env = PrimaiteGymEnv(env_config=cfg)
env.agent.flatten_obs = False
env.agent.config.flatten_obs = False
env.reset()
_, _, _, _, _ = env.step(0)

View File

@@ -13,7 +13,7 @@ DATA_MANIPULATION_CONFIG = TEST_ASSETS_ROOT / "configs" / "data_manipulation.yam
def env_with_ssh() -> PrimaiteGymEnv:
"""Build data manipulation environment with SSH port open on router."""
env = PrimaiteGymEnv(DATA_MANIPULATION_CONFIG)
env.agent.flatten_obs = False
env.agent.config.agent_settings.flatten_obs = False
router: Router = env.game.simulation.network.get_node_by_hostname("router_1")
router.acl.add_rule(ACLAction.PERMIT, src_port=PORT_LOOKUP["SSH"], dst_port=PORT_LOOKUP["SSH"], position=3)
return env