Merge "Verify hypervisor uptime attributes of Nova API"
This commit is contained in:
commit
00c7ecb1ac
@ -12,6 +12,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import copy
|
||||
|
||||
hypervisor_statistics = {
|
||||
'status_code': [200],
|
||||
'response_body': {
|
||||
@ -186,3 +188,10 @@ common_hypervisors_info = {
|
||||
'required': ['hypervisor']
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
hypervisor_uptime = copy.deepcopy(common_hypervisors_info)
|
||||
hypervisor_uptime['response_body']['properties']['hypervisor'][
|
||||
'properties']['uptime'] = {'type': 'string'}
|
||||
hypervisor_uptime['response_body']['properties']['hypervisor'][
|
||||
'required'] = ['id', 'hypervisor_hostname', 'uptime']
|
||||
|
@ -71,6 +71,7 @@ class HypervisorClientJSON(rest_client.RestClient):
|
||||
"""Display the uptime of the specified hypervisor."""
|
||||
resp, body = self.get('os-hypervisors/%s/uptime' % hyper_id)
|
||||
body = json.loads(body)
|
||||
self.validate_response(common_schema.hypervisor_uptime, resp, body)
|
||||
return resp, body['hypervisor']
|
||||
|
||||
def search_hypervisor(self, hyper_name):
|
||||
|
@ -69,6 +69,7 @@ class HypervisorV3ClientJSON(rest_client.RestClient):
|
||||
"""Display the uptime of the specified hypervisor."""
|
||||
resp, body = self.get('os-hypervisors/%s/uptime' % hyper_id)
|
||||
body = json.loads(body)
|
||||
self.validate_response(common_schema.hypervisor_uptime, resp, body)
|
||||
return resp, body['hypervisor']
|
||||
|
||||
def search_hypervisor(self, hyper_name):
|
||||
|
Loading…
Reference in New Issue
Block a user