Merge "Remove unused SUBMITTED audit state"
This commit is contained in:
commit
01118b72c7
@ -61,7 +61,6 @@ from watcher.objects import fields as wfields
|
|||||||
class State(object):
|
class State(object):
|
||||||
ONGOING = 'ONGOING'
|
ONGOING = 'ONGOING'
|
||||||
SUCCEEDED = 'SUCCEEDED'
|
SUCCEEDED = 'SUCCEEDED'
|
||||||
SUBMITTED = 'SUBMITTED'
|
|
||||||
FAILED = 'FAILED'
|
FAILED = 'FAILED'
|
||||||
CANCELLED = 'CANCELLED'
|
CANCELLED = 'CANCELLED'
|
||||||
DELETED = 'DELETED'
|
DELETED = 'DELETED'
|
||||||
|
@ -444,7 +444,7 @@ class TestPatch(api_base.FunctionalTest):
|
|||||||
def test_patch_not_allowed(self, mock_utcnow):
|
def test_patch_not_allowed(self, mock_utcnow):
|
||||||
test_time = datetime.datetime(2000, 1, 1, 0, 0)
|
test_time = datetime.datetime(2000, 1, 1, 0, 0)
|
||||||
mock_utcnow.return_value = test_time
|
mock_utcnow.return_value = test_time
|
||||||
new_state = objects.audit.State.SUBMITTED
|
new_state = objects.audit.State.SUCCEEDED
|
||||||
response = self.get_json('/actions/%s' % self.action.uuid)
|
response = self.get_json('/actions/%s' % self.action.uuid)
|
||||||
self.assertNotEqual(new_state, response['state'])
|
self.assertNotEqual(new_state, response['state'])
|
||||||
|
|
||||||
|
@ -697,7 +697,7 @@ class TestAuditTemplatePolicyEnforcement(api_base.FunctionalTest):
|
|||||||
self._common_policy_check(
|
self._common_policy_check(
|
||||||
"audit_template:update", self.patch_json,
|
"audit_template:update", self.patch_json,
|
||||||
'/audit_templates/%s' % audit_template.uuid,
|
'/audit_templates/%s' % audit_template.uuid,
|
||||||
[{'path': '/state', 'value': objects.audit.State.SUBMITTED,
|
[{'path': '/state', 'value': objects.audit.State.SUCCEEDED,
|
||||||
'op': 'replace'}], expect_errors=True)
|
'op': 'replace'}], expect_errors=True)
|
||||||
|
|
||||||
def test_policy_disallow_create(self):
|
def test_policy_disallow_create(self):
|
||||||
|
@ -267,7 +267,7 @@ class TestPatch(api_base.FunctionalTest):
|
|||||||
test_time = datetime.datetime(2000, 1, 1, 0, 0)
|
test_time = datetime.datetime(2000, 1, 1, 0, 0)
|
||||||
mock_utcnow.return_value = test_time
|
mock_utcnow.return_value = test_time
|
||||||
|
|
||||||
new_state = objects.audit.State.SUBMITTED
|
new_state = objects.audit.State.SUCCEEDED
|
||||||
response = self.get_json('/audits/%s' % self.audit.uuid)
|
response = self.get_json('/audits/%s' % self.audit.uuid)
|
||||||
self.assertNotEqual(new_state, response['state'])
|
self.assertNotEqual(new_state, response['state'])
|
||||||
|
|
||||||
@ -287,7 +287,7 @@ class TestPatch(api_base.FunctionalTest):
|
|||||||
def test_replace_non_existent_audit(self):
|
def test_replace_non_existent_audit(self):
|
||||||
response = self.patch_json(
|
response = self.patch_json(
|
||||||
'/audits/%s' % utils.generate_uuid(),
|
'/audits/%s' % utils.generate_uuid(),
|
||||||
[{'path': '/state', 'value': objects.audit.State.SUBMITTED,
|
[{'path': '/state', 'value': objects.audit.State.SUCCEEDED,
|
||||||
'op': 'replace'}], expect_errors=True)
|
'op': 'replace'}], expect_errors=True)
|
||||||
self.assertEqual(404, response.status_int)
|
self.assertEqual(404, response.status_int)
|
||||||
self.assertEqual('application/json', response.content_type)
|
self.assertEqual('application/json', response.content_type)
|
||||||
@ -722,7 +722,7 @@ class TestAuditPolicyEnforcement(api_base.FunctionalTest):
|
|||||||
self._common_policy_check(
|
self._common_policy_check(
|
||||||
"audit:update", self.patch_json,
|
"audit:update", self.patch_json,
|
||||||
'/audits/%s' % audit.uuid,
|
'/audits/%s' % audit.uuid,
|
||||||
[{'path': '/state', 'value': objects.audit.State.SUBMITTED,
|
[{'path': '/state', 'value': objects.audit.State.SUCCEEDED,
|
||||||
'op': 'replace'}], expect_errors=True)
|
'op': 'replace'}], expect_errors=True)
|
||||||
|
|
||||||
def test_policy_disallow_create(self):
|
def test_policy_disallow_create(self):
|
||||||
|
@ -27,7 +27,7 @@ from watcher_tempest_plugin.tests.api.admin import base
|
|||||||
class TestCreateUpdateDeleteAudit(base.BaseInfraOptimTest):
|
class TestCreateUpdateDeleteAudit(base.BaseInfraOptimTest):
|
||||||
"""Tests for audit."""
|
"""Tests for audit."""
|
||||||
|
|
||||||
audit_states = ['ONGOING', 'SUCCEEDED', 'SUBMITTED', 'FAILED',
|
audit_states = ['ONGOING', 'SUCCEEDED', 'FAILED',
|
||||||
'CANCELLED', 'DELETED', 'PENDING']
|
'CANCELLED', 'DELETED', 'PENDING']
|
||||||
|
|
||||||
def assert_expected(self, expected, actual,
|
def assert_expected(self, expected, actual,
|
||||||
@ -152,7 +152,7 @@ class TestCreateUpdateDeleteAudit(base.BaseInfraOptimTest):
|
|||||||
class TestShowListAudit(base.BaseInfraOptimTest):
|
class TestShowListAudit(base.BaseInfraOptimTest):
|
||||||
"""Tests for audit."""
|
"""Tests for audit."""
|
||||||
|
|
||||||
audit_states = ['ONGOING', 'SUCCEEDED', 'SUBMITTED', 'FAILED',
|
audit_states = ['ONGOING', 'SUCCEEDED', 'FAILED',
|
||||||
'CANCELLED', 'DELETED', 'PENDING']
|
'CANCELLED', 'DELETED', 'PENDING']
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user