#2887 - Resolve conflicts from merge
This commit is contained in:
@@ -32,11 +32,11 @@ def test_file_observation(simulation):
|
||||
assert dog_file_obs.space["health_status"] == spaces.Discrete(6)
|
||||
|
||||
observation_state = dog_file_obs.observe(simulation.describe_state())
|
||||
assert observation_state.get("health_status") == 1 # good initial
|
||||
assert observation_state.get("health_status") == 0 # initially unset
|
||||
|
||||
file.corrupt()
|
||||
observation_state = dog_file_obs.observe(simulation.describe_state())
|
||||
assert observation_state.get("health_status") == 1 # scan file so this changes
|
||||
assert observation_state.get("health_status") == 0 # still default unset value because no scan happened
|
||||
|
||||
file.scan()
|
||||
file.apply_timestep(0) # apply time step
|
||||
@@ -63,11 +63,11 @@ def test_folder_observation(simulation):
|
||||
|
||||
observation_state = root_folder_obs.observe(simulation.describe_state())
|
||||
assert observation_state.get("FILES") is not None
|
||||
assert observation_state.get("health_status") == 1
|
||||
assert observation_state.get("health_status") == 0 # initially unset
|
||||
|
||||
file.corrupt() # corrupt just the file
|
||||
observation_state = root_folder_obs.observe(simulation.describe_state())
|
||||
assert observation_state.get("health_status") == 1 # scan folder to change this
|
||||
assert observation_state.get("health_status") == 0 # still unset as no scan occurred yet
|
||||
|
||||
folder.scan()
|
||||
for i in range(folder.scan_duration + 1):
|
||||
|
||||
@@ -191,7 +191,7 @@ def test_nic_monitored_traffic(simulation):
|
||||
|
||||
# send a database query
|
||||
browser: WebBrowser = pc.software_manager.software.get("WebBrowser")
|
||||
browser.target_url = f"http://arcd.com/"
|
||||
browser.config.target_url = f"http://arcd.com/"
|
||||
browser.get_webpage()
|
||||
|
||||
traffic_obs = nic_obs.observe(simulation.describe_state()).get("TRAFFIC")
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user