Merge "Adding description for testcases - compute part2"
diff --git a/tempest/api/compute/admin/test_flavors.py b/tempest/api/compute/admin/test_flavors.py
index 1483c2e..f42f53a 100644
--- a/tempest/api/compute/admin/test_flavors.py
+++ b/tempest/api/compute/admin/test_flavors.py
@@ -46,6 +46,7 @@
 
     @decorators.idempotent_id('8b4330e1-12c4-4554-9390-e6639971f086')
     def test_create_flavor_with_int_id(self):
+        """Test creating flavor with id of type integer"""
         flavor_id = data_utils.rand_int_id(start=1000)
         new_flavor_id = self.create_flavor(ram=self.ram,
                                            vcpus=self.vcpus,
@@ -55,6 +56,7 @@
 
     @decorators.idempotent_id('94c9bb4e-2c2a-4f3c-bb1f-5f0daf918e6d')
     def test_create_flavor_with_uuid_id(self):
+        """Test creating flavor with id of type uuid"""
         flavor_id = data_utils.rand_uuid()
         new_flavor_id = self.create_flavor(ram=self.ram,
                                            vcpus=self.vcpus,
@@ -64,8 +66,11 @@
 
     @decorators.idempotent_id('f83fe669-6758-448a-a85e-32d351f36fe0')
     def test_create_flavor_with_none_id(self):
-        # If nova receives a request with None as flavor_id,
-        # nova generates flavor_id of uuid.
+        """Test creating flavor without id specified
+
+        If nova receives a request with None as flavor_id,
+        nova generates flavor_id of uuid.
+        """
         flavor_id = None
         new_flavor_id = self.create_flavor(ram=self.ram,
                                            vcpus=self.vcpus,
@@ -75,8 +80,10 @@
 
     @decorators.idempotent_id('8261d7b0-be58-43ec-a2e5-300573c3f6c5')
     def test_create_flavor_verify_entry_in_list_details(self):
-        # Create a flavor and ensure it's details are listed
-        # This operation requires the user to have 'admin' role
+        """Create a flavor and ensure its details are listed
+
+        This operation requires the user to have 'admin' role
+        """
         flavor_name = data_utils.rand_name(self.flavor_name_prefix)
 
         # Create the flavor
@@ -94,9 +101,10 @@
 
     @decorators.idempotent_id('63dc64e6-2e79-4fdf-868f-85500d308d66')
     def test_create_list_flavor_without_extra_data(self):
-        # Create a flavor and ensure it is listed
-        # This operation requires the user to have 'admin' role
+        """Create a flavor and ensure it is listed
 
+        This operation requires the user to have 'admin' role
+        """
         def verify_flavor_response_extension(flavor):
             # check some extensions for the flavor create/show/detail response
             self.assertEqual(flavor['swap'], '')
@@ -134,10 +142,12 @@
 
     @decorators.idempotent_id('be6cc18c-7c5d-48c0-ac16-17eaf03c54eb')
     def test_list_non_public_flavor(self):
-        # Create a flavor with os-flavor-access:is_public false.
-        # The flavor should not be present in list_details as the
-        # tenant is not automatically added access list.
-        # This operation requires the user to have 'admin' role
+        """Create a flavor with os-flavor-access:is_public false.
+
+        The flavor should not be present in list_details as the
+        tenant is not automatically added access list.
+        This operation requires the user to have 'admin' role
+        """
         flavor_name = data_utils.rand_name(self.flavor_name_prefix)
 
         # Create the flavor
@@ -156,7 +166,7 @@
 
     @decorators.idempotent_id('bcc418ef-799b-47cc-baa1-ce01368b8987')
     def test_create_server_with_non_public_flavor(self):
-        # Create a flavor with os-flavor-access:is_public false
+        """Create a flavor with os-flavor-access:is_public false"""
         flavor = self.create_flavor(ram=self.ram, vcpus=self.vcpus,
                                     disk=self.disk,
                                     is_public="False")
@@ -169,8 +179,10 @@
 
     @decorators.idempotent_id('b345b196-bfbd-4231-8ac1-6d7fe15ff3a3')
     def test_list_public_flavor_with_other_user(self):
-        # Create a Flavor with public access.
-        # Try to List/Get flavor with another user
+        """Create a Flavor with public access.
+
+        Try to List/Get flavor with another user
+        """
         flavor_name = data_utils.rand_name(self.flavor_name_prefix)
 
         # Create the flavor
@@ -184,6 +196,7 @@
 
     @decorators.idempotent_id('fb9cbde6-3a0e-41f2-a983-bdb0a823c44e')
     def test_is_public_string_variations(self):
+        """Test creating public and non public flavors"""
         flavor_name_not_public = data_utils.rand_name(self.flavor_name_prefix)
         flavor_name_public = data_utils.rand_name(self.flavor_name_prefix)
 
@@ -215,6 +228,7 @@
 
     @decorators.idempotent_id('3b541a2e-2ac2-4b42-8b8d-ba6e22fcd4da')
     def test_create_flavor_using_string_ram(self):
+        """Test creating flavor with ram of type string"""
         new_flavor_id = data_utils.rand_int_id(start=1000)
 
         ram = "1024"
diff --git a/tempest/api/compute/admin/test_flavors_extra_specs.py b/tempest/api/compute/admin/test_flavors_extra_specs.py
index 789965e..4c531b3 100644
--- a/tempest/api/compute/admin/test_flavors_extra_specs.py
+++ b/tempest/api/compute/admin/test_flavors_extra_specs.py
@@ -61,8 +61,11 @@
 
     @decorators.idempotent_id('0b2f9d4b-1ca2-4b99-bb40-165d4bb94208')
     def test_flavor_set_get_update_show_unset_keys(self):
-        # Test to SET, GET, UPDATE, SHOW, UNSET flavor extra
-        # spec as a user with admin privileges.
+        """Test flavor extra spec operations by admin user
+
+        Test to SET, GET, UPDATE, SHOW, UNSET flavor extra
+        spec as a user with admin privileges.
+        """
         # Assigning extra specs values that are to be set
         specs = {'hw:numa_nodes': '1', 'hw:cpu_policy': 'shared'}
         # SET extra specs to the flavor created in setUp
@@ -100,6 +103,7 @@
 
     @decorators.idempotent_id('a99dad88-ae1c-4fba-aeb4-32f898218bd0')
     def test_flavor_non_admin_get_all_keys(self):
+        """Test non admin user getting all flavor extra spec keys"""
         specs = {'hw:numa_nodes': '1', 'hw:cpu_policy': 'shared'}
         self.admin_flavors_client.set_flavor_extra_spec(self.flavor['id'],
                                                         **specs)
@@ -111,6 +115,7 @@
 
     @decorators.idempotent_id('12805a7f-39a3-4042-b989-701d5cad9c90')
     def test_flavor_non_admin_get_specific_key(self):
+        """Test non admin user getting specific flavor extra spec key"""
         specs = {'hw:numa_nodes': '1', 'hw:cpu_policy': 'shared'}
         body = self.admin_flavors_client.set_flavor_extra_spec(
             self.flavor['id'], **specs
diff --git a/tempest/api/compute/admin/test_flavors_extra_specs_negative.py b/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
index 9f89293..721acca 100644
--- a/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
+++ b/tempest/api/compute/admin/test_flavors_extra_specs_negative.py
@@ -64,7 +64,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('a00a3b81-5641-45a8-ab2b-4a8ec41e1d7d')
     def test_flavor_non_admin_set_keys(self):
-        # Test to SET flavor extra spec as a user without admin privileges.
+        """Test to SET flavor extra spec as a user without admin privileges"""
         self.assertRaises(lib_exc.Forbidden,
                           self.flavors_client.set_flavor_extra_spec,
                           self.flavor['id'],
@@ -73,7 +73,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('1ebf4ef8-759e-48fe-a801-d451d80476fb')
     def test_flavor_non_admin_update_specific_key(self):
-        # non admin user is not allowed to update flavor extra spec
+        """non admin user is not allowed to update flavor extra spec"""
         body = self.admin_flavors_client.set_flavor_extra_spec(
             self.flavor['id'],
             **{'hw:numa_nodes': '1', 'hw:cpu_policy': 'shared'}
@@ -89,6 +89,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('28f12249-27c7-44c1-8810-1f382f316b11')
     def test_flavor_non_admin_unset_keys(self):
+        """non admin user is not allowed to unset flavor extra spec"""
         self.admin_flavors_client.set_flavor_extra_spec(
             self.flavor['id'],
             **{'hw:numa_nodes': '1', 'hw:cpu_policy': 'shared'}
@@ -102,6 +103,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('440b9f3f-3c7f-4293-a106-0ceda350f8de')
     def test_flavor_unset_nonexistent_key(self):
+        """Unsetting non existence flavor extra spec key should fail"""
         self.assertRaises(lib_exc.NotFound,
                           self.admin_flavors_client.unset_flavor_extra_spec,
                           self.flavor['id'],
@@ -110,6 +112,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('329a7be3-54b2-48be-8052-bf2ce4afd898')
     def test_flavor_get_nonexistent_key(self):
+        """Getting non existence flavor extra spec key should fail"""
         self.assertRaises(lib_exc.NotFound,
                           self.flavors_client.show_flavor_extra_spec,
                           self.flavor['id'],
@@ -118,7 +121,10 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('25b822b8-9f49-44f6-80de-d99f0482e5cb')
     def test_flavor_update_mismatch_key(self):
-        # the key will be updated should be match the key in the body
+        """Updating unmatched flavor extra spec key should fail
+
+        The key to be updated should match the key in the body
+        """
         self.assertRaises(lib_exc.BadRequest,
                           self.admin_flavors_client.update_flavor_extra_spec,
                           self.flavor['id'],
@@ -128,7 +134,10 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('f5889590-bf66-41cc-b4b1-6e6370cfd93f')
     def test_flavor_update_more_key(self):
-        # there should be just one item in the request body
+        """Updating multiple flavor spec keys should fail
+
+        There should be just one item in the request body
+        """
         self.assertRaises(lib_exc.BadRequest,
                           self.admin_flavors_client.update_flavor_extra_spec,
                           self.flavor['id'],
diff --git a/tempest/api/compute/admin/test_live_migration.py b/tempest/api/compute/admin/test_live_migration.py
index 836b975..a845c72 100644
--- a/tempest/api/compute/admin/test_live_migration.py
+++ b/tempest/api/compute/admin/test_live_migration.py
@@ -30,6 +30,7 @@
 
 
 class LiveMigrationTestBase(base.BaseV2ComputeAdminTest):
+    """Test live migration operations supported by admin user"""
 
     # These tests don't attempt any SSH validation nor do they use
     # floating IPs on the instance, so all we need is a network and
@@ -123,12 +124,14 @@
 
     @decorators.idempotent_id('1dce86b8-eb04-4c03-a9d8-9c1dc3ee0c7b')
     def test_live_block_migration(self):
+        """Test live migrating an active server"""
         self._test_live_migration()
 
     @decorators.idempotent_id('1e107f21-61b2-4988-8f22-b196e938ab88')
     @testtools.skipUnless(CONF.compute_feature_enabled.pause,
                           'Pause is not available.')
     def test_live_block_migration_paused(self):
+        """Test live migrating a paused server"""
         self._test_live_migration(state='PAUSED')
 
     @testtools.skipUnless(CONF.compute_feature_enabled.
@@ -137,6 +140,7 @@
     @decorators.idempotent_id('5071cf17-3004-4257-ae61-73a84e28badd')
     @utils.services('volume')
     def test_volume_backed_live_migration(self):
+        """Test live migrating an active server booted from volume"""
         self._test_live_migration(volume_backed=True)
 
     @decorators.idempotent_id('e19c0cc6-6720-4ed8-be83-b6603ed5c812')
@@ -148,6 +152,7 @@
                       'Block Live migration not configured for iSCSI')
     @utils.services('volume')
     def test_iscsi_volume(self):
+        """Test live migrating a server with volume attached"""
         server = self.create_test_server(wait_until="ACTIVE")
         server_id = server['id']
         target_host = self.get_host_other_than(server_id)
diff --git a/tempest/api/compute/admin/test_migrations.py b/tempest/api/compute/admin/test_migrations.py
index 83f2e61..37f5aec 100644
--- a/tempest/api/compute/admin/test_migrations.py
+++ b/tempest/api/compute/admin/test_migrations.py
@@ -25,6 +25,7 @@
 
 
 class MigrationsAdminTest(base.BaseV2ComputeAdminTest):
+    """Test migration operations supported by admin user"""
 
     @classmethod
     def setup_clients(cls):
@@ -33,14 +34,14 @@
 
     @decorators.idempotent_id('75c0b83d-72a0-4cf8-a153-631e83e7d53f')
     def test_list_migrations(self):
-        # Admin can get the migrations list
+        """Test admin user can get the migrations list"""
         self.client.list_migrations()
 
     @decorators.idempotent_id('1b512062-8093-438e-b47a-37d2f597cd64')
     @testtools.skipUnless(CONF.compute_feature_enabled.resize,
                           'Resize not available.')
     def test_list_migrations_in_flavor_resize_situation(self):
-        # Admin can get the migrations list which contains the resized server
+        """Admin can get the migrations list containing the resized server"""
         server = self.create_test_server(wait_until="ACTIVE")
         server_id = server['id']
 
@@ -62,8 +63,11 @@
     @testtools.skipUnless(CONF.compute_feature_enabled.resize,
                           'Resize not available.')
     def test_resize_server_revert_deleted_flavor(self):
-        # Tests that we can revert the resize on an instance whose original
-        # flavor has been deleted.
+        """Test reverting resized server with original flavor deleted
+
+        Tests that we can revert the resize on an instance whose original
+        flavor has been deleted.
+        """
 
         # First we have to create a flavor that we can delete so make a copy
         # of the normal flavor from which we'd create a server.
@@ -137,10 +141,12 @@
     @testtools.skipUnless(CONF.compute_feature_enabled.cold_migration,
                           'Cold migration not available.')
     def test_cold_migration(self):
+        """Test cold migrating server and then confirm the migration"""
         self._test_cold_migrate_server(revert=False)
 
     @decorators.idempotent_id('caa1aa8b-f4ef-4374-be0d-95f001c2ac2d')
     @testtools.skipUnless(CONF.compute_feature_enabled.cold_migration,
                           'Cold migration not available.')
     def test_revert_cold_migration(self):
+        """Test cold migrating server and then revert the migration"""
         self._test_cold_migrate_server(revert=True)
diff --git a/tempest/api/compute/admin/test_networks.py b/tempest/api/compute/admin/test_networks.py
index 33b23b5..fb6376e 100644
--- a/tempest/api/compute/admin/test_networks.py
+++ b/tempest/api/compute/admin/test_networks.py
@@ -35,6 +35,7 @@
 
     @decorators.idempotent_id('d206d211-8912-486f-86e2-a9d090d1f416')
     def test_get_network(self):
+        """Test getting network from nova side"""
         networks = self.client.list_networks()['networks']
         if CONF.compute.fixed_network_name:
             configured_network = [x for x in networks if x['label'] ==
@@ -56,6 +57,7 @@
 
     @decorators.idempotent_id('df3d1046-6fa5-4b2c-ad0c-cfa46a351cb9')
     def test_list_all_networks(self):
+        """Test getting all networks from nova side"""
         networks = self.client.list_networks()['networks']
         # Check the configured network is in the list
         if CONF.compute.fixed_network_name:
diff --git a/tempest/api/compute/admin/test_servers_on_multinodes.py b/tempest/api/compute/admin/test_servers_on_multinodes.py
index bebc8c5..f440428 100644
--- a/tempest/api/compute/admin/test_servers_on_multinodes.py
+++ b/tempest/api/compute/admin/test_servers_on_multinodes.py
@@ -23,7 +23,7 @@
 
 
 class ServersOnMultiNodesTest(base.BaseV2ComputeAdminTest):
-
+    """Test creating servers on mutiple nodes with scheduler_hints."""
     @classmethod
     def resource_setup(cls):
         super(ServersOnMultiNodesTest, cls).resource_setup()
@@ -65,6 +65,7 @@
         compute.is_scheduler_filter_enabled("SameHostFilter"),
         'SameHostFilter is not available.')
     def test_create_servers_on_same_host(self):
+        """Test creating servers with hints 'same_host'"""
         hints = {'same_host': self.server01}
         server02 = self.create_test_server(scheduler_hints=hints,
                                            wait_until='ACTIVE')['id']
@@ -76,6 +77,7 @@
         compute.is_scheduler_filter_enabled("DifferentHostFilter"),
         'DifferentHostFilter is not available.')
     def test_create_servers_on_different_hosts(self):
+        """Test creating servers with hints of single 'different_host'"""
         hints = {'different_host': self.server01}
         server02 = self.create_test_server(scheduler_hints=hints,
                                            wait_until='ACTIVE')['id']
@@ -87,7 +89,7 @@
         compute.is_scheduler_filter_enabled("DifferentHostFilter"),
         'DifferentHostFilter is not available.')
     def test_create_servers_on_different_hosts_with_list_of_servers(self):
-        # This scheduler-hint supports list of servers also.
+        """Test creating servers with hints of a list of 'different_host'"""
         hints = {'different_host': [self.server01]}
         server02 = self.create_test_server(scheduler_hints=hints,
                                            wait_until='ACTIVE')['id']
diff --git a/tempest/api/compute/admin/test_services_negative.py b/tempest/api/compute/admin/test_services_negative.py
index d264829..033caa8 100644
--- a/tempest/api/compute/admin/test_services_negative.py
+++ b/tempest/api/compute/admin/test_services_negative.py
@@ -31,14 +31,18 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('1126d1f8-266e-485f-a687-adc547492646')
     def test_list_services_with_non_admin_user(self):
+        """Non admin user is not allowed to list nova services"""
         self.assertRaises(lib_exc.Forbidden,
                           self.non_admin_client.list_services)
 
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('d0884a69-f693-4e79-a9af-232d15643bf7')
     def test_get_service_by_invalid_params(self):
-        # Expect all services to be returned when the request contains invalid
-        # parameters.
+        """Test listing services by invalid filter should return all services
+
+        Expect all services to be returned when the request contains invalid
+        parameters.
+        """
         services = self.client.list_services()['services']
         services_xxx = (self.client.list_services(xxx='nova-compute')
                         ['services'])
@@ -47,6 +51,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('1e966d4a-226e-47c7-b601-0b18a27add54')
     def test_get_service_by_invalid_service_and_valid_host(self):
+        """Test listing services by invalid service and valid host value"""
         services = self.client.list_services()['services']
         host_name = services[0]['host']
         services = self.client.list_services(host=host_name,
@@ -56,6 +61,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('64e7e7fb-69e8-4cb6-a71d-8d5eb0c98655')
     def test_get_service_with_valid_service_and_invalid_host(self):
+        """Test listing services by valid service and invalid host value"""
         services = self.client.list_services()['services']
         binary_name = services[0]['binary']
         services = self.client.list_services(host='xxx',
@@ -79,6 +85,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('508671aa-c929-4479-bd10-8680d40dd0a6')
     def test_enable_service_with_invalid_service_id(self):
+        """Test updating non existing service to status enabled"""
         self.assertRaises(lib_exc.NotFound,
                           self.client.update_service,
                           service_id=self.fake_service_id,
@@ -87,6 +94,7 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('a9eeeade-42b3-419f-87aa-c9342aa068cf')
     def test_disable_service_with_invalid_service_id(self):
+        """Test updating non existing service to status disabled"""
         self.assertRaises(lib_exc.NotFound,
                           self.client.update_service,
                           service_id=self.fake_service_id,
@@ -95,6 +103,8 @@
     @decorators.attr(type=['negative'])
     @decorators.idempotent_id('f46a9d91-1e85-4b96-8e7a-db7706fa2e9a')
     def test_disable_log_reason_with_invalid_service_id(self):
+        """Test updating non existing service to disabled with reason"""
+
         # disabled_reason requires that status='disabled' be provided.
         self.assertRaises(lib_exc.NotFound,
                           self.client.update_service,