Merge "Verify delete agent response of V2/V3 APIs"

This commit is contained in:
Jenkins 2014-04-17 14:21:37 +00:00 committed by Gerrit Code Review
commit e69c862116
4 changed files with 42 additions and 2 deletions

View File

@ -0,0 +1,17 @@
# Copyright 2014 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
delete_agent = {
'status_code': [200]
}

View File

@ -0,0 +1,17 @@
# Copyright 2014 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
delete_agent = {
'status_code': [204]
}

View File

@ -15,6 +15,7 @@
import json
import urllib
from tempest.api_schema.compute.v2 import agents as schema
from tempest.common import rest_client
from tempest import config
@ -46,7 +47,9 @@ class AgentsClientJSON(rest_client.RestClient):
def delete_agent(self, agent_id):
"""Delete an existing agent build."""
return self.delete('os-agents/%s' % str(agent_id))
resp, body = self.delete("os-agents/%s" % str(agent_id))
self.validate_response(schema.delete_agent, resp, body)
return resp, body
def update_agent(self, agent_id, **kwargs):
"""Update an agent build."""

View File

@ -15,6 +15,7 @@
import json
import urllib
from tempest.api_schema.compute.v3 import agents as schema
from tempest.common import rest_client
from tempest import config
@ -43,7 +44,9 @@ class AgentsV3ClientJSON(rest_client.RestClient):
def delete_agent(self, agent_id):
"""Delete an existing agent build."""
return self.delete('os-agents/%s' % str(agent_id))
resp, body = self.delete("os-agents/%s" % str(agent_id))
self.validate_response(schema.delete_agent, resp, body)
return resp, body
def update_agent(self, agent_id, **kwargs):
"""Update an agent build."""