Merge "Fix H404/405 violations for api tests(3/3)"

This commit is contained in:
Jenkins 2015-11-20 00:19:44 +00:00 committed by Gerrit Code Review
commit dc8015a6e7
25 changed files with 34 additions and 82 deletions

View File

@ -23,9 +23,7 @@ LOG = log.getLogger(__name__)
class AgentsAdminTestJSON(base.BaseV2ComputeAdminTest): class AgentsAdminTestJSON(base.BaseV2ComputeAdminTest):
""" """Tests Agents API"""
Tests Agents API
"""
@classmethod @classmethod
def setup_clients(cls): def setup_clients(cls):

View File

@ -22,10 +22,7 @@ from tempest import test
class AggregatesAdminTestJSON(base.BaseV2ComputeAdminTest): class AggregatesAdminTestJSON(base.BaseV2ComputeAdminTest):
"""Tests Aggregates API that require admin privileges"""
"""
Tests Aggregates API that require admin privileges
"""
_host_key = 'OS-EXT-SRV-ATTR:host' _host_key = 'OS-EXT-SRV-ATTR:host'

View File

@ -22,10 +22,7 @@ from tempest import test
class AggregatesAdminNegativeTestJSON(base.BaseV2ComputeAdminTest): class AggregatesAdminNegativeTestJSON(base.BaseV2ComputeAdminTest):
"""Tests Aggregates API that require admin privileges"""
"""
Tests Aggregates API that require admin privileges
"""
@classmethod @classmethod
def setup_clients(cls): def setup_clients(cls):

View File

@ -18,9 +18,7 @@ from tempest import test
class AZAdminV2TestJSON(base.BaseV2ComputeAdminTest): class AZAdminV2TestJSON(base.BaseV2ComputeAdminTest):
""" """Tests Availability Zone API List"""
Tests Availability Zone API List
"""
@classmethod @classmethod
def setup_clients(cls): def setup_clients(cls):

View File

@ -19,10 +19,7 @@ from tempest import test
class AZAdminNegativeTestJSON(base.BaseV2ComputeAdminTest): class AZAdminNegativeTestJSON(base.BaseV2ComputeAdminTest):
"""Tests Availability Zone API List"""
"""
Tests Availability Zone API List
"""
@classmethod @classmethod
def setup_clients(cls): def setup_clients(cls):

View File

@ -23,10 +23,7 @@ from tempest import test
class FlavorsAdminTestJSON(base.BaseV2ComputeAdminTest): class FlavorsAdminTestJSON(base.BaseV2ComputeAdminTest):
"""Tests Flavors API Create and Delete that require admin privileges"""
"""
Tests Flavors API Create and Delete that require admin privileges
"""
@classmethod @classmethod
def skip_checks(cls): def skip_checks(cls):

View File

@ -19,9 +19,8 @@ from tempest import test
class FlavorsAccessTestJSON(base.BaseV2ComputeAdminTest): class FlavorsAccessTestJSON(base.BaseV2ComputeAdminTest):
"""Tests Flavor Access API extension.
"""
Tests Flavor Access API extension.
Add and remove Flavor Access require admin privileges. Add and remove Flavor Access require admin privileges.
""" """

View File

@ -23,9 +23,8 @@ from tempest import test
class FlavorsAccessNegativeTestJSON(base.BaseV2ComputeAdminTest): class FlavorsAccessNegativeTestJSON(base.BaseV2ComputeAdminTest):
"""Tests Flavor Access API extension.
"""
Tests Flavor Access API extension.
Add and remove Flavor Access require admin privileges. Add and remove Flavor Access require admin privileges.
""" """

View File

@ -19,9 +19,8 @@ from tempest import test
class FlavorsExtraSpecsTestJSON(base.BaseV2ComputeAdminTest): class FlavorsExtraSpecsTestJSON(base.BaseV2ComputeAdminTest):
"""Tests Flavor Extra Spec API extension.
"""
Tests Flavor Extra Spec API extension.
SET, UNSET, UPDATE Flavor Extra specs require admin privileges. SET, UNSET, UPDATE Flavor Extra specs require admin privileges.
GET Flavor Extra specs can be performed even by without admin privileges. GET Flavor Extra specs can be performed even by without admin privileges.
""" """

View File

@ -22,9 +22,8 @@ from tempest import test
class FlavorsExtraSpecsNegativeTestJSON(base.BaseV2ComputeAdminTest): class FlavorsExtraSpecsNegativeTestJSON(base.BaseV2ComputeAdminTest):
"""Negative Tests Flavor Extra Spec API extension.
"""
Negative Tests Flavor Extra Spec API extension.
SET, UNSET, UPDATE Flavor Extra specs require admin privileges. SET, UNSET, UPDATE Flavor Extra specs require admin privileges.
""" """

View File

@ -24,9 +24,8 @@ CONF = config.CONF
class FloatingIPsBulkAdminTestJSON(base.BaseV2ComputeAdminTest): class FloatingIPsBulkAdminTestJSON(base.BaseV2ComputeAdminTest):
""" """Tests Floating IPs Bulk APIs that require admin privileges.
Tests Floating IPs Bulk APIs Create, List and Delete that
require admin privileges.
API documentation - http://docs.openstack.org/api/openstack-compute/2/ API documentation - http://docs.openstack.org/api/openstack-compute/2/
content/ext-os-floating-ips-bulk.html content/ext-os-floating-ips-bulk.html
""" """

View File

@ -18,10 +18,7 @@ from tempest import test
class HostsAdminTestJSON(base.BaseV2ComputeAdminTest): class HostsAdminTestJSON(base.BaseV2ComputeAdminTest):
"""Tests hosts API using admin privileges."""
"""
Tests hosts API using admin privileges.
"""
@classmethod @classmethod
def setup_clients(cls): def setup_clients(cls):

View File

@ -20,10 +20,7 @@ from tempest import test
class HostsAdminNegativeTestJSON(base.BaseV2ComputeAdminTest): class HostsAdminNegativeTestJSON(base.BaseV2ComputeAdminTest):
"""Tests hosts API using admin privileges."""
"""
Tests hosts API using admin privileges.
"""
@classmethod @classmethod
def setup_clients(cls): def setup_clients(cls):

View File

@ -18,10 +18,7 @@ from tempest import test
class HypervisorAdminTestJSON(base.BaseV2ComputeAdminTest): class HypervisorAdminTestJSON(base.BaseV2ComputeAdminTest):
"""Tests Hypervisors API that require admin privileges"""
"""
Tests Hypervisors API that require admin privileges
"""
@classmethod @classmethod
def setup_clients(cls): def setup_clients(cls):

View File

@ -23,10 +23,7 @@ from tempest import test
class HypervisorAdminNegativeTestJSON(base.BaseV2ComputeAdminTest): class HypervisorAdminNegativeTestJSON(base.BaseV2ComputeAdminTest):
"""Tests Hypervisors API that require admin privileges"""
"""
Tests Hypervisors API that require admin privileges
"""
@classmethod @classmethod
def setup_clients(cls): def setup_clients(cls):

View File

@ -21,9 +21,8 @@ CONF = config.CONF
class NetworksTest(base.BaseV2ComputeAdminTest): class NetworksTest(base.BaseV2ComputeAdminTest):
"""Tests Nova Networks API that usually requires admin privileges.
"""
Tests Nova Networks API that usually requires admin privileges.
API docs: API docs:
http://developer.openstack.org/api-ref-compute-v2-ext.html#ext-os-networks http://developer.openstack.org/api-ref-compute-v2-ext.html#ext-os-networks
""" """

View File

@ -151,8 +151,7 @@ class QuotasAdminTestJSON(base.BaseV2ComputeAdminTest):
class QuotaClassesAdminTestJSON(base.BaseV2ComputeAdminTest): class QuotaClassesAdminTestJSON(base.BaseV2ComputeAdminTest):
"""Tests the os-quota-class-sets API to update default quotas. """Tests the os-quota-class-sets API to update default quotas."""
"""
def setUp(self): def setUp(self):
# All test cases in this class need to externally lock on doing # All test cases in this class need to externally lock on doing

View File

@ -28,10 +28,7 @@ CONF = config.CONF
class ServersAdminNegativeTestJSON(base.BaseV2ComputeAdminTest): class ServersAdminNegativeTestJSON(base.BaseV2ComputeAdminTest):
"""Tests Servers API using admin privileges"""
"""
Tests Servers API using admin privileges
"""
@classmethod @classmethod
def setup_clients(cls): def setup_clients(cls):

View File

@ -19,10 +19,7 @@ from tempest import test
class ServicesAdminTestJSON(base.BaseV2ComputeAdminTest): class ServicesAdminTestJSON(base.BaseV2ComputeAdminTest):
"""Tests Services API. List and Enable/Disable require admin privileges."""
"""
Tests Services API. List and Enable/Disable require admin privileges.
"""
@classmethod @classmethod
def setup_clients(cls): def setup_clients(cls):

View File

@ -138,6 +138,7 @@ class BaseV2ComputeTest(tempest.test.BaseTestCase):
@classmethod @classmethod
def server_check_teardown(cls): def server_check_teardown(cls):
"""Checks is the shared server clean enough for subsequent test. """Checks is the shared server clean enough for subsequent test.
Method will delete the server when it's dirty. Method will delete the server when it's dirty.
The setUp method is responsible for creating a new server. The setUp method is responsible for creating a new server.
Exceptions raised in tearDown class are fails the test case, Exceptions raised in tearDown class are fails the test case,

View File

@ -18,9 +18,7 @@ from tempest import test
class AZV2TestJSON(base.BaseV2ComputeTest): class AZV2TestJSON(base.BaseV2ComputeTest):
""" """Tests Availability Zone API List"""
Tests Availability Zone API List
"""
@classmethod @classmethod
def setup_clients(cls): def setup_clients(cls):

View File

@ -25,10 +25,9 @@ class MultipleCreateTestJSON(base.BaseV2ComputeTest):
return data_utils.rand_name(self._name) return data_utils.rand_name(self._name)
def _create_multiple_servers(self, name=None, wait_until=None, **kwargs): def _create_multiple_servers(self, name=None, wait_until=None, **kwargs):
""" # NOTE: This is the right way to create_multiple servers and manage to
This is the right way to create_multiple servers and manage to get the # get the created servers into the servers list to be cleaned up after
created servers into the servers list to be cleaned up after all. # all.
"""
kwargs['name'] = name if name else self._generate_name() kwargs['name'] = name if name else self._generate_name()
if wait_until: if wait_until:
kwargs['wait_until'] = wait_until kwargs['wait_until'] = wait_until

View File

@ -27,10 +27,8 @@ class MultipleCreateNegativeTestJSON(base.BaseV2ComputeTest):
return data_utils.rand_name(self._name) return data_utils.rand_name(self._name)
def _create_multiple_servers(self, name=None, wait_until=None, **kwargs): def _create_multiple_servers(self, name=None, wait_until=None, **kwargs):
""" # This is the right way to create_multiple servers and manage to get
This is the right way to create_multiple servers and manage to get the # the created servers into the servers list to be cleaned up after all.
created servers into the servers list to be cleaned up after all.
"""
kwargs['name'] = kwargs.get('name', self._generate_name()) kwargs['name'] = kwargs.get('name', self._generate_name())
body = self.create_test_server(**kwargs) body = self.create_test_server(**kwargs)

View File

@ -21,8 +21,8 @@ from tempest import test
class ServerGroupTestJSON(base.BaseV2ComputeTest): class ServerGroupTestJSON(base.BaseV2ComputeTest):
""" """These tests check for the server-group APIs
These tests check for the server-group APIs
They create/delete server-groups with different policies. They create/delete server-groups with different policies.
policies = affinity/anti-affinity policies = affinity/anti-affinity
It also adds the tests for list and get details of server-groups It also adds the tests for list and get details of server-groups

View File

@ -23,14 +23,11 @@ CONF = config.CONF
class VolumesTestJSON(base.BaseV2ComputeTest): class VolumesTestJSON(base.BaseV2ComputeTest):
# NOTE: This test creates a number of 1G volumes. To run successfully,
""" # ensure that the backing file for the volume group that Nova uses
This test creates a number of 1G volumes. To run successfully, # has space for at least 3 1G volumes!
ensure that the backing file for the volume group that Nova uses # If you are running a Devstack environment, ensure that the
has space for at least 3 1G volumes! # VOLUME_BACKING_FILE_SIZE is atleast 4G in your localrc
If you are running a Devstack environment, ensure that the
VOLUME_BACKING_FILE_SIZE is atleast 4G in your localrc
"""
@classmethod @classmethod
def skip_checks(cls): def skip_checks(cls):