Implement goal_id, strategy_id and host_aggregate into Audit api

Modifying the api controller for audit objects to allow
creation of audit objects by specifying either an
audit_template uuid/id and/or a goal_id.

strategy_id is optional.

Partially Implements: blueprint persistent-audit-parameters
Change-Id: I7b3eae4d0752a11208f5f92ee13ab1018d8521ad
This commit is contained in:
Michael Gugino
2016-06-15 15:13:15 -04:00
parent 0769e53f93
commit 52ffc2c8e2
15 changed files with 296 additions and 379 deletions

View File

@@ -45,6 +45,8 @@ class TestCreateUpdateDeleteAudit(base.BaseInfraOptimTest):
)
_, body = self.create_audit(**audit_params)
audit_params.pop('audit_template_uuid')
audit_params['goal_uuid'] = goal['uuid']
self.assert_expected(audit_params, body)
_, audit = self.client.show_audit(body['uuid'])
@@ -62,6 +64,8 @@ class TestCreateUpdateDeleteAudit(base.BaseInfraOptimTest):
)
_, body = self.create_audit(**audit_params)
audit_params.pop('audit_template_uuid')
audit_params['goal_uuid'] = goal['uuid']
self.assert_expected(audit_params, body)
_, audit = self.client.show_audit(body['uuid'])
@@ -101,6 +105,8 @@ class TestCreateUpdateDeleteAudit(base.BaseInfraOptimTest):
)
_, body = self.create_audit(**audit_params)
audit_params.pop('audit_template_uuid')
audit_params['goal_uuid'] = goal['uuid']
self.assert_expected(audit_params, body)
_, audit = self.client.show_audit(body['uuid'])
@@ -190,5 +196,5 @@ class TestShowListAudit(base.BaseInfraOptimTest):
@test.attr(type='smoke')
def test_list_audits_related_to_given_audit_template(self):
_, body = self.client.list_audits(
audit_template=self.audit_template['uuid'])
goal=self.goal['uuid'])
self.assertIn(self.audit['uuid'], [n['uuid'] for n in body['audits']])