diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 2f07a19..cd57354 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -53,6 +53,9 @@
 # The above administrative user's tenant name
 admin_tenant_name = admin
 
+# The role that is required to administrate keystone.
+admin_role = admin
+
 [compute]
 # This section contains configuration options used when executing tests
 # against the OpenStack Compute API.
@@ -119,6 +122,10 @@
 # Number of seconds to wait to authenticate to an instance
 ssh_timeout = 300
 
+# Additinal wait time for clean state, when there is
+# no OS-EXT-STS extension availiable
+ready_wait = 0
+
 # Number of seconds to wait for output from ssh channel
 ssh_channel_timeout = 60
 
@@ -223,6 +230,8 @@
 # Unless you have a custom Keystone service catalog implementation, you
 # probably want to leave this value as "volume"
 catalog_type = volume
+# The disk format to use when copying a volume to image
+disk_format = raw
 # Number of seconds to wait while looping to check the status of a
 # volume that is being made available
 build_interval = 10
diff --git a/tempest/api/identity/admin/v3/test_credentials.py b/tempest/api/identity/admin/v3/test_credentials.py
new file mode 100644
index 0000000..efd2f83
--- /dev/null
+++ b/tempest/api/identity/admin/v3/test_credentials.py
@@ -0,0 +1,120 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2013 OpenStack Foundation
+# All Rights Reserved.
+#
+#    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 tempest.api.identity import base
+from tempest.common.utils.data_utils import rand_name
+from tempest.test import attr
+
+
+class CredentialsTestJSON(base.BaseIdentityAdminTest):
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(CredentialsTestJSON, cls).setUpClass()
+        cls.projects = list()
+        cls.creds_list = [['project_id', 'user_id', 'id'],
+                          ['access', 'secret']]
+        u_name = rand_name('user-')
+        u_desc = '%s description' % u_name
+        u_email = '%s@testmail.tm' % u_name
+        u_password = rand_name('pass-')
+        for i in range(2):
+            resp, cls.project = cls.v3_client.create_project(
+                rand_name('project-'), description=rand_name('project-desc-'))
+            assert resp['status'] == '201', "Expected %s" % resp['status']
+            cls.projects.append(cls.project['id'])
+
+        resp, cls.user_body = cls.v3_client.create_user(
+            u_name, description=u_desc, password=u_password,
+            email=u_email, project_id=cls.projects[0])
+        assert resp['status'] == '201', "Expected: %s" % resp['status']
+
+    @classmethod
+    def tearDownClass(cls):
+        resp, _ = cls.v3_client.delete_user(cls.user_body['id'])
+        assert resp['status'] == '204', "Expected: %s" % resp['status']
+        for p in cls.projects:
+            resp, _ = cls.v3_client.delete_project(p)
+            assert resp['status'] == '204', "Expected: %s" % resp['status']
+        super(CredentialsTestJSON, cls).tearDownClass()
+
+    def _delete_credential(self, cred_id):
+        resp, body = self.creds_client.delete_credential(cred_id)
+        self.assertEqual(resp['status'], '204')
+
+    @attr(type='smoke')
+    def test_credentials_create_get_update_delete(self):
+        keys = [rand_name('Access-'), rand_name('Secret-')]
+        resp, cred = self.creds_client.create_credential(
+            keys[0], keys[1], self.user_body['id'],
+            self.projects[0])
+        self.addCleanup(self._delete_credential, cred['id'])
+        self.assertEqual(resp['status'], '201')
+        for value1 in self.creds_list[0]:
+            self.assertIn(value1, cred)
+        for value2 in self.creds_list[1]:
+            self.assertIn(value2, cred['blob'])
+
+        new_keys = [rand_name('NewAccess-'), rand_name('NewSecret-')]
+        resp, update_body = self.creds_client.update_credential(
+            cred['id'], access_key=new_keys[0], secret_key=new_keys[1],
+            project_id=self.projects[1])
+        self.assertEqual(resp['status'], '200')
+        self.assertEqual(cred['id'], update_body['id'])
+        self.assertEqual(self.projects[1], update_body['project_id'])
+        self.assertEqual(self.user_body['id'], update_body['user_id'])
+        self.assertEqual(update_body['blob']['access'], new_keys[0])
+        self.assertEqual(update_body['blob']['secret'], new_keys[1])
+
+        resp, get_body = self.creds_client.get_credential(cred['id'])
+        self.assertEqual(resp['status'], '200')
+        for value1 in self.creds_list[0]:
+            self.assertEqual(update_body[value1],
+                             get_body[value1])
+        for value2 in self.creds_list[1]:
+            self.assertEqual(update_body['blob'][value2],
+                             get_body['blob'][value2])
+
+    @attr(type='smoke')
+    def test_credentials_list_delete(self):
+        created_cred_ids = list()
+        fetched_cred_ids = list()
+
+        for i in range(2):
+            resp, cred = self.creds_client.create_credential(
+                rand_name('Access-'), rand_name('Secret-'),
+                self.user_body['id'], self.projects[0])
+            self.assertEqual(resp['status'], '201')
+            created_cred_ids.append(cred['id'])
+            self.addCleanup(self._delete_credential, cred['id'])
+
+        resp, creds = self.creds_client.list_credentials()
+        self.assertEqual(resp['status'], '200')
+
+        for i in creds:
+            fetched_cred_ids.append(i['id'])
+        missing_creds = [c for c in created_cred_ids
+                         if c not in fetched_cred_ids]
+        self.assertEqual(0, len(missing_creds),
+                         "Failed to find cred %s in fetched list" %
+                         ', '.join(m_cred for m_cred
+                         in missing_creds))
+
+
+class CredentialsTestXML(CredentialsTestJSON):
+    _interface = 'xml'
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index bfb5372..2a168de 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -34,6 +34,7 @@
         cls.service_client = os.service_client
         cls.policy_client = os.policy_client
         cls.v3_token = os.token_v3_client
+        cls.creds_client = os.credentials_client
 
         if not cls.client.has_admin_extensions():
             raise cls.skipException("Admin extensions disabled")
diff --git a/tempest/api/object_storage/base.py b/tempest/api/object_storage/base.py
index e6e8d17..1d16b2f 100644
--- a/tempest/api/object_storage/base.py
+++ b/tempest/api/object_storage/base.py
@@ -73,6 +73,11 @@
         cls.data = DataGenerator(cls.identity_admin_client)
 
     @classmethod
+    def tearDownClass(cls):
+        cls.isolated_creds.clear_isolated_creds()
+        super(BaseObjectTest, cls).tearDownClass()
+
+    @classmethod
     def _assign_member_role(cls):
         primary_user = cls.isolated_creds.get_primary_user()
         alt_user = cls.isolated_creds.get_alt_user()
diff --git a/tempest/api/volume/test_volumes_actions.py b/tempest/api/volume/test_volumes_actions.py
index 766a2c7..ad80505 100644
--- a/tempest/api/volume/test_volumes_actions.py
+++ b/tempest/api/volume/test_volumes_actions.py
@@ -103,7 +103,9 @@
         # there is no way to delete it from Cinder, so we delete it from Glance
         # using the Glance image_client and from Cinder via tearDownClass.
         image_name = rand_name('Image-')
-        resp, body = self.client.upload_volume(self.volume['id'], image_name)
+        resp, body = self.client.upload_volume(self.volume['id'],
+                                               image_name,
+                                               self.config.volume.disk_format)
         image_id = body["image_id"]
         self.addCleanup(self.image_client.delete_image, image_id)
         self.assertEqual(202, resp.status)
diff --git a/tempest/clients.py b/tempest/clients.py
index 48e4939..49b9283 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -71,6 +71,8 @@
     VolumesExtensionsClientXML
 from tempest.services.identity.json.identity_client import IdentityClientJSON
 from tempest.services.identity.json.identity_client import TokenClientJSON
+from tempest.services.identity.v3.json.credentials_client import \
+    CredentialsClientJSON
 from tempest.services.identity.v3.json.endpoints_client import \
     EndPointClientJSON
 from tempest.services.identity.v3.json.identity_client import \
@@ -79,6 +81,8 @@
 from tempest.services.identity.v3.json.policy_client import PolicyClientJSON
 from tempest.services.identity.v3.json.service_client import \
     ServiceClientJSON
+from tempest.services.identity.v3.xml.credentials_client import \
+    CredentialsClientXML
 from tempest.services.identity.v3.xml.endpoints_client import EndPointClientXML
 from tempest.services.identity.v3.xml.identity_client import \
     IdentityV3ClientXML
@@ -252,6 +256,11 @@
     "xml": V3TokenClientXML,
 }
 
+CREDENTIALS_CLIENT = {
+    "json": CredentialsClientJSON,
+    "xml": CredentialsClientXML,
+}
+
 
 class Manager(object):
 
@@ -336,6 +345,8 @@
             self.policy_client = POLICY_CLIENT[interface](*client_args)
             self.hypervisor_client = HYPERVISOR_CLIENT[interface](*client_args)
             self.token_v3_client = V3_TOKEN_CLIENT[interface](*client_args)
+            self.credentials_client = \
+                CREDENTIALS_CLIENT[interface](*client_args)
 
             if client_args_v3_auth:
                 self.servers_client_v3_auth = SERVERS_CLIENTS[interface](
diff --git a/tempest/common/isolated_creds.py b/tempest/common/isolated_creds.py
index 22e1bd2..d6b4466 100644
--- a/tempest/common/isolated_creds.py
+++ b/tempest/common/isolated_creds.py
@@ -141,10 +141,11 @@
             role = None
             try:
                 roles = self._list_roles()
+                admin_role = self.config.identity.admin_role
                 if self.tempest_client:
-                    role = next(r for r in roles if r['name'] == 'admin')
+                    role = next(r for r in roles if r['name'] == admin_role)
                 else:
-                    role = next(r for r in roles if r.name == 'admin')
+                    role = next(r for r in roles if r.name == admin_role)
             except StopIteration:
                 msg = "No admin role found"
                 raise exceptions.NotFound(msg)
diff --git a/tempest/common/waiters.py b/tempest/common/waiters.py
new file mode 100644
index 0000000..15569cd
--- /dev/null
+++ b/tempest/common/waiters.py
@@ -0,0 +1,82 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+#    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.
+
+
+import time
+
+from tempest import config
+from tempest import exceptions
+from tempest.openstack.common import log as logging
+
+CONFIG = config.TempestConfig()
+LOG = logging.getLogger(__name__)
+
+
+# NOTE(afazekas): This function needs to know a token and a subject.
+def wait_for_server_status(client, server_id, status, ready_wait=True):
+    """Waits for a server to reach a given status."""
+
+    def _get_task_state(body):
+        task_state = body.get('OS-EXT-STS:task_state', None)
+        return task_state
+
+    # NOTE(afazekas): UNKNOWN status possible on ERROR
+    # or in a very early stage.
+    resp, body = client.get_server(server_id)
+    old_status = server_status = body['status']
+    old_task_state = task_state = _get_task_state(body)
+    start_time = int(time.time())
+    while True:
+        # NOTE(afazekas): Now the BUILD status only reached
+        # between the UNKOWN->ACTIVE transition.
+        # TODO(afazekas): enumerate and validate the stable status set
+        if status == 'BUILD' and server_status != 'UNKNOWN':
+            return
+        if server_status == status:
+            if ready_wait:
+                if status == 'BUILD':
+                    return
+                # NOTE(afazekas): The instance is in "ready for action state"
+                # when no task in progress
+                # NOTE(afazekas): Converted to string bacuse of the XML
+                # responses
+                if str(task_state) == "None":
+                    # without state api extension 3 sec usually enough
+                    time.sleep(CONFIG.compute.ready_wait)
+                    return
+            else:
+                return
+
+        time.sleep(client.build_interval)
+        resp, body = client.get_server(server_id)
+        server_status = body['status']
+        task_state = _get_task_state(body)
+        if (server_status != old_status) or (task_state != old_task_state):
+            LOG.info('State transition "%s" ==> "%s" after %d second wait',
+                     '/'.join((old_status, str(old_task_state))),
+                     '/'.join((server_status, str(task_state))),
+                     time.time() - start_time)
+        if server_status == 'ERROR':
+            raise exceptions.BuildErrorException(server_id=server_id)
+
+        timed_out = int(time.time()) - start_time >= client.build_timeout
+
+        if timed_out:
+            message = ('Server %s failed to reach %s status within the '
+                       'required time (%s s).' %
+                       (server_id, status, client.build_timeout))
+            message += ' Current status: %s.' % server_status
+            raise exceptions.TimeoutException(message)
+        old_status = server_status
+        old_task_state = task_state
diff --git a/tempest/config.py b/tempest/config.py
index acb0e8d..b386968 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -51,6 +51,9 @@
     cfg.StrOpt('tenant_name',
                default='demo',
                help="Tenant name to use for Nova API requests."),
+    cfg.StrOpt('admin_role',
+               default='admin',
+               help="Role required to administrate keystone."),
     cfg.StrOpt('password',
                default='pass',
                help="API key to use when authenticating.",
@@ -174,6 +177,10 @@
                default=300,
                help="Timeout in seconds to wait for authentication to "
                     "succeed."),
+    cfg.IntOpt('ready_wait',
+               default=0,
+               help="Additinal wait time for clean state, when there is"
+                    " no OS-EXT-STS extension availiable"),
     cfg.IntOpt('ssh_channel_timeout',
                default=60,
                help="Timeout in seconds to wait for output from ssh "
@@ -323,6 +330,9 @@
     cfg.StrOpt('vendor_name',
                default='Open Source',
                help='Backend vendor to target when creating volume types'),
+    cfg.StrOpt('disk_format',
+               default='raw',
+               help='Disk format to use when copying a volume to image'),
 ]
 
 
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index d3c2a18..21c37b9 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -16,6 +16,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+import logging
 import os
 import subprocess
 
@@ -37,11 +38,18 @@
 from tempest.common.utils.linux.remote_client import RemoteClient
 from tempest import exceptions
 import tempest.manager
-from tempest.openstack.common import log as logging
+from tempest.openstack.common import log
 import tempest.test
 
 
-LOG = logging.getLogger(__name__)
+LOG = log.getLogger(__name__)
+
+# NOTE(afazekas): Workaround for the stdout logging
+LOG_nova_client = logging.getLogger('novaclient.client')
+LOG_nova_client.addHandler(log.NullHandler())
+
+LOG_cinder_client = logging.getLogger('cinderclient.client')
+LOG_cinder_client.addHandler(log.NullHandler())
 
 
 class OfficialClientManager(tempest.manager.Manager):
@@ -89,7 +97,8 @@
                                         *client_args,
                                         service_type=service_type,
                                         no_cache=True,
-                                        insecure=dscv)
+                                        insecure=dscv,
+                                        http_log_debug=True)
 
     def _get_image_client(self):
         token = self.identity_client.auth_token
@@ -105,7 +114,8 @@
                                           username,
                                           password,
                                           tenant_name,
-                                          auth_url)
+                                          auth_url,
+                                          http_log_debug=True)
 
     def _get_orchestration_client(self, username=None, password=None,
                                   tenant_name=None):
diff --git a/tempest/services/compute/json/servers_client.py b/tempest/services/compute/json/servers_client.py
index c5827f6..1f2daec 100644
--- a/tempest/services/compute/json/servers_client.py
+++ b/tempest/services/compute/json/servers_client.py
@@ -21,6 +21,7 @@
 import urllib
 
 from tempest.common.rest_client import RestClient
+from tempest.common import waiters
 from tempest import exceptions
 
 
@@ -152,28 +153,7 @@
 
     def wait_for_server_status(self, server_id, status):
         """Waits for a server to reach a given status."""
-        resp, body = self.get_server(server_id)
-        server_status = body['status']
-        start = int(time.time())
-
-        while(server_status != status):
-            if status == 'BUILD' and server_status != 'UNKNOWN':
-                return
-            time.sleep(self.build_interval)
-            resp, body = self.get_server(server_id)
-            server_status = body['status']
-
-            if server_status == 'ERROR':
-                raise exceptions.BuildErrorException(server_id=server_id)
-
-            timed_out = int(time.time()) - start >= self.build_timeout
-
-            if server_status != status and timed_out:
-                message = ('Server %s failed to reach %s status within the '
-                           'required time (%s s).' %
-                           (server_id, status, self.build_timeout))
-                message += ' Current status: %s.' % server_status
-                raise exceptions.TimeoutException(message)
+        return waiters.wait_for_server_status(self, server_id, status)
 
     def wait_for_server_termination(self, server_id, ignore_error=False):
         """Waits for server to reach termination."""
diff --git a/tempest/services/compute/xml/servers_client.py b/tempest/services/compute/xml/servers_client.py
index 6f17611..bf72bdc 100644
--- a/tempest/services/compute/xml/servers_client.py
+++ b/tempest/services/compute/xml/servers_client.py
@@ -22,6 +22,7 @@
 from lxml import etree
 
 from tempest.common.rest_client import RestClientXML
+from tempest.common import waiters
 from tempest import exceptions
 from tempest.openstack.common import log as logging
 from tempest.services.compute.xml.common import Document
@@ -336,28 +337,7 @@
 
     def wait_for_server_status(self, server_id, status):
         """Waits for a server to reach a given status."""
-        resp, body = self.get_server(server_id)
-        server_status = body['status']
-        start = int(time.time())
-
-        while(server_status != status):
-            if status == 'BUILD' and server_status != 'UNKNOWN':
-                return
-            time.sleep(self.build_interval)
-            resp, body = self.get_server(server_id)
-            server_status = body['status']
-
-            if server_status == 'ERROR':
-                raise exceptions.BuildErrorException(server_id=server_id)
-
-            timed_out = int(time.time()) - start >= self.build_timeout
-
-            if server_status != status and timed_out:
-                message = ('Server %s failed to reach %s status within the '
-                           'required time (%s s).' %
-                           (server_id, status, self.build_timeout))
-                message += ' Current status: %s.' % server_status
-                raise exceptions.TimeoutException(message)
+        return waiters.wait_for_server_status(self, server_id, status)
 
     def wait_for_server_termination(self, server_id, ignore_error=False):
         """Waits for server to reach termination."""
diff --git a/tempest/services/identity/v3/json/credentials_client.py b/tempest/services/identity/v3/json/credentials_client.py
new file mode 100644
index 0000000..c3f788a
--- /dev/null
+++ b/tempest/services/identity/v3/json/credentials_client.py
@@ -0,0 +1,97 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2013 OpenStack Foundation
+# All Rights Reserved.
+#
+#    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.
+
+import json
+from urlparse import urlparse
+
+from tempest.common.rest_client import RestClient
+
+
+class CredentialsClientJSON(RestClient):
+
+    def __init__(self, config, username, password, auth_url, tenant_name=None):
+        super(CredentialsClientJSON, self).__init__(config, username, password,
+                                                    auth_url, tenant_name)
+        self.service = self.config.identity.catalog_type
+        self.endpoint_url = 'adminURL'
+
+    def request(self, method, url, headers=None, body=None, wait=None):
+        """Overriding the existing HTTP request in super class rest_client."""
+        self._set_auth()
+        self.base_url = self.base_url.replace(urlparse(self.base_url).path,
+                                              "/v3")
+        return super(CredentialsClientJSON, self).request(method, url,
+                                                          headers=headers,
+                                                          body=body)
+
+    def create_credential(self, access_key, secret_key, user_id, project_id):
+        """Creates a credential."""
+        blob = "{\"access\": \"%s\", \"secret\": \"%s\"}" % (
+            access_key, secret_key)
+        post_body = {
+            "blob": blob,
+            "project_id": project_id,
+            "type": "ec2",
+            "user_id": user_id
+        }
+        post_body = json.dumps({'credential': post_body})
+        resp, body = self.post('credentials', post_body,
+                               self.headers)
+        body = json.loads(body)
+        body['credential']['blob'] = json.loads(body['credential']['blob'])
+        return resp, body['credential']
+
+    def update_credential(self, credential_id, **kwargs):
+        """Updates a credential."""
+        resp, body = self.get_credential(credential_id)
+        cred_type = kwargs.get('type', body['type'])
+        access_key = kwargs.get('access_key', body['blob']['access'])
+        secret_key = kwargs.get('secret_key', body['blob']['secret'])
+        project_id = kwargs.get('project_id', body['project_id'])
+        user_id = kwargs.get('user_id', body['user_id'])
+        blob = "{\"access\": \"%s\", \"secret\": \"%s\"}" % (
+            access_key, secret_key)
+        post_body = {
+            "blob": blob,
+            "project_id": project_id,
+            "type": cred_type,
+            "user_id": user_id
+        }
+        post_body = json.dumps({'credential': post_body})
+        resp, body = self.patch('credentials/%s' % credential_id, post_body,
+                                self.headers)
+        body = json.loads(body)
+        body['credential']['blob'] = json.loads(body['credential']['blob'])
+        return resp, body['credential']
+
+    def get_credential(self, credential_id):
+        """To GET Details of a credential."""
+        resp, body = self.get('credentials/%s' % credential_id)
+        body = json.loads(body)
+        body['credential']['blob'] = json.loads(body['credential']['blob'])
+        return resp, body['credential']
+
+    def list_credentials(self):
+        """Lists out all the available credentials."""
+        resp, body = self.get('credentials')
+        body = json.loads(body)
+        return resp, body['credentials']
+
+    def delete_credential(self, credential_id):
+        """Deletes a credential."""
+        resp, body = self.delete('credentials/%s' % credential_id)
+        return resp, body
diff --git a/tempest/services/identity/v3/xml/credentials_client.py b/tempest/services/identity/v3/xml/credentials_client.py
new file mode 100644
index 0000000..dc0ade1
--- /dev/null
+++ b/tempest/services/identity/v3/xml/credentials_client.py
@@ -0,0 +1,121 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2013 OpenStack Foundation
+# All Rights Reserved.
+#
+#    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.
+
+import json
+from urlparse import urlparse
+
+from lxml import etree
+
+from tempest.common.rest_client import RestClientXML
+from tempest.services.compute.xml.common import Document
+from tempest.services.compute.xml.common import Element
+from tempest.services.compute.xml.common import Text
+from tempest.services.compute.xml.common import xml_to_json
+
+
+XMLNS = "http://docs.openstack.org/identity/api/v3"
+
+
+class CredentialsClientXML(RestClientXML):
+
+    def __init__(self, config, username, password, auth_url, tenant_name=None):
+        super(CredentialsClientXML, self).__init__(config, username, password,
+                                                   auth_url, tenant_name)
+        self.service = self.config.identity.catalog_type
+        self.endpoint_url = 'adminURL'
+
+    def request(self, method, url, headers=None, body=None, wait=None):
+        """Overriding the existing HTTP request in super class rest_client."""
+        self._set_auth()
+        self.base_url = self.base_url.replace(urlparse(self.base_url).path,
+                                              "/v3")
+        return super(CredentialsClientXML, self).request(method, url,
+                                                         headers=headers,
+                                                         body=body)
+
+    def _parse_body(self, body):
+        data = xml_to_json(body)
+        return data
+
+    def _parse_creds(self, node):
+        array = []
+        for child in node.getchildren():
+            tag_list = child.tag.split('}', 1)
+            if tag_list[1] == "credential":
+                array.append(xml_to_json(child))
+        return array
+
+    def create_credential(self, access_key, secret_key, user_id, project_id):
+        """Creates a credential."""
+        cred_type = 'ec2'
+        access = "&quot;access&quot;: &quot;%s&quot;" % access_key
+        secret = "&quot;secret&quot;: &quot;%s&quot;" % secret_key
+        blob = Element('blob',
+                       xmlns=XMLNS)
+        blob.append(Text("{%s , %s}"
+                         % (access, secret)))
+        credential = Element('credential', project_id=project_id,
+                             type=cred_type, user_id=user_id)
+        credential.append(blob)
+        resp, body = self.post('credentials', str(Document(credential)),
+                               self.headers)
+        body = self._parse_body(etree.fromstring(body))
+        body['blob'] = json.loads(body['blob'])
+        return resp, body
+
+    def update_credential(self, credential_id, **kwargs):
+        """Updates a credential."""
+        resp, body = self.get_credential(credential_id)
+        cred_type = kwargs.get('type', body['type'])
+        access_key = kwargs.get('access_key', body['blob']['access'])
+        secret_key = kwargs.get('secret_key', body['blob']['secret'])
+        project_id = kwargs.get('project_id', body['project_id'])
+        user_id = kwargs.get('user_id', body['user_id'])
+        access = "&quot;access&quot;: &quot;%s&quot;" % access_key
+        secret = "&quot;secret&quot;: &quot;%s&quot;" % secret_key
+        blob = Element('blob',
+                       xmlns=XMLNS)
+        blob.append(Text("{%s , %s}"
+                         % (access, secret)))
+        credential = Element('credential', project_id=project_id,
+                             type=cred_type, user_id=user_id)
+        credential.append(blob)
+        resp, body = self.patch('credentials/%s' % credential_id,
+                                str(Document(credential)),
+                                self.headers)
+        body = self._parse_body(etree.fromstring(body))
+        body['blob'] = json.loads(body['blob'])
+        return resp, body
+
+    def get_credential(self, credential_id):
+        """To GET Details of a credential."""
+        resp, body = self.get('credentials/%s' % credential_id, self.headers)
+        body = self._parse_body(etree.fromstring(body))
+        body['blob'] = json.loads(body['blob'])
+        return resp, body
+
+    def list_credentials(self):
+        """Lists out all the available credentials."""
+        resp, body = self.get('credentials', self.headers)
+        body = self._parse_creds(etree.fromstring(body))
+        return resp, body
+
+    def delete_credential(self, credential_id):
+        """Deletes a credential."""
+        resp, body = self.delete('credentials/%s' % credential_id,
+                                 self.headers)
+        return resp, body
diff --git a/tempest/services/volume/json/volumes_client.py b/tempest/services/volume/json/volumes_client.py
index 2ae73b1..c35452e 100644
--- a/tempest/services/volume/json/volumes_client.py
+++ b/tempest/services/volume/json/volumes_client.py
@@ -89,10 +89,11 @@
         """Deletes the Specified Volume."""
         return self.delete("volumes/%s" % str(volume_id))
 
-    def upload_volume(self, volume_id, image_name):
+    def upload_volume(self, volume_id, image_name, disk_format):
         """Uploads a volume in Glance."""
         post_body = {
             'image_name': image_name,
+            'disk_format': disk_format
         }
         post_body = json.dumps({'os-volume_upload_image': post_body})
         url = 'volumes/%s/action' % (volume_id)
diff --git a/tempest/services/volume/xml/volumes_client.py b/tempest/services/volume/xml/volumes_client.py
index 936e036..ecbfb19 100644
--- a/tempest/services/volume/xml/volumes_client.py
+++ b/tempest/services/volume/xml/volumes_client.py
@@ -183,10 +183,11 @@
             body = xml_to_json(etree.fromstring(body))
         return resp, body
 
-    def upload_volume(self, volume_id, image_name):
+    def upload_volume(self, volume_id, image_name, disk_format):
         """Uploads a volume in Glance."""
         post_body = Element("os-volume_upload_image",
-                            image_name=image_name)
+                            image_name=image_name,
+                            disk_format=disk_format)
         url = 'volumes/%s/action' % str(volume_id)
         resp, body = self.post(url, str(Document(post_body)), self.headers)
         volume = xml_to_json(etree.fromstring(body))
