#2404 change software state from patching to fixing to align with CAOS v0.8

This commit is contained in:
Cristian-VM2
2024-03-26 16:41:11 +00:00
parent b3c1b6b7a5
commit 5860c74ef9
8 changed files with 28 additions and 28 deletions

View File

@@ -69,7 +69,7 @@ def test_node_service_fix_integration(game_and_agent: Tuple[PrimaiteGame, ProxyA
"""
Test that the NodeServiceFixAction can form a request and that it is accepted by the simulation.
When you initiate a patch action, the software health state turns to PATCHING, then after a few steps, it goes
When you initiate a patch action, the software health state turns to FIXING, then after a few steps, it goes
to GOOD.
"""
game, agent = game_and_agent
@@ -83,8 +83,8 @@ def test_node_service_fix_integration(game_and_agent: Tuple[PrimaiteGame, ProxyA
agent.store_action(action)
game.step()
# 3: Check that the service is now in the patching state
assert svc.health_state_actual == SoftwareHealthState.PATCHING
# 3: Check that the service is now in the FIXING state
assert svc.health_state_actual == SoftwareHealthState.FIXING
# 4: perform a few do-nothing steps and check that the service is now in the good state
action = ("DONOTHING", {})
@@ -413,7 +413,7 @@ def test_node_application_scan_integration(game_and_agent: Tuple[PrimaiteGame, P
def test_node_application_fix_integration(game_and_agent: Tuple[PrimaiteGame, ProxyAgent]):
"""Test that the NodeApplicationFixAction can form a request and that it is accepted by the simulation.
When you initiate a fix action, the software health state turns to PATCHING, then after a few steps, it goes
When you initiate a fix action, the software health state turns to FIXING, then after a few steps, it goes
to GOOD."""
game, agent = game_and_agent
@@ -428,8 +428,8 @@ def test_node_application_fix_integration(game_and_agent: Tuple[PrimaiteGame, Pr
agent.store_action(action)
game.step()
# 3: Check that the application is now in the patching state
assert browser.health_state_actual == SoftwareHealthState.PATCHING
# 3: Check that the application is now in the FIXING state
assert browser.health_state_actual == SoftwareHealthState.FIXING
# 4: perform a few do-nothing steps and check that the application is now in the good state
action = ("DONOTHING", {})

View File

@@ -47,4 +47,4 @@ def test_application_describe_states(application):
assert SoftwareHealthState.COMPROMISED.value == application.describe_state().get("health_state_actual")
application.fix()
assert SoftwareHealthState.PATCHING.value == application.describe_state().get("health_state_actual")
assert SoftwareHealthState.FIXING.value == application.describe_state().get("health_state_actual")

View File

@@ -86,8 +86,8 @@ def test_service_fix(service):
assert service.health_state_actual == SoftwareHealthState.GOOD
service.apply_request(["fix"])
assert service.health_state_actual == SoftwareHealthState.PATCHING
assert service.health_state_actual == SoftwareHealthState.FIXING
service.apply_timestep(1)
assert service.health_state_actual == SoftwareHealthState.PATCHING
assert service.health_state_actual == SoftwareHealthState.FIXING
service.apply_timestep(2)
assert service.health_state_actual == SoftwareHealthState.GOOD

View File

@@ -93,7 +93,7 @@ def test_restart_compromised(service):
"""
Service should be compromised even after reset.
Only way to remove compromised status is via patching.
Only way to remove compromised status is via FIXING.
"""
timestep = 0
@@ -143,7 +143,7 @@ def test_service_fixing(service):
service.set_health_state(SoftwareHealthState.COMPROMISED)
service.fix()
assert service.health_state_actual == SoftwareHealthState.PATCHING
assert service.health_state_actual == SoftwareHealthState.FIXING
for i in range(service.fixing_duration + 1):
service.apply_timestep(i)