Updates Tempest to match Zaqar's API name change

Zaqar is a messaging service which provides support for different
messaging patterns and messaging related semantics.
This fix changes the old API name -queuing- to a more accurate name, -messaging-.

Change-Id: I63321e8b9f277be040d0f75d5ed9f4461da0defc
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 3b0b834..dfcbaba 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -709,6 +709,42 @@
 #ssh_user_regex=[["^.*[Cc]irros.*$", "root"]]
 
 
+[messaging]
+
+#
+# Options defined in tempest.config
+#
+
+# Catalog type of the Messaging service. (string value)
+#catalog_type=messaging
+
+# The maximum number of queue records per page when listing
+# queues (integer value)
+#max_queues_per_page=20
+
+# The maximum metadata size for a queue (integer value)
+#max_queue_metadata=65536
+
+# The maximum number of queue message per page when listing
+# (or) posting messages (integer value)
+#max_messages_per_page=20
+
+# The maximum size of a message body (integer value)
+#max_message_size=262144
+
+# The maximum number of messages per claim (integer value)
+#max_messages_per_claim=20
+
+# The maximum ttl for a message (integer value)
+#max_message_ttl=1209600
+
+# The maximum ttl for a claim (integer value)
+#max_claim_ttl=43200
+
+# The maximum grace period for a claim (integer value)
+#max_claim_grace=43200
+
+
 [negative]
 
 #
@@ -897,42 +933,6 @@
 #max_resources_per_stack=1000
 
 
-[queuing]
-
-#
-# Options defined in tempest.config
-#
-
-# Catalog type of the Queuing service. (string value)
-#catalog_type=queuing
-
-# The maximum number of queue records per page when listing
-# queues (integer value)
-#max_queues_per_page=20
-
-# The maximum metadata size for a queue (integer value)
-#max_queue_metadata=65536
-
-# The maximum number of queue message per page when listing
-# (or) posting messages (integer value)
-#max_messages_per_page=20
-
-# The maximum size of a message body (integer value)
-#max_message_size=262144
-
-# The maximum number of messages per claim (integer value)
-#max_messages_per_claim=20
-
-# The maximum ttl for a message (integer value)
-#max_message_ttl=1209600
-
-# The maximum ttl for a claim (integer value)
-#max_claim_ttl=43200
-
-# The maximum grace period for a claim (integer value)
-#max_claim_grace=43200
-
-
 [scenario]
 
 #
diff --git a/tempest/api/queuing/__init__.py b/tempest/api/messaging/__init__.py
similarity index 100%
rename from tempest/api/queuing/__init__.py
rename to tempest/api/messaging/__init__.py
diff --git a/tempest/api/queuing/base.py b/tempest/api/messaging/base.py
similarity index 78%
rename from tempest/api/queuing/base.py
rename to tempest/api/messaging/base.py
index 41a02f2..0e062c5 100644
--- a/tempest/api/queuing/base.py
+++ b/tempest/api/messaging/base.py
@@ -23,25 +23,25 @@
 LOG = logging.getLogger(__name__)
 
 
-class BaseQueuingTest(test.BaseTestCase):
+class BaseMessagingTest(test.BaseTestCase):
 
     """
-    Base class for the Queuing tests that use the Tempest Zaqar REST client
+    Base class for the Messaging tests that use the Tempest Zaqar REST client
 
     It is assumed that the following option is defined in the
     [service_available] section of etc/tempest.conf
 
-        queuing as True
+        messaging as True
     """
 
     @classmethod
     def setUpClass(cls):
-        super(BaseQueuingTest, cls).setUpClass()
+        super(BaseMessagingTest, cls).setUpClass()
         if not CONF.service_available.zaqar:
             raise cls.skipException("Zaqar support is required")
         os = cls.get_client_manager()
-        cls.queuing_cfg = CONF.queuing
-        cls.client = os.queuing_client
+        cls.messaging_cfg = CONF.messaging
+        cls.client = os.messaging_client
 
     @classmethod
     def create_queue(cls, queue_name):
@@ -93,42 +93,42 @@
 
     @classmethod
     def post_messages(cls, queue_name, rbody):
-        '''Wrapper utility that posts messages to a queue.'''
+        """Wrapper utility that posts messages to a queue."""
         resp, body = cls.client.post_messages(queue_name, rbody)
 
         return resp, body
 
     @classmethod
     def list_messages(cls, queue_name):
-        '''Wrapper utility that lists the messages in a queue.'''
+        """Wrapper utility that lists the messages in a queue."""
         resp, body = cls.client.list_messages(queue_name)
 
         return resp, body
 
     @classmethod
     def get_single_message(cls, message_uri):
-        '''Wrapper utility that gets a single message.'''
+        """Wrapper utility that gets a single message."""
         resp, body = cls.client.get_single_message(message_uri)
 
         return resp, body
 
     @classmethod
     def get_multiple_messages(cls, message_uri):
-        '''Wrapper utility that gets multiple messages.'''
+        """Wrapper utility that gets multiple messages."""
         resp, body = cls.client.get_multiple_messages(message_uri)
 
         return resp, body
 
     @classmethod
     def delete_messages(cls, message_uri):
-        '''Wrapper utility that deletes messages.'''
+        """Wrapper utility that deletes messages."""
         resp, body = cls.client.delete_messages(message_uri)
 
         return resp, body
 
     @classmethod
     def post_claims(cls, queue_name, rbody, url_params=False):
-        '''Wrapper utility that claims messages.'''
+        """Wrapper utility that claims messages."""
         resp, body = cls.client.post_claims(
             queue_name, rbody, url_params=False)
 
@@ -136,33 +136,34 @@
 
     @classmethod
     def query_claim(cls, claim_uri):
-        '''Wrapper utility that gets a claim.'''
+        """Wrapper utility that gets a claim."""
         resp, body = cls.client.query_claim(claim_uri)
 
         return resp, body
 
     @classmethod
     def update_claim(cls, claim_uri, rbody):
-        '''Wrapper utility that updates a claim.'''
+        """Wrapper utility that updates a claim."""
         resp, body = cls.client.update_claim(claim_uri, rbody)
 
         return resp, body
 
     @classmethod
     def release_claim(cls, claim_uri):
-        '''Wrapper utility that deletes a claim.'''
+        """Wrapper utility that deletes a claim."""
         resp, body = cls.client.release_claim(claim_uri)
 
         return resp, body
 
     @classmethod
     def generate_message_body(cls, repeat=1):
-        '''Wrapper utility that sets the metadata of a queue.'''
-        message_ttl = data_utils.rand_int_id(start=60,
-                                             end=CONF.queuing.max_message_ttl)
+        """Wrapper utility that sets the metadata of a queue."""
+        message_ttl = data_utils.\
+            rand_int_id(start=60, end=CONF.messaging.max_message_ttl)
 
-        key = data_utils.arbitrary_string(size=20, base_text='QueuingKey')
-        value = data_utils.arbitrary_string(size=20, base_text='QueuingValue')
+        key = data_utils.arbitrary_string(size=20, base_text='MessagingKey')
+        value = data_utils.arbitrary_string(size=20,
+                                            base_text='MessagingValue')
         message_body = {key: value}
 
         rbody = ([{'body': message_body, 'ttl': message_ttl}] * repeat)
diff --git a/tempest/api/queuing/test_claims.py b/tempest/api/messaging/test_claims.py
similarity index 91%
rename from tempest/api/queuing/test_claims.py
rename to tempest/api/messaging/test_claims.py
index a306623..885f00e 100644
--- a/tempest/api/queuing/test_claims.py
+++ b/tempest/api/messaging/test_claims.py
@@ -16,7 +16,7 @@
 import logging
 import urlparse
 
-from tempest.api.queuing import base
+from tempest.api.messaging import base
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest import test
@@ -26,7 +26,7 @@
 CONF = config.CONF
 
 
-class TestClaims(base.BaseQueuingTest):
+class TestClaims(base.BaseMessagingTest):
     _interface = 'json'
 
     @classmethod
@@ -44,9 +44,9 @@
 
         # Post Claim
         claim_ttl = data_utils.rand_int_id(start=60,
-                                           end=CONF.queuing.max_claim_ttl)
-        claim_grace = data_utils.rand_int_id(start=60,
-                                             end=CONF.queuing.max_claim_grace)
+                                           end=CONF.messaging.max_claim_ttl)
+        claim_grace = data_utils.\
+            rand_int_id(start=60, end=CONF.messaging.max_claim_grace)
         claim_body = {"ttl": claim_ttl, "grace": claim_grace}
         resp, body = self.client.post_claims(queue_name=self.queue_name,
                                              rbody=claim_body)
@@ -90,7 +90,7 @@
 
         # Update Claim
         claim_ttl = data_utils.rand_int_id(start=60,
-                                           end=CONF.queuing.max_claim_ttl)
+                                           end=CONF.messaging.max_claim_ttl)
         update_rbody = {"ttl": claim_ttl}
 
         self.client.update_claim(claim_uri, rbody=update_rbody)
diff --git a/tempest/api/queuing/test_messages.py b/tempest/api/messaging/test_messages.py
similarity index 96%
rename from tempest/api/queuing/test_messages.py
rename to tempest/api/messaging/test_messages.py
index 9546c91..3217361 100644
--- a/tempest/api/queuing/test_messages.py
+++ b/tempest/api/messaging/test_messages.py
@@ -15,7 +15,7 @@
 
 import logging
 
-from tempest.api.queuing import base
+from tempest.api.messaging import base
 from tempest.common.utils import data_utils
 from tempest import config
 from tempest import test
@@ -25,7 +25,7 @@
 CONF = config.CONF
 
 
-class TestMessages(base.BaseQueuingTest):
+class TestMessages(base.BaseMessagingTest):
     _interface = 'json'
 
     @classmethod
@@ -35,7 +35,7 @@
         # Create Queue
         cls.client.create_queue(cls.queue_name)
 
-    def _post_messages(self, repeat=CONF.queuing.max_messages_per_page):
+    def _post_messages(self, repeat=CONF.messaging.max_messages_per_page):
         message_body = self.generate_message_body(repeat=repeat)
         resp, body = self.post_messages(queue_name=self.queue_name,
                                         rbody=message_body)
diff --git a/tempest/api/queuing/test_queues.py b/tempest/api/messaging/test_queues.py
similarity index 96%
rename from tempest/api/queuing/test_queues.py
rename to tempest/api/messaging/test_queues.py
index b340b60..edfe10e 100644
--- a/tempest/api/queuing/test_queues.py
+++ b/tempest/api/messaging/test_queues.py
@@ -18,7 +18,7 @@
 from six import moves
 from testtools import matchers
 
-from tempest.api.queuing import base
+from tempest.api.messaging import base
 from tempest.common.utils import data_utils
 from tempest import test
 
@@ -26,7 +26,7 @@
 LOG = logging.getLogger(__name__)
 
 
-class TestQueues(base.BaseQueuingTest):
+class TestQueues(base.BaseMessagingTest):
 
     @test.attr(type='smoke')
     def test_create_queue(self):
@@ -40,7 +40,7 @@
         self.assertEqual('', body)
 
 
-class TestManageQueue(base.BaseQueuingTest):
+class TestManageQueue(base.BaseMessagingTest):
     _interface = 'json'
 
     @classmethod
diff --git a/tempest/api_schema/response/queuing/__init__.py b/tempest/api_schema/response/messaging/__init__.py
similarity index 100%
rename from tempest/api_schema/response/queuing/__init__.py
rename to tempest/api_schema/response/messaging/__init__.py
diff --git a/tempest/api_schema/response/queuing/v1/__init__.py b/tempest/api_schema/response/messaging/v1/__init__.py
similarity index 100%
rename from tempest/api_schema/response/queuing/v1/__init__.py
rename to tempest/api_schema/response/messaging/v1/__init__.py
diff --git a/tempest/api_schema/response/queuing/v1/queues.py b/tempest/api_schema/response/messaging/v1/queues.py
similarity index 100%
rename from tempest/api_schema/response/queuing/v1/queues.py
rename to tempest/api_schema/response/messaging/v1/queues.py
diff --git a/tempest/clients.py b/tempest/clients.py
index eab496e..8164bf3 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -151,6 +151,8 @@
 from tempest.services.identity.xml.identity_client import TokenClientXML
 from tempest.services.image.v1.json.image_client import ImageClientJSON
 from tempest.services.image.v2.json.image_client import ImageClientV2JSON
+from tempest.services.messaging.json.messaging_client import \
+    MessagingClientJSON
 from tempest.services.network.json.network_client import NetworkClientJSON
 from tempest.services.network.xml.network_client import NetworkClientXML
 from tempest.services.object_storage.account_client import AccountClient
@@ -162,7 +164,6 @@
     ObjectClientCustomizedHeader
 from tempest.services.orchestration.json.orchestration_client import \
     OrchestrationClient
-from tempest.services.queuing.json.queuing_client import QueuingClientJSON
 from tempest.services.telemetry.json.telemetry_client import \
     TelemetryClientJSON
 from tempest.services.telemetry.xml.telemetry_client import \
@@ -384,7 +385,7 @@
                 self.auth_provider)
             self.database_versions_client = DatabaseVersionsClientJSON(
                 self.auth_provider)
-            self.queuing_client = QueuingClientJSON(self.auth_provider)
+            self.messaging_client = MessagingClientJSON(self.auth_provider)
             if CONF.service_available.ceilometer:
                 self.telemetry_client = TelemetryClientJSON(
                     self.auth_provider)
diff --git a/tempest/cmd/verify_tempest_config.py b/tempest/cmd/verify_tempest_config.py
index cd696a9..5046bff 100755
--- a/tempest/cmd/verify_tempest_config.py
+++ b/tempest/cmd/verify_tempest_config.py
@@ -247,7 +247,7 @@
         'data_processing': 'sahara',
         'baremetal': 'ironic',
         'identity': 'keystone',
-        'queuing': 'zaqar',
+        'messaging': 'zaqar',
         'database': 'trove'
     }
     # Get catalog list for endpoints to use for validation
diff --git a/tempest/config.py b/tempest/config.py
index d3449a7..cea9dec 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -470,13 +470,13 @@
                 )
 ]
 
-queuing_group = cfg.OptGroup(name='queuing',
-                             title='Queuing Service')
+messaging_group = cfg.OptGroup(name='messaging',
+                               title='Messaging Service')
 
-QueuingGroup = [
+MessagingGroup = [
     cfg.StrOpt('catalog_type',
-               default='queuing',
-               help='Catalog type of the Queuing service.'),
+               default='messaging',
+               help='Catalog type of the Messaging service.'),
     cfg.IntOpt('max_queues_per_page',
                default=20,
                help='The maximum number of queue records per page when '
@@ -1034,7 +1034,7 @@
     register_opt_group(cfg.CONF, network_group, NetworkGroup)
     register_opt_group(cfg.CONF, network_feature_group,
                        NetworkFeaturesGroup)
-    register_opt_group(cfg.CONF, queuing_group, QueuingGroup)
+    register_opt_group(cfg.CONF, messaging_group, MessagingGroup)
     register_opt_group(cfg.CONF, volume_group, VolumeGroup)
     register_opt_group(cfg.CONF, volume_feature_group,
                        VolumeFeaturesGroup)
@@ -1091,7 +1091,7 @@
             'object-storage-feature-enabled']
         self.database = cfg.CONF.database
         self.orchestration = cfg.CONF.orchestration
-        self.queuing = cfg.CONF.queuing
+        self.messaging = cfg.CONF.messaging
         self.telemetry = cfg.CONF.telemetry
         self.dashboard = cfg.CONF.dashboard
         self.data_processing = cfg.CONF.data_processing
diff --git a/tempest/services/queuing/__init__.py b/tempest/services/messaging/__init__.py
similarity index 100%
rename from tempest/services/queuing/__init__.py
rename to tempest/services/messaging/__init__.py
diff --git a/tempest/services/queuing/json/__init__.py b/tempest/services/messaging/json/__init__.py
similarity index 100%
rename from tempest/services/queuing/json/__init__.py
rename to tempest/services/messaging/json/__init__.py
diff --git a/tempest/services/queuing/json/queuing_client.py b/tempest/services/messaging/json/messaging_client.py
similarity index 95%
rename from tempest/services/queuing/json/queuing_client.py
rename to tempest/services/messaging/json/messaging_client.py
index 14960ad..3e82399 100644
--- a/tempest/services/queuing/json/queuing_client.py
+++ b/tempest/services/messaging/json/messaging_client.py
@@ -16,7 +16,7 @@
 import json
 import urllib
 
-from tempest.api_schema.response.queuing.v1 import queues as queues_schema
+from tempest.api_schema.response.messaging.v1 import queues as queues_schema
 from tempest.common import rest_client
 from tempest.common.utils import data_utils
 from tempest import config
@@ -25,11 +25,11 @@
 CONF = config.CONF
 
 
-class QueuingClientJSON(rest_client.RestClient):
+class MessagingClientJSON(rest_client.RestClient):
 
     def __init__(self, auth_provider):
-        super(QueuingClientJSON, self).__init__(auth_provider)
-        self.service = CONF.queuing.catalog_type
+        super(MessagingClientJSON, self).__init__(auth_provider)
+        self.service = CONF.messaging.catalog_type
         self.version = '1'
         self.uri_prefix = 'v{0}'.format(self.version)