diff --git a/cli/__init__.py b/cli/__init__.py
new file mode 100644
index 0000000..cea0b62
--- /dev/null
+++ b/cli/__init__.py
@@ -0,0 +1,36 @@
+# 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 logging
+
+from tempest.openstack.common import cfg
+
+LOG = logging.getLogger(__name__)
+
+cli_opts = [
+    cfg.BoolOpt('enabled',
+                default=True,
+                help="enable cli tests"),
+    cfg.StrOpt('cli_dir',
+               default='/usr/local/bin/',
+               help="directory where python client binaries are located"),
+]
+
+CONF = cfg.CONF
+cli_group = cfg.OptGroup(name='cli', title="cli Configuration Options")
+CONF.register_group(cli_group)
+CONF.register_opts(cli_opts, group=cli_group)
diff --git a/cli/simple_read_only/README.txt b/cli/simple_read_only/README.txt
new file mode 100644
index 0000000..ca5fa2f
--- /dev/null
+++ b/cli/simple_read_only/README.txt
@@ -0,0 +1 @@
+This directory consists of simple read only python client tests.
diff --git a/cli/simple_read_only/__init__.py b/cli/simple_read_only/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/cli/simple_read_only/__init__.py
diff --git a/cli/simple_read_only/test_compute.py b/cli/simple_read_only/test_compute.py
new file mode 100644
index 0000000..742b5a4
--- /dev/null
+++ b/cli/simple_read_only/test_compute.py
@@ -0,0 +1,104 @@
+# 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 logging
+import shlex
+import subprocess
+
+import testtools
+
+import cli
+
+from tempest import config
+from tempest.openstack.common import cfg
+
+
+CONF = cfg.CONF
+
+
+LOG = logging.getLogger(__name__)
+
+
+class SimpleReadOnlyNovaCLientTest(testtools.TestCase):
+
+    """
+    This is a first pass at a simple read only python-novaclient test. This
+    only exercises client commands that are read only.
+
+    This should test commands:
+    * as a regular user
+    * as a admin user
+    * with and without optional parameters
+    * initially just check return codes, and later test command outputs
+
+    """
+
+    @classmethod
+    def setUpClass(cls):
+        if not CONF.cli.enabled:
+            msg = "cli testing disabled"
+            raise cls.skipException(msg)
+        cls.identity = config.TempestConfig().identity
+        super(SimpleReadOnlyNovaCLientTest, cls).setUpClass()
+
+    def nova(self, action, flags='', params='', admin=True, fail_ok=False):
+        """Executes nova command for the given action."""
+        #TODO(jogo) make admin=False work
+        creds = ('--os-username %s --os-tenant-name %s --os-password %s '
+                 '--os-auth-url %s ' % (self.identity.admin_username,
+                 self.identity.admin_tenant_name, self.identity.admin_password,
+                 self.identity.uri))
+        flags = creds + ' ' + flags
+        cmd = ' '.join([CONF.cli.cli_dir + 'nova', flags, action, params])
+        LOG.info("running: '%s'" % cmd)
+        cmd = shlex.split(cmd)
+        result = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+        return result
+
+    def test_admin_version(self):
+        self.nova('', flags='--version')
+
+    def test_admin_timing(self):
+        self.nova('list', flags='--timing')
+
+    def test_admin_timeout(self):
+        self.nova('list', flags='--timeout 2')
+
+    def test_admin_debug_list(self):
+        self.nova('list', flags='--debug')
+
+    def test_admin_fake_action(self):
+        self.assertRaises(subprocess.CalledProcessError,
+                          self.nova,
+                          'this-does-nova-exist')
+
+    def test_admin_aggregate_list(self):
+        self.nova('aggregate-list')
+
+    def test_admin_cloudpipe_list(self):
+        self.nova('cloudpipe-list')
+
+    def test_admin_image_list(self):
+        self.nova('image-list')
+
+    def test_admin_dns_domains(self):
+        self.nova('dns-domains')
+
+    def test_admin_flavor_list(self):
+        self.nova('flavor-list')
+
+    #TODO(jogo) add more tests
diff --git a/tempest/clients.py b/tempest/clients.py
index aa9b558..7eb17f3 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -56,6 +56,10 @@
 from tempest.services.object_storage.account_client import AccountClient
 from tempest.services.object_storage.container_client import ContainerClient
 from tempest.services.object_storage.object_client import ObjectClient
+from tempest.services.volume.json.admin.volume_types_client import \
+    VolumeTypesClientJSON
+from tempest.services.volume.xml.admin.volume_types_client import \
+    VolumeTypesClientXML
 from tempest.services.volume.json.snapshots_client import SnapshotsClientJSON
 from tempest.services.volume.json.volumes_client import VolumesClientJSON
 from tempest.services.volume.xml.snapshots_client import SnapshotsClientXML
@@ -122,6 +126,11 @@
     "xml": VolumesClientXML,
 }
 
+VOLUME_TYPES_CLIENTS = {
+    "json": VolumeTypesClientJSON,
+    "xml": VolumeTypesClientXML,
+}
+
 IDENTITY_CLIENT = {
     "json": IdentityClientJSON,
     "xml": IdentityClientXML,
@@ -192,6 +201,8 @@
             self.floating_ips_client = FLOAT_CLIENTS[interface](*client_args)
             self.snapshots_client = SNAPSHOTS_CLIENTS[interface](*client_args)
             self.volumes_client = VOLUMES_CLIENTS[interface](*client_args)
+            self.volume_types_client = \
+                VOLUME_TYPES_CLIENTS[interface](*client_args)
             self.identity_client = IDENTITY_CLIENT[interface](*client_args)
             self.token_client = TOKEN_CLIENT[interface](self.config)
             self.security_groups_client = \
diff --git a/tempest/openstack/common/cfg.py b/tempest/openstack/common/cfg.py
index 1bbfe6a..08d9b47 100644
--- a/tempest/openstack/common/cfg.py
+++ b/tempest/openstack/common/cfg.py
@@ -217,7 +217,7 @@
         ...
      ]
 
-This module also contains a global instance of the CommonConfigOpts class
+This module also contains a global instance of the ConfigOpts class
 in order to support a common usage pattern in OpenStack::
 
     from tempest.openstack.common import cfg
@@ -236,10 +236,11 @@
 Positional command line arguments are supported via a 'positional' Opt
 constructor argument::
 
-    >>> CONF.register_cli_opt(MultiStrOpt('bar', positional=True))
+    >>> conf = ConfigOpts()
+    >>> conf.register_cli_opt(MultiStrOpt('bar', positional=True))
     True
-    >>> CONF(['a', 'b'])
-    >>> CONF.bar
+    >>> conf(['a', 'b'])
+    >>> conf.bar
     ['a', 'b']
 
 It is also possible to use argparse "sub-parsers" to parse additional
@@ -249,10 +250,11 @@
     ...     list_action = subparsers.add_parser('list')
     ...     list_action.add_argument('id')
     ...
-    >>> CONF.register_cli_opt(SubCommandOpt('action', handler=add_parsers))
+    >>> conf = ConfigOpts()
+    >>> conf.register_cli_opt(SubCommandOpt('action', handler=add_parsers))
     True
-    >>> CONF(['list', '10'])
-    >>> CONF.action.name, CONF.action.id
+    >>> conf(args=['list', '10'])
+    >>> conf.action.name, conf.action.id
     ('list', '10')
 
 """
@@ -861,7 +863,7 @@
                                            description=self.description,
                                            help=self.help)
 
-        if not self.handler is None:
+        if self.handler is not None:
             self.handler(subparsers)
 
 
@@ -1295,6 +1297,24 @@
         __import__(module_str)
         self._get_opt_info(name, group)
 
+    def import_group(self, group, module_str):
+        """Import an option group from a module.
+
+        Import a module and check that a given option group is registered.
+
+        This is intended for use with global configuration objects
+        like cfg.CONF where modules commonly register options with
+        CONF at module load time. If one module requires an option group
+        defined by another module it can use this method to explicitly
+        declare the dependency.
+
+        :param group: an option OptGroup object or group name
+        :param module_str: the name of a module to import
+        :raises: ImportError, NoSuchGroupError
+        """
+        __import__(module_str)
+        self._get_group(group)
+
     @__clear_cache
     def set_override(self, name, override, group=None):
         """Override an opt value.
@@ -1417,7 +1437,7 @@
         logger.log(lvl, "=" * 80)
 
         def _sanitize(opt, value):
-            """Obfuscate values of options declared secret."""
+            """Obfuscate values of options declared secret"""
             return value if not opt.secret else '*' * len(str(value))
 
         for opt_name in sorted(self._opts):
@@ -1545,8 +1565,8 @@
         group = group_or_name if isinstance(group_or_name, OptGroup) else None
         group_name = group.name if group else group_or_name
 
-        if not group_name in self._groups:
-            if not group is None or not autocreate:
+        if group_name not in self._groups:
+            if group is not None or not autocreate:
                 raise NoSuchGroupError(group_name)
 
             self.register_group(OptGroup(name=group_name))
@@ -1566,7 +1586,7 @@
             group = self._get_group(group)
             opts = group._opts
 
-        if not opt_name in opts:
+        if opt_name not in opts:
             raise NoSuchOptError(opt_name, group)
 
         return opts[opt_name]
@@ -1604,7 +1624,7 @@
             opt = info['opt']
 
             if opt.required:
-                if ('default' in info or 'override' in info):
+                if 'default' in info or 'override' in info:
                     continue
 
                 if self._get(opt.dest, group) is None:
@@ -1623,7 +1643,7 @@
         """
         self._args = args
 
-        for opt, group in self._all_cli_opts():
+        for opt, group in sorted(self._all_cli_opts()):
             opt._add_to_cli(self._oparser, group)
 
         return vars(self._oparser.parse_args(args))
@@ -1726,62 +1746,4 @@
             return value
 
 
-class CommonConfigOpts(ConfigOpts):
-
-    DEFAULT_LOG_FORMAT = "%(asctime)s %(levelname)8s [%(name)s] %(message)s"
-    DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
-
-    common_cli_opts = [
-        BoolOpt('debug',
-                short='d',
-                default=False,
-                help='Print debugging output'),
-        BoolOpt('verbose',
-                short='v',
-                default=False,
-                help='Print more verbose output'),
-    ]
-
-    logging_cli_opts = [
-        StrOpt('log-config',
-               metavar='PATH',
-               help='If this option is specified, the logging configuration '
-                    'file specified is used and overrides any other logging '
-                    'options specified. Please see the Python logging module '
-                    'documentation for details on logging configuration '
-                    'files.'),
-        StrOpt('log-format',
-               default=DEFAULT_LOG_FORMAT,
-               metavar='FORMAT',
-               help='A logging.Formatter log message format string which may '
-                    'use any of the available logging.LogRecord attributes. '
-                    'Default: %(default)s'),
-        StrOpt('log-date-format',
-               default=DEFAULT_LOG_DATE_FORMAT,
-               metavar='DATE_FORMAT',
-               help='Format string for %%(asctime)s in log records. '
-                    'Default: %(default)s'),
-        StrOpt('log-file',
-               metavar='PATH',
-               deprecated_name='logfile',
-               help='(Optional) Name of log file to output to. '
-                    'If not set, logging will go to stdout.'),
-        StrOpt('log-dir',
-               deprecated_name='logdir',
-               help='(Optional) The directory to keep log files in '
-                    '(will be prepended to --log-file)'),
-        BoolOpt('use-syslog',
-                default=False,
-                help='Use syslog for logging.'),
-        StrOpt('syslog-log-facility',
-               default='LOG_USER',
-               help='syslog facility to receive log lines')
-    ]
-
-    def __init__(self):
-        super(CommonConfigOpts, self).__init__()
-        self.register_cli_opts(self.common_cli_opts)
-        self.register_cli_opts(self.logging_cli_opts)
-
-
-CONF = CommonConfigOpts()
+CONF = ConfigOpts()
diff --git a/tempest/openstack/common/iniparser.py b/tempest/openstack/common/iniparser.py
index b5cb604..9bf399f 100644
--- a/tempest/openstack/common/iniparser.py
+++ b/tempest/openstack/common/iniparser.py
@@ -54,7 +54,7 @@
 
         value = value.strip()
         if ((value and value[0] == value[-1]) and
-            (value[0] == "\"" or value[0] == "'")):
+                (value[0] == "\"" or value[0] == "'")):
             value = value[1:-1]
         return key.strip(), [value]
 
@@ -100,15 +100,15 @@
             self._assignment(key, value)
 
     def assignment(self, key, value):
-        """Called when a full assignment is parsed."""
+        """Called when a full assignment is parsed"""
         raise NotImplementedError()
 
     def new_section(self, section):
-        """Called when a new section is started."""
+        """Called when a new section is started"""
         raise NotImplementedError()
 
     def comment(self, comment):
-        """Called when a comment is parsed."""
+        """Called when a comment is parsed"""
         pass
 
     def error_invalid_assignment(self, line):
diff --git a/tempest/openstack/common/setup.py b/tempest/openstack/common/setup.py
index e6f72f0..35680b3 100644
--- a/tempest/openstack/common/setup.py
+++ b/tempest/openstack/common/setup.py
@@ -1,6 +1,7 @@
 # vim: tabstop=4 shiftwidth=4 softtabstop=4
 
 # Copyright 2011 OpenStack LLC.
+# Copyright 2012-2013 Hewlett-Packard Development Company, L.P.
 # All Rights Reserved.
 #
 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -19,7 +20,7 @@
 Utilities with minimum-depends for use in setup.py
 """
 
-import datetime
+import email
 import os
 import re
 import subprocess
@@ -33,11 +34,12 @@
     if os.path.exists(mailmap):
         with open(mailmap, 'r') as fp:
             for l in fp:
-                l = l.strip()
-                if not l.startswith('#') and ' ' in l:
-                    canonical_email, alias = [x for x in l.split(' ')
-                                              if x.startswith('<')]
-                    mapping[alias] = canonical_email
+                try:
+                    canonical_email, alias = re.match(
+                        r'[^#]*?(<.+>).*(<.+>).*', l).groups()
+                except AttributeError:
+                    continue
+                mapping[alias] = canonical_email
     return mapping
 
 
@@ -45,8 +47,8 @@
     """Takes in a string and an email alias mapping and replaces all
        instances of the aliases in the string with their real email.
     """
-    for alias, email in mapping.iteritems():
-        changelog = changelog.replace(alias, email)
+    for alias, email_address in mapping.iteritems():
+        changelog = changelog.replace(alias, email_address)
     return changelog
 
 
@@ -106,23 +108,17 @@
     return dependency_links
 
 
-def write_requirements():
-    venv = os.environ.get('VIRTUAL_ENV', None)
-    if venv is not None:
-        with open("requirements.txt", "w") as req_file:
-            output = subprocess.Popen(["pip", "-E", venv, "freeze", "-l"],
-                                      stdout=subprocess.PIPE)
-            requirements = output.communicate()[0].strip()
-            req_file.write(requirements)
-
-
-def _run_shell_command(cmd):
+def _run_shell_command(cmd, throw_on_error=False):
     if os.name == 'nt':
         output = subprocess.Popen(["cmd.exe", "/C", cmd],
-                                  stdout=subprocess.PIPE)
+                                  stdout=subprocess.PIPE,
+                                  stderr=subprocess.PIPE)
     else:
         output = subprocess.Popen(["/bin/sh", "-c", cmd],
-                                  stdout=subprocess.PIPE)
+                                  stdout=subprocess.PIPE,
+                                  stderr=subprocess.PIPE)
+    if output.returncode and throw_on_error:
+        raise Exception("%s returned %d" % cmd, output.returncode)
     out = output.communicate()
     if len(out) == 0:
         return None
@@ -131,57 +127,6 @@
     return out[0].strip()
 
 
-def _get_git_next_version_suffix(branch_name):
-    datestamp = datetime.datetime.now().strftime('%Y%m%d')
-    if branch_name == 'milestone-proposed':
-        revno_prefix = "r"
-    else:
-        revno_prefix = ""
-    _run_shell_command("git fetch origin +refs/meta/*:refs/remotes/meta/*")
-    milestone_cmd = "git show meta/openstack/release:%s" % branch_name
-    milestonever = _run_shell_command(milestone_cmd)
-    if milestonever:
-        first_half = "%s~%s" % (milestonever, datestamp)
-    else:
-        first_half = datestamp
-
-    post_version = _get_git_post_version()
-    # post version should look like:
-    # 0.1.1.4.gcc9e28a
-    # where the bit after the last . is the short sha, and the bit between
-    # the last and second to last is the revno count
-    (revno, sha) = post_version.split(".")[-2:]
-    second_half = "%s%s.%s" % (revno_prefix, revno, sha)
-    return ".".join((first_half, second_half))
-
-
-def _get_git_current_tag():
-    return _run_shell_command("git tag --contains HEAD")
-
-
-def _get_git_tag_info():
-    return _run_shell_command("git describe --tags")
-
-
-def _get_git_post_version():
-    current_tag = _get_git_current_tag()
-    if current_tag is not None:
-        return current_tag
-    else:
-        tag_info = _get_git_tag_info()
-        if tag_info is None:
-            base_version = "0.0"
-            cmd = "git --no-pager log --oneline"
-            out = _run_shell_command(cmd)
-            revno = len(out.split("\n"))
-            sha = _run_shell_command("git describe --always")
-        else:
-            tag_infos = tag_info.split("-")
-            base_version = "-".join(tag_infos[:-2])
-            (revno, sha) = tag_infos[-2:]
-        return "%s.%s.%s" % (base_version, revno, sha)
-
-
 def write_git_changelog():
     """Write a changelog based on the git changelog."""
     new_changelog = 'ChangeLog'
@@ -227,26 +172,6 @@
 """
 
 
-def read_versioninfo(project):
-    """Read the versioninfo file. If it doesn't exist, we're in a github
-       zipball, and there's really no way to know what version we really
-       are, but that should be ok, because the utility of that should be
-       just about nil if this code path is in use in the first place."""
-    versioninfo_path = os.path.join(project, 'versioninfo')
-    if os.path.exists(versioninfo_path):
-        with open(versioninfo_path, 'r') as vinfo:
-            version = vinfo.read().strip()
-    else:
-        version = "0.0.0"
-    return version
-
-
-def write_versioninfo(project, version):
-    """Write a simple file containing the version of the package."""
-    with open(os.path.join(project, 'versioninfo'), 'w') as fil:
-        fil.write("%s\n" % version)
-
-
 def get_cmdclass():
     """Return dict of commands to run from setup.py."""
 
@@ -276,6 +201,9 @@
         from sphinx.setup_command import BuildDoc
 
         class LocalBuildDoc(BuildDoc):
+
+            builders = ['html', 'man']
+
             def generate_autoindex(self):
                 print "**Autodocumenting from %s" % os.path.abspath(os.curdir)
                 modules = {}
@@ -311,56 +239,97 @@
                 if not os.getenv('SPHINX_DEBUG'):
                     self.generate_autoindex()
 
-                for builder in ['html', 'man']:
+                for builder in self.builders:
                     self.builder = builder
                     self.finalize_options()
                     self.project = self.distribution.get_name()
                     self.version = self.distribution.get_version()
                     self.release = self.distribution.get_version()
                     BuildDoc.run(self)
+
+        class LocalBuildLatex(LocalBuildDoc):
+            builders = ['latex']
+
         cmdclass['build_sphinx'] = LocalBuildDoc
+        cmdclass['build_sphinx_latex'] = LocalBuildLatex
     except ImportError:
         pass
 
     return cmdclass
 
 
-def get_git_branchname():
-    for branch in _run_shell_command("git branch --color=never").split("\n"):
-        if branch.startswith('*'):
-            _branch_name = branch.split()[1].strip()
-    if _branch_name == "(no":
-        _branch_name = "no-branch"
-    return _branch_name
+def _get_revno():
+    """Return the number of commits since the most recent tag.
+
+    We use git-describe to find this out, but if there are no
+    tags then we fall back to counting commits since the beginning
+    of time.
+    """
+    describe = _run_shell_command("git describe --always")
+    if "-" in describe:
+        return describe.rsplit("-", 2)[-2]
+
+    # no tags found
+    revlist = _run_shell_command("git rev-list --abbrev-commit HEAD")
+    return len(revlist.splitlines())
 
 
-def get_pre_version(projectname, base_version):
-    """Return a version which is leading up to a version that will
-       be released in the future."""
-    if os.path.isdir('.git'):
-        current_tag = _get_git_current_tag()
-        if current_tag is not None:
-            version = current_tag
-        else:
-            branch_name = os.getenv('BRANCHNAME',
-                                    os.getenv('GERRIT_REFNAME',
-                                              get_git_branchname()))
-            version_suffix = _get_git_next_version_suffix(branch_name)
-            version = "%s~%s" % (base_version, version_suffix)
-        write_versioninfo(projectname, version)
-        return version
-    else:
-        version = read_versioninfo(projectname)
-    return version
-
-
-def get_post_version(projectname):
+def _get_version_from_git(pre_version):
     """Return a version which is equal to the tag that's on the current
     revision if there is one, or tag plus number of additional revisions
     if the current revision has no tag."""
 
     if os.path.isdir('.git'):
-        version = _get_git_post_version()
-        write_versioninfo(projectname, version)
+        if pre_version:
+            try:
+                return _run_shell_command(
+                    "git describe --exact-match",
+                    throw_on_error=True).replace('-', '.')
+            except Exception:
+                sha = _run_shell_command("git log -n1 --pretty=format:%h")
+                return "%s.a%s.g%s" % (pre_version, _get_revno(), sha)
+        else:
+            return _run_shell_command(
+                "git describe --always").replace('-', '.')
+    return None
+
+
+def _get_version_from_pkg_info(package_name):
+    """Get the version from PKG-INFO file if we can."""
+    try:
+        pkg_info_file = open('PKG-INFO', 'r')
+    except (IOError, OSError):
+        return None
+    try:
+        pkg_info = email.message_from_file(pkg_info_file)
+    except email.MessageError:
+        return None
+    # Check to make sure we're in our own dir
+    if pkg_info.get('Name', None) != package_name:
+        return None
+    return pkg_info.get('Version', None)
+
+
+def get_version(package_name, pre_version=None):
+    """Get the version of the project. First, try getting it from PKG-INFO, if
+    it exists. If it does, that means we're in a distribution tarball or that
+    install has happened. Otherwise, if there is no PKG-INFO file, pull the
+    version from git.
+
+    We do not support setup.py version sanity in git archive tarballs, nor do
+    we support packagers directly sucking our git repo into theirs. We expect
+    that a source tarball be made from our git repo - or that if someone wants
+    to make a source tarball from a fork of our repo with additional tags in it
+    that they understand and desire the results of doing that.
+    """
+    version = os.environ.get("OSLO_PACKAGE_VERSION", None)
+    if version:
         return version
-    return read_versioninfo(projectname)
+    version = _get_version_from_pkg_info(package_name)
+    if version:
+        return version
+    version = _get_version_from_git(pre_version)
+    if version:
+        return version
+    raise Exception("Versioning for this project requires either an sdist"
+                    " tarball, or access to an upstream git repository.")
diff --git a/tempest/tests/volume/admin/base.py b/tempest/tests/volume/admin/base.py
deleted file mode 100644
index 21425be..0000000
--- a/tempest/tests/volume/admin/base.py
+++ /dev/null
@@ -1,65 +0,0 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright 2012 OpenStack, LLC
-# 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 import config
-import tempest.services.volume.json.admin.volume_types_client \
-        as volume_types_json_client
-import tempest.services.volume.xml.admin.volume_types_client \
-        as volume_types_xml_client
-from tempest.tests.volume.base import BaseVolumeTest
-
-
-class BaseVolumeAdminTest(BaseVolumeTest):
-    """Base test case class for all Volume Admin API tests."""
-    @classmethod
-    def setUpClass(cls):
-        super(BaseVolumeAdminTest, cls).setUpClass()
-        cls.config = config.TempestConfig()
-        cls.adm_user = cls.config.identity.admin_username
-        cls.adm_pass = cls.config.identity.admin_password
-        cls.adm_tenant = cls.config.identity.admin_tenant_name
-        cls.auth_url = cls.config.identity.uri
-
-        if not cls.adm_user and cls.adm_pass and cls.adm_tenant:
-            msg = ("Missing Volume Admin API credentials "
-                   "in configuration.")
-            raise cls.skipException(msg)
-
-    @classmethod
-    def tearDownClass(cls):
-        super(BaseVolumeAdminTest, cls).tearDownClass()
-
-
-class BaseVolumeAdminTestJSON(BaseVolumeAdminTest):
-    @classmethod
-    def setUpClass(cls):
-        cls._interface = "json"
-        super(BaseVolumeAdminTestJSON, cls).setUpClass()
-        cls.client = volume_types_json_client.\
-        VolumeTypesClientJSON(cls.config, cls.adm_user, cls.adm_pass,
-                              cls.auth_url, cls.adm_tenant)
-
-
-class BaseVolumeAdminTestXML(BaseVolumeAdminTest):
-    @classmethod
-    def setUpClass(cls):
-        cls._interface = "xml"
-        super(BaseVolumeAdminTestXML, cls).setUpClass()
-        cls.client = volume_types_xml_client.\
-        VolumeTypesClientXML(cls.config, cls.adm_user, cls.adm_pass,
-                             cls.auth_url, cls.adm_tenant)
diff --git a/tempest/tests/volume/admin/test_volume_types_extra_specs.py b/tempest/tests/volume/admin/test_volume_types_extra_specs.py
index f19cd7b..31e2879 100644
--- a/tempest/tests/volume/admin/test_volume_types_extra_specs.py
+++ b/tempest/tests/volume/admin/test_volume_types_extra_specs.py
@@ -16,28 +16,15 @@
 #    under the License.
 
 from tempest.common.utils.data_utils import rand_name
-from tempest.services.volume.json.admin import volume_types_client
-from tempest.tests.volume.base import BaseVolumeTest
+from tempest.tests.volume import base
 
 
-class VolumeTypesExtraSpecsTest(BaseVolumeTest):
+class VolumeTypesExtraSpecsTest(base.BaseVolumeAdminTest):
     _interface = "json"
 
     @classmethod
     def setUpClass(cls):
         super(VolumeTypesExtraSpecsTest, cls).setUpClass()
-
-        adm_user = cls.config.identity.admin_username
-        adm_pass = cls.config.identity.admin_password
-        adm_tenant = cls.config.identity.admin_tenant_name
-        auth_url = cls.config.identity.uri
-
-        cls.client = volume_types_client.VolumeTypesClientJSON(cls.config,
-                                                               adm_user,
-                                                               adm_pass,
-                                                               auth_url,
-                                                               adm_tenant)
-
         vol_type_name = rand_name('Volume-type-')
         resp, cls.volume_type = cls.client.create_volume_type(vol_type_name)
 
diff --git a/tempest/tests/volume/admin/test_volume_types_extra_specs_negative.py b/tempest/tests/volume/admin/test_volume_types_extra_specs_negative.py
index 9aa8409..e201853 100644
--- a/tempest/tests/volume/admin/test_volume_types_extra_specs_negative.py
+++ b/tempest/tests/volume/admin/test_volume_types_extra_specs_negative.py
@@ -20,23 +20,24 @@
 
 from tempest.common.utils.data_utils import rand_name
 from tempest import exceptions
-from tempest.tests.volume.admin.base import BaseVolumeAdminTestJSON
-from tempest.tests.volume.admin.base import BaseVolumeAdminTestXML
+from tempest.tests.volume import base
 
 
-class ExtraSpecsNegativeTestBase():
+class ExtraSpecsNegativeTest(base.BaseVolumeAdminTest):
+    _interface = 'json'
 
-    @staticmethod
+    @classmethod
     def setUpClass(cls):
-        cls.client = cls.client
+        super(ExtraSpecsNegativeTest, cls).setUpClass()
         vol_type_name = rand_name('Volume-type-')
         cls.extra_specs = {"spec1": "val1"}
         resp, cls.volume_type = cls.client.create_volume_type(vol_type_name,
                                                               extra_specs=
                                                               cls.extra_specs)
 
-    @staticmethod
+    @classmethod
     def tearDownClass(cls):
+        super(ExtraSpecsNegativeTest, cls).tearDownClass()
         cls.client.delete_volume_type(cls.volume_type['id'])
 
     @testtools.skip('Until bug 1090320 is fixed')
@@ -122,29 +123,5 @@
                           self.volume_type['id'], str(uuid.uuid4()))
 
 
-class ExtraSpecsNegativeTestXML(BaseVolumeAdminTestXML,
-                                ExtraSpecsNegativeTestBase):
-
-    @classmethod
-    def setUpClass(cls):
-        super(ExtraSpecsNegativeTestXML, cls).setUpClass()
-        ExtraSpecsNegativeTestBase.setUpClass(cls)
-
-    @classmethod
-    def tearDownClass(cls):
-        super(ExtraSpecsNegativeTestXML, cls).tearDownClass()
-        ExtraSpecsNegativeTestBase.tearDownClass(cls)
-
-
-class ExtraSpecsNegativeTestJSON(BaseVolumeAdminTestJSON,
-                                 ExtraSpecsNegativeTestBase):
-
-    @classmethod
-    def setUpClass(cls):
-        super(ExtraSpecsNegativeTestJSON, cls).setUpClass()
-        ExtraSpecsNegativeTestBase.setUpClass(cls)
-
-    @classmethod
-    def tearDownClass(cls):
-        super(ExtraSpecsNegativeTestJSON, cls).tearDownClass()
-        ExtraSpecsNegativeTestBase.tearDownClass(cls)
+class ExtraSpecsNegativeTestXML(ExtraSpecsNegativeTest):
+    _interface = 'xml'
diff --git a/tempest/tests/volume/admin/test_volume_types_negative.py b/tempest/tests/volume/admin/test_volume_types_negative.py
index 8e7fa23..c706f3d 100644
--- a/tempest/tests/volume/admin/test_volume_types_negative.py
+++ b/tempest/tests/volume/admin/test_volume_types_negative.py
@@ -19,15 +19,11 @@
 import uuid
 
 from tempest import exceptions
-from tempest.tests.volume.admin.base import BaseVolumeAdminTestJSON
-from tempest.tests.volume.admin.base import BaseVolumeAdminTestXML
+from tempest.tests.volume import base
 
 
-class VolumeTypesNegativeTestBase():
-
-    @staticmethod
-    def setUpClass(cls):
-        cls.client = cls.client
+class VolumeTypesNegativeTest(base.BaseVolumeAdminTest):
+    _interface = 'json'
 
     def test_create_with_nonexistent_volume_type(self):
         # Should not be able to create volume with nonexistent volume_type.
@@ -53,17 +49,5 @@
                           str(uuid.uuid4()))
 
 
-class VolumesTypesNegativeTestXML(BaseVolumeAdminTestXML,
-                                  VolumeTypesNegativeTestBase):
-    @classmethod
-    def setUpClass(cls):
-        super(VolumesTypesNegativeTestXML, cls).setUpClass()
-        VolumeTypesNegativeTestBase.setUpClass(cls)
-
-
-class VolumesTypesNegativeTestJSON(BaseVolumeAdminTestJSON,
-                                   VolumeTypesNegativeTestBase):
-    @classmethod
-    def setUpClass(cls):
-        super(VolumesTypesNegativeTestJSON, cls).setUpClass()
-        VolumeTypesNegativeTestBase.setUpClass(cls)
+class VolumesTypesNegativeTestXML(VolumeTypesNegativeTest):
+    _interface = 'xml'
diff --git a/tempest/tests/volume/base.py b/tempest/tests/volume/base.py
index c91244f..4ddd670 100644
--- a/tempest/tests/volume/base.py
+++ b/tempest/tests/volume/base.py
@@ -193,15 +193,18 @@
             time.sleep(self.build_interval)
 
 
-class BaseVolumeTestJSON(BaseVolumeTest):
+class BaseVolumeAdminTest(BaseVolumeTest):
+    """Base test case class for all Volume Admin API tests."""
     @classmethod
     def setUpClass(cls):
-        cls._interface = "json"
-        super(BaseVolumeTestJSON, cls).setUpClass()
+        super(BaseVolumeAdminTest, cls).setUpClass()
+        cls.adm_user = cls.config.identity.admin_username
+        cls.adm_pass = cls.config.identity.admin_password
+        cls.adm_tenant = cls.config.identity.admin_tenant_name
+        if not all((cls.adm_user, cls.adm_pass, cls.adm_tenant)):
+            msg = ("Missing Volume Admin API credentials "
+                   "in configuration.")
+            raise cls.skipException(msg)
 
-
-class BaseVolumeTestXML(BaseVolumeTest):
-    @classmethod
-    def setUpClass(cls):
-        cls._interface = "xml"
-        super(BaseVolumeTestXML, cls).setUpClass()
+        cls.os_adm = clients.AdminManager(interface=cls._interface)
+        cls.client = cls.os_adm.volume_types_client
diff --git a/tempest/tests/volume/test_volumes_get.py b/tempest/tests/volume/test_volumes_get.py
index bd271ed..a246afe 100644
--- a/tempest/tests/volume/test_volumes_get.py
+++ b/tempest/tests/volume/test_volumes_get.py
@@ -20,7 +20,14 @@
 from tempest.tests.volume import base
 
 
-class VolumesGetTestBase(object):
+class VolumesGetTest(base.BaseVolumeTest):
+
+    _interface = "json"
+
+    @classmethod
+    def setUpClass(cls):
+        super(VolumesGetTest, cls).setUpClass()
+        cls.client = cls.volumes_client
 
     @attr(type='smoke')
     def test_volume_create_get_delete(self):
@@ -94,17 +101,5 @@
                 self.client.wait_for_resource_deletion(volume['id'])
 
 
-class VolumesGetTestXML(base.BaseVolumeTestXML, VolumesGetTestBase):
-    @classmethod
-    def setUpClass(cls):
-        cls._interface = "xml"
-        super(VolumesGetTestXML, cls).setUpClass()
-        cls.client = cls.volumes_client
-
-
-class VolumesGetTestJSON(base.BaseVolumeTestJSON, VolumesGetTestBase):
-    @classmethod
-    def setUpClass(cls):
-        cls._interface = "json"
-        super(VolumesGetTestJSON, cls).setUpClass()
-        cls.client = cls.volumes_client
+class VolumesGetTestXML(VolumesGetTest):
+    _interface = "xml"
diff --git a/tempest/tests/volume/test_volumes_list.py b/tempest/tests/volume/test_volumes_list.py
index 64691d4..a8fedb9 100644
--- a/tempest/tests/volume/test_volumes_list.py
+++ b/tempest/tests/volume/test_volumes_list.py
@@ -20,7 +20,7 @@
 from tempest.tests.volume import base
 
 
-class VolumesListTestBase(object):
+class VolumesListTest(base.BaseVolumeTest):
 
     """
     This test creates a number of 1G volumes. To run successfully,
@@ -30,6 +30,52 @@
     VOLUME_BACKING_FILE_SIZE is atleast 4G in your localrc
     """
 
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(VolumesListTest, cls).setUpClass()
+        cls.client = cls.volumes_client
+
+        # Create 3 test volumes
+        cls.volume_list = []
+        cls.volume_id_list = []
+        for i in range(3):
+            v_name = rand_name('volume')
+            metadata = {'Type': 'work'}
+            try:
+                resp, volume = cls.client.create_volume(size=1,
+                                                        display_name=v_name,
+                                                        metadata=metadata)
+                cls.client.wait_for_volume_status(volume['id'], 'available')
+                resp, volume = cls.client.get_volume(volume['id'])
+                cls.volume_list.append(volume)
+                cls.volume_id_list.append(volume['id'])
+            except Exception:
+                if cls.volume_list:
+                    # We could not create all the volumes, though we were able
+                    # to create *some* of the volumes. This is typically
+                    # because the backing file size of the volume group is
+                    # too small. So, here, we clean up whatever we did manage
+                    # to create and raise a SkipTest
+                    for volid in cls.volume_id_list:
+                        cls.client.delete_volume(volid)
+                        cls.client.wait_for_resource_deletion(volid)
+                    msg = ("Failed to create ALL necessary volumes to run "
+                           "test. This typically means that the backing file "
+                           "size of the nova-volumes group is too small to "
+                           "create the 3 volumes needed by this test case")
+                    raise cls.skipException(msg)
+                raise
+
+    @classmethod
+    def tearDownClass(cls):
+        # Delete the created volumes
+        for volid in cls.volume_id_list:
+            resp, _ = cls.client.delete_volume(volid)
+            cls.client.wait_for_resource_deletion(volid)
+        super(VolumesListTest, cls).tearDownClass()
+
     @attr(type='smoke')
     def test_volume_list(self):
         # Get a list of Volumes
@@ -57,95 +103,5 @@
                                    for m_vol in missing_vols))
 
 
-class VolumeListTestXML(base.BaseVolumeTestXML, VolumesListTestBase):
-    @classmethod
-    def setUpClass(cls):
-        cls._interface = 'xml'
-        super(VolumeListTestXML, cls).setUpClass()
-        cls.client = cls.volumes_client
-
-        # Create 3 test volumes
-        cls.volume_list = []
-        cls.volume_id_list = []
-        for i in range(3):
-            v_name = rand_name('volume')
-            metadata = {'Type': 'work'}
-            try:
-                resp, volume = cls.client.create_volume(size=1,
-                                                        display_name=v_name,
-                                                        metadata=metadata)
-                cls.client.wait_for_volume_status(volume['id'], 'available')
-                resp, volume = cls.client.get_volume(volume['id'])
-                cls.volume_list.append(volume)
-                cls.volume_id_list.append(volume['id'])
-            except Exception:
-                if cls.volume_list:
-                    # We could not create all the volumes, though we were able
-                    # to create *some* of the volumes. This is typically
-                    # because the backing file size of the volume group is
-                    # too small. So, here, we clean up whatever we did manage
-                    # to create and raise a SkipTest
-                    for volid in cls.volume_id_list:
-                        cls.client.delete_volume(volid)
-                        cls.client.wait_for_resource_deletion(volid)
-                    msg = ("Failed to create ALL necessary volumes to run "
-                           "test. This typically means that the backing file "
-                           "size of the nova-volumes group is too small to "
-                           "create the 3 volumes needed by this test case")
-                    raise cls.skipException(msg)
-                raise
-
-    @classmethod
-    def tearDownClass(cls):
-        # Delete the created volumes
-        for volid in cls.volume_id_list:
-            resp, _ = cls.client.delete_volume(volid)
-            cls.client.wait_for_resource_deletion(volid)
-        super(VolumeListTestXML, cls).tearDownClass()
-
-
-class VolumeListTestJSON(base.BaseVolumeTestJSON, VolumesListTestBase):
-    @classmethod
-    def setUpClass(cls):
-        cls._interface = 'json'
-        super(VolumeListTestJSON, cls).setUpClass()
-        cls.client = cls.volumes_client
-
-        # Create 3 test volumes
-        cls.volume_list = []
-        cls.volume_id_list = []
-        for i in range(3):
-            v_name = rand_name('volume')
-            metadata = {'Type': 'work'}
-            try:
-                resp, volume = cls.client.create_volume(size=1,
-                                                        display_name=v_name,
-                                                        metadata=metadata)
-                cls.client.wait_for_volume_status(volume['id'], 'available')
-                resp, volume = cls.client.get_volume(volume['id'])
-                cls.volume_list.append(volume)
-                cls.volume_id_list.append(volume['id'])
-            except Exception:
-                if cls.volume_list:
-                    # We could not create all the volumes, though we were able
-                    # to create *some* of the volumes. This is typically
-                    # because the backing file size of the volume group is
-                    # too small. So, here, we clean up whatever we did manage
-                    # to create and raise a SkipTest
-                    for volid in cls.volume_id_list:
-                        cls.client.delete_volume(volid)
-                        cls.client.wait_for_resource_deletion(volid)
-                    msg = ("Failed to create ALL necessary volumes to run "
-                           "test. This typically means that the backing file "
-                           "size of the nova-volumes group is too small to "
-                           "create the 3 volumes needed by this test case")
-                    raise cls.skipException(msg)
-                raise
-
-    @classmethod
-    def tearDownClass(cls):
-        # Delete the created volumes
-        for volid in cls.volume_id_list:
-            resp, _ = cls.client.delete_volume(volid)
-            cls.client.wait_for_resource_deletion(volid)
-        super(VolumeListTestJSON, cls).tearDownClass()
+class VolumeListTestXML(VolumesListTest):
+    _interface = 'xml'
diff --git a/tempest/tests/volume/test_volumes_negative.py b/tempest/tests/volume/test_volumes_negative.py
index dc1fad0..c7d4374 100644
--- a/tempest/tests/volume/test_volumes_negative.py
+++ b/tempest/tests/volume/test_volumes_negative.py
@@ -20,7 +20,13 @@
 from tempest.tests.volume import base
 
 
-class VolumesNegativeTestBase(object):
+class VolumesNegativeTest(base.BaseVolumeTest):
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(VolumesNegativeTest, cls).setUpClass()
+        cls.client = cls.volumes_client
 
     def test_volume_get_nonexistant_volume_id(self):
         # Should not be able to get a nonexistant volume
@@ -94,16 +100,5 @@
         self.assertRaises(exceptions.NotFound, self.client.delete_volume, '')
 
 
-class VolumesNegativeTestXML(base.BaseVolumeTestXML, VolumesNegativeTestBase):
-    @classmethod
-    def setUpClass(cls):
-        super(VolumesNegativeTestXML, cls).setUpClass()
-        cls.client = cls.volumes_client
-
-
-class VolumesNegativeTestJSON(base.BaseVolumeTestJSON,
-                              VolumesNegativeTestBase):
-    @classmethod
-    def setUpClass(cls):
-        super(VolumesNegativeTestJSON, cls).setUpClass()
-        cls.client = cls.volumes_client
+class VolumesNegativeTestXML(VolumesNegativeTest):
+    _interface = 'xml'
diff --git a/tempest/tests/volume/test_volumes_snapshots.py b/tempest/tests/volume/test_volumes_snapshots.py
index 3acc5f6..e7fa97d 100644
--- a/tempest/tests/volume/test_volumes_snapshots.py
+++ b/tempest/tests/volume/test_volumes_snapshots.py
@@ -15,7 +15,8 @@
 from tempest.tests.volume import base
 
 
-class VolumesSnapshotTestBase(object):
+class VolumesSnapshotTest(base.BaseVolumeTest):
+    _interface = "json"
 
     def test_volume_from_snapshot(self):
         volume_origin = self.create_volume(size=1)
@@ -24,29 +25,15 @@
                                          snapshot_id=
                                          snapshot['id'])
         self.snapshots_client.delete_snapshot(snapshot['id'])
-        self.client.delete_volume(volume_snap['id'])
+        self.volumes_client.delete_volume(volume_snap['id'])
         self.snapshots_client.wait_for_resource_deletion(snapshot['id'])
         self.snapshots.remove(snapshot)
-        self.client.delete_volume(volume_origin['id'])
-        self.client.wait_for_resource_deletion(volume_snap['id'])
+        self.volumes_client.delete_volume(volume_origin['id'])
+        self.volumes_client.wait_for_resource_deletion(volume_snap['id'])
         self.volumes.remove(volume_snap)
-        self.client.wait_for_resource_deletion(volume_origin['id'])
+        self.volumes_client.wait_for_resource_deletion(volume_origin['id'])
         self.volumes.remove(volume_origin)
 
 
-class VolumesSnapshotTestXML(base.BaseVolumeTestXML,
-                             VolumesSnapshotTestBase):
-    @classmethod
-    def setUpClass(cls):
-        cls._interface = "xml"
-        super(VolumesSnapshotTestXML, cls).setUpClass()
-        cls.client = cls.volumes_client
-
-
-class VolumesSnapshotTestJSON(base.BaseVolumeTestJSON,
-                              VolumesSnapshotTestBase):
-    @classmethod
-    def setUpClass(cls):
-        cls._interface = "json"
-        super(VolumesSnapshotTestJSON, cls).setUpClass()
-        cls.client = cls.volumes_client
+class VolumesSnapshotTestXML(VolumesSnapshotTest):
+    _interface = "xml"
diff --git a/tools/install_venv_common.py b/tools/install_venv_common.py
index 8b676bf..8f91251 100644
--- a/tools/install_venv_common.py
+++ b/tools/install_venv_common.py
@@ -58,7 +58,7 @@
                               check_exit_code=True):
         """Runs a command in an out-of-process shell.
 
-        Returns the output of that command. Working directory is ROOT.
+        Returns the output of that command. Working directory is self.root.
         """
         if redirect_output:
             stdout = subprocess.PIPE
@@ -101,7 +101,7 @@
             else:
                 self.run_command(['virtualenv', '-q', self.venv])
             print 'done.'
-            print 'Installing pip in virtualenv...',
+            print 'Installing pip in venv...',
             if not self.run_command(['tools/with_venv.sh', 'easy_install',
                                     'pip>1.0']).strip():
                 self.die("Failed to install pip.")
