Merge "Merge quota_classes functional tests of v2 and v2.1"

This commit is contained in:
Jenkins 2015-03-27 18:51:16 +00:00 committed by Gerrit Code Review
commit 9d20132a1d
8 changed files with 18 additions and 127 deletions

View File

@ -1,17 +0,0 @@
{
"quota_class_set": {
"cores": 20,
"fixed_ips": -1,
"floating_ips": 10,
"id": "test_class",
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"injected_files": 5,
"instances": 10,
"key_pairs": 100,
"metadata_items": 128,
"ram": 51200,
"security_group_rules": 20,
"security_groups": 10
}
}

View File

@ -1,15 +0,0 @@
{
"quota_class_set": {
"instances": 50,
"cores": 50,
"ram": 51200,
"floating_ips": 10,
"metadata_items": 128,
"injected_files": 5,
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"security_groups": 10,
"security_group_rules": 20,
"key_pairs": 100
}
}

View File

@ -1,16 +0,0 @@
{
"quota_class_set": {
"cores": 50,
"fixed_ips": -1,
"floating_ips": 10,
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"injected_files": 5,
"instances": 50,
"key_pairs": 100,
"metadata_items": 128,
"ram": 51200,
"security_group_rules": 20,
"security_groups": 10
}
}

View File

@ -1,17 +0,0 @@
{
"quota_class_set": {
"cores": 20,
"floating_ips": 10,
"fixed_ips": -1,
"id": "%(set_id)s",
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"injected_files": 5,
"instances": 10,
"key_pairs": 100,
"metadata_items": 128,
"ram": 51200,
"security_group_rules": 20,
"security_groups": 10
}
}

View File

@ -1,16 +0,0 @@
{
"quota_class_set": {
"instances": 50,
"cores": 50,
"ram": 51200,
"floating_ips": 10,
"fixed_ips": -1,
"metadata_items": 128,
"injected_files": 5,
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"security_groups": 10,
"security_group_rules": 20,
"key_pairs": 100
}
}

View File

@ -1,16 +0,0 @@
{
"quota_class_set": {
"cores": 50,
"floating_ips": 10,
"fixed_ips": -1,
"injected_file_content_bytes": 10240,
"injected_file_path_bytes": 255,
"injected_files": 5,
"instances": 50,
"key_pairs": 100,
"metadata_items": 128,
"ram": 51200,
"security_group_rules": 20,
"security_groups": 10
}
}

View File

@ -2256,28 +2256,6 @@ class NetworksAssociateJsonTests(ApiSampleTestBaseV2):
self.assertEqual(response.content, "")
class QuotaClassesSampleJsonTests(ApiSampleTestBaseV2):
ADMIN_API = True
extension_name = ("nova.api.openstack.compute.contrib.quota_classes."
"Quota_classes")
set_id = 'test_class'
def test_show_quota_classes(self):
# Get api sample to show quota classes.
response = self._do_get('os-quota-class-sets/%s' % self.set_id)
subs = {'set_id': self.set_id}
self._verify_response('quota-classes-show-get-resp', subs,
response, 200)
def test_update_quota_classes(self):
# Get api sample to update quota classes.
response = self._do_put('os-quota-class-sets/%s' % self.set_id,
'quota-classes-update-post-req',
{})
self._verify_response('quota-classes-update-post-resp',
{}, response, 200)
class FakeNode(object):
def __init__(self, uuid='058d27fa-241b-445a-a386-08c04f96db43'):
self.uuid = uuid
@ -3584,14 +3562,6 @@ class ServerGroupQuotas_QuotasSampleJsonTests(QuotasSampleJsonTests):
extends_name = "nova.api.openstack.compute.contrib.quotas.Quotas"
class ServerGroupQuotasQuota_ClassesSampleJsonTests(
QuotaClassesSampleJsonTests):
extension_name = ("nova.api.openstack.compute.contrib."
"server_group_quotas.Server_group_quotas")
extends_name = ("nova.api.openstack.compute.contrib.quota_classes."
"Quota_classes")
class ServerSortKeysJsonTests(ServersSampleBase):
extension_name = ("nova.api.openstack.compute.contrib.server_sort_keys"
".Server_sort_keys")

View File

@ -13,13 +13,31 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from nova.tests.functional.v3 import api_sample_base
CONF = cfg.CONF
CONF.import_opt('osapi_compute_extension',
'nova.api.openstack.compute.extensions')
class QuotaClassesSampleJsonTests(api_sample_base.ApiSampleTestBaseV3):
ADMIN_API = True
extension_name = "os-quota-class-sets"
set_id = 'test_class'
# TODO(Park): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(QuotaClassesSampleJsonTests, self)._get_flags()
f['osapi_compute_extension'] = CONF.osapi_compute_extension[:]
f['osapi_compute_extension'].append(
'nova.api.openstack.compute.contrib.quota_classes.'
'Quota_classes')
return f
def test_show_quota_classes(self):
# Get api sample to show quota classes.