Added suspended audit state
New audit state SUSPENDED is added in this patch set. If audit state with continuous mode is changed from ONGOING to SUSPENDED, audit's job is removed and the audit is not executed. If audit state changed from SUSPENDED to ONGOING in reverse, audit is executed again periodically. Change-Id: I32257f56a40c0352a7c24f3fb80ad95ec28dc614 Implements: blueprint suspended-audit-state
This commit is contained in:
@@ -27,9 +27,16 @@ class BaseInfraOptimTest(test.BaseTestCase):
|
||||
"""Base class for Infrastructure Optimization API tests."""
|
||||
|
||||
# States where the object is waiting for some event to perform a transition
|
||||
IDLE_STATES = ('RECOMMENDED', 'FAILED', 'SUCCEEDED', 'CANCELLED')
|
||||
IDLE_STATES = ('RECOMMENDED',
|
||||
'FAILED',
|
||||
'SUCCEEDED',
|
||||
'CANCELLED',
|
||||
'SUSPENDED')
|
||||
# States where the object can only be DELETED (end of its life-cycle)
|
||||
FINISHED_STATES = ('FAILED', 'SUCCEEDED', 'CANCELLED', 'SUPERSEDED')
|
||||
FINISHED_STATES = ('FAILED',
|
||||
'SUCCEEDED',
|
||||
'CANCELLED',
|
||||
'SUPERSEDED')
|
||||
|
||||
@classmethod
|
||||
def setup_credentials(cls):
|
||||
|
||||
@@ -29,7 +29,7 @@ class TestCreateUpdateDeleteAudit(base.BaseInfraOptimTest):
|
||||
"""Tests for audit."""
|
||||
|
||||
audit_states = ['ONGOING', 'SUCCEEDED', 'FAILED',
|
||||
'CANCELLED', 'DELETED', 'PENDING']
|
||||
'CANCELLED', 'DELETED', 'PENDING', 'SUSPENDED']
|
||||
|
||||
def assert_expected(self, expected, actual,
|
||||
keys=('created_at', 'updated_at',
|
||||
@@ -154,7 +154,7 @@ class TestShowListAudit(base.BaseInfraOptimTest):
|
||||
"""Tests for audit."""
|
||||
|
||||
audit_states = ['ONGOING', 'SUCCEEDED', 'FAILED',
|
||||
'CANCELLED', 'DELETED', 'PENDING']
|
||||
'CANCELLED', 'DELETED', 'PENDING', 'SUSPENDED']
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
|
||||
@@ -156,7 +156,7 @@ class TestExecuteBasicStrategy(base.BaseInfraOptimScenarioTest):
|
||||
self.fail("The audit has failed!")
|
||||
|
||||
_, finished_audit = self.client.show_audit(audit['uuid'])
|
||||
if finished_audit.get('state') in ('FAILED', 'CANCELLED'):
|
||||
if finished_audit.get('state') in ('FAILED', 'CANCELLED', 'SUSPENDED'):
|
||||
self.fail("The audit ended in unexpected state: %s!"
|
||||
% finished_audit.get('state'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user