nova/nova/tests/functional/api_sample_tests/test_disk_config.py
ghanshyam 30cfa1db47 Enable all extension for server actions sample tests
As extensions options has been deprecated, API sample tests
should run against all extension enable.

This commit enables all extensions for server actions tests and
remove its specific extensions tests and sample files.

Partially implements blueprint api-sample-tests-with-all-extensions

Change-Id: I88a293958c4c8a1b2c50a837c23bcdda8010e075
2016-06-09 11:13:19 +09:00

41 lines
1.5 KiB
Python

# Copyright 2012 Nebula, Inc.
# Copyright 2013 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 nova.tests.functional.api_sample_tests import test_servers
class DiskConfigJsonTest(test_servers.ServersSampleBase):
extension_name = 'os-disk-config'
extra_extensions_to_load = ["os-access-ips"]
def test_list_servers_detail(self):
uuid = self._post_server(use_common_server_api_samples=False)
response = self._do_get('servers/detail')
subs = {}
subs['hostid'] = '[a-f0-9]+'
subs['access_ip_v4'] = ''
subs['access_ip_v6'] = ''
subs['id'] = uuid
self._verify_response('list-servers-detail-get', subs, response, 200)
def test_get_server(self):
uuid = self._post_server(use_common_server_api_samples=False)
response = self._do_get('servers/%s' % uuid)
subs = {}
subs['hostid'] = '[a-f0-9]+'
subs['access_ip_v4'] = ''
subs['access_ip_v6'] = ''
self._verify_response('server-get-resp', subs, response, 200)