Files
deb-tempest/tempest/api/compute/test_networks.py
ghanshyam f0f7cfcbae Return complete response from compute networks_client
Currently compute networks_client returns Response by
removing top key from Response.
For example-
 return service_client.ResponseBody(resp, body['network'])

As service clients are in direction to move to Tempest-lib, all
service clients should return Response without any truncation.
One good example is Resource pagination links which are lost with current
way of return value. Resource pagination links are present in parallel
(not inside) to top key of Response.

This patch makes compute networks_client to return complete
Response body.

Change-Id: I953c9daf10e8b0d07f6999fd4a61330222c1d2e5
Implements: blueprint method-return-value-and-move-service-clients-to-lib
2015-08-24 19:10:00 +09:00

38 lines
1.3 KiB
Python

# Copyright 2014 IBM Corp.
#
# 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.
from tempest.api.compute import base
from tempest import config
from tempest import test
CONF = config.CONF
class NetworksTestJSON(base.BaseV2ComputeTest):
@classmethod
def skip_checks(cls):
super(NetworksTestJSON, cls).skip_checks()
if CONF.service_available.neutron:
raise cls.skipException('nova-network is not available.')
@classmethod
def setup_clients(cls):
super(NetworksTestJSON, cls).setup_clients()
cls.client = cls.os.networks_client
@test.idempotent_id('3fe07175-312e-49a5-a623-5f52eeada4c2')
def test_list_networks(self):
networks = self.client.list_networks()['networks']
self.assertNotEmpty(networks, "No networks found.")