#2404 rename software patch to fix

This commit is contained in:
Cristian-VM2
2024-03-26 10:51:33 +00:00
parent 600dc3f016
commit 944b248300
22 changed files with 64 additions and 66 deletions

View File

@@ -46,5 +46,5 @@ def test_application_describe_states(application):
application.set_health_state(SoftwareHealthState.COMPROMISED)
assert SoftwareHealthState.COMPROMISED.value == application.describe_state().get("health_state_actual")
application.patch()
application.fix()
assert SoftwareHealthState.PATCHING.value == application.describe_state().get("health_state_actual")

View File

@@ -99,8 +99,6 @@ def test_query_when_client_is_closed(database_client_on_computer):
assert database_client.query(sql="test") is False
def test_query_fail_to_connect(database_client_on_computer):
"""Database client query should return False if the connect attempt fails."""
database_client, computer = database_client_on_computer

View File

@@ -80,12 +80,12 @@ def test_service_enable(service):
assert service.operating_state == ServiceOperatingState.STOPPED
def test_service_patch(service):
"""Test that a service can be patched and that it takes two timesteps to complete."""
def test_service_fix(service):
"""Test that a service can be fixed and that it takes two timesteps to complete."""
service.start()
assert service.health_state_actual == SoftwareHealthState.GOOD
service.apply_request(["patch"])
service.apply_request(["fix"])
assert service.health_state_actual == SoftwareHealthState.PATCHING
service.apply_timestep(1)
assert service.health_state_actual == SoftwareHealthState.PATCHING

View File

@@ -136,16 +136,16 @@ def test_compromised_service_remains_compromised(service):
assert service.health_state_actual == SoftwareHealthState.COMPROMISED
def test_service_patching(service):
def test_service_fixing(service):
service.start()
assert service.health_state_actual == SoftwareHealthState.GOOD
service.set_health_state(SoftwareHealthState.COMPROMISED)
service.patch()
service.fix()
assert service.health_state_actual == SoftwareHealthState.PATCHING
for i in range(service.patching_duration + 1):
for i in range(service.fixing_duration + 1):
service.apply_timestep(i)
assert service.health_state_actual == SoftwareHealthState.GOOD