Merge "Addresses lp#942382 - refactor configuration for clarity"
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 7f39118..780e48d 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -1,27 +1,30 @@
-[nova]
+[identity]
+use_ssl=False
 host=127.0.0.1
 port=5000
-apiVer=v2.0
+api_version=v2.0
 path=tokens
 user=admin
-api_key=admin-key
+password=admin-password
 tenant_name=admin-project
+strategy=keystone
+
+[compute]
+# Reference data for tests. The ref and ref_alt should be
+# distinct images/flavors.
+image_ref=e7ddc02e-92fa-4f82-b36f-59b39bf66a67
+image_ref_alt=346f4039-a81e-44e0-9223-4a3d13c92a07
+flavor_ref=1
+flavor_ref_alt=2
 ssh_timeout=300
 build_interval=10
 build_timeout=600
 catalog_type=compute
+create_image_enabled=true
+resize_available=true
 
 [image]
 username=admin
 password=********
 tenant=admin
 auth_url=http://localhost:5000/v2.0
-
-[environment]
-image_ref=3
-image_ref_alt=4
-flavor_ref=1
-flavor_ref_alt=2
-create_image_enabled=true
-resize_available=true
-authentication=keystone_v2
diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py
index 7dd3a86..325d56b 100644
--- a/tempest/common/rest_client.py
+++ b/tempest/common/rest_client.py
@@ -12,29 +12,30 @@
 
 class RestClient(object):
 
-    def __init__(self, config, user, key, auth_url, service, tenant_name=None):
+    def __init__(self, config, user, password, auth_url, service,
+                 tenant_name=None):
         self.log = logging.getLogger(__name__)
         self.log.setLevel(logging.ERROR)
         self.config = config
-        if self.config.env.authentication == 'keystone_v2':
-            self.token, self.base_url = self.keystone_v2_auth(user,
-                                                              key,
-                                                              auth_url,
-                                                              service,
-                                                              tenant_name)
+        if self.config.identity.strategy == 'keystone':
+            self.token, self.base_url = self.keystone_auth(user,
+                                                           password,
+                                                           auth_url,
+                                                           service,
+                                                           tenant_name)
         else:
             self.token, self.base_url = self.basic_auth(user,
-                                                        key,
+                                                        password,
                                                         auth_url)
 
-    def basic_auth(self, user, api_key, auth_url):
+    def basic_auth(self, user, password, auth_url):
         """
         Provides authentication for the target API
         """
 
         params = {}
         params['headers'] = {'User-Agent': 'Test-Client', 'X-Auth-User': user,
-                             'X-Auth-Key': api_key}
+                             'X-Auth-Key': password}
 
         self.http_obj = httplib2.Http()
         resp, body = self.http_obj.request(auth_url, 'GET', **params)
@@ -43,15 +44,15 @@
         except:
             raise
 
-    def keystone_v2_auth(self, user, api_key, auth_url, service, tenant_name):
+    def keystone_auth(self, user, password, auth_url, service, tenant_name):
         """
-        Provides authentication via Keystone 2.0
+        Provides authentication via Keystone
         """
 
         creds = {'auth': {
                 'passwordCredentials': {
                     'username': user,
-                    'password': api_key,
+                    'password': password,
                 },
                 'tenantName': tenant_name
             }
diff --git a/tempest/common/utils/data_utils.py b/tempest/common/utils/data_utils.py
index 7aed1e1..2d540f4 100644
--- a/tempest/common/utils/data_utils.py
+++ b/tempest/common/utils/data_utils.py
@@ -1,14 +1,22 @@
 import random
+import re
 import urllib
+from tempest import exceptions
 
 
 def rand_name(name='test'):
     return name + str(random.randint(1, 99999999999))
 
 
-def build_url(host, port, apiVer=None, path=None, params=None, use_ssl=False):
+def build_url(host, port, api_version=None, path=None,
+              params=None, use_ssl=False):
     """Build the request URL from given host, port, path and parameters"""
 
+    pattern = 'v\d\.\d'
+    if re.match(pattern, path):
+        message = 'Version should not be included in path.'
+        raise exceptions.InvalidConfiguration(message=message)
+
     if use_ssl:
         url = "https://" + host
     else:
@@ -18,8 +26,8 @@
         url += ":" + port
     url += "/"
 
-    if apiVer is not None:
-        url += apiVer + "/"
+    if api_version is not None:
+        url += api_version + "/"
 
     if path is not None:
         url += path
diff --git a/tempest/config.py b/tempest/config.py
index b100530..8e62c55 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -6,33 +6,33 @@
 LOG = logging.getLogger(__name__)
 
 
-class NovaConfig(object):
-    """Provides configuration information for connecting to Nova."""
+class IdentityConfig(object):
+    """Provides configuration information for authenticating with Keystone."""
 
     def __init__(self, conf):
-        """Initialize a Nova-specific configuration object"""
+        """Initialize an Identity-specific configuration object"""
         self.conf = conf
 
     def get(self, item_name, default_value=None):
         try:
-            return self.conf.get("nova", item_name)
+            return self.conf.get("identity", item_name)
         except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
             return default_value
 
     @property
     def host(self):
-        """Host IP for making Nova API requests. Defaults to '127.0.0.1'."""
+        """Host IP for making Identity API requests."""
         return self.get("host", "127.0.0.1")
 
     @property
     def port(self):
-        """Listen port of the Nova service."""
+        """Port for the Identity service."""
         return self.get("port", "8773")
 
     @property
-    def apiVer(self):
-        """Version of the API"""
-        return self.get("apiVer", "v1.1")
+    def api_version(self):
+        """Version of the Identity API"""
+        return self.get("api_version", "v1.1")
 
     @property
     def path(self):
@@ -41,18 +41,14 @@
 
     @property
     def auth_url(self):
-        """The Auth URL (derived)"""
+        """The Identity URL (derived)"""
         auth_url = data_utils.build_url(self.host,
                                         self.port,
-                                        self.apiVer,
+                                        self.api_version,
                                         self.path,
                                         use_ssl=self.use_ssl)
         return auth_url
 
-    def params(self):
-        """Parameters to be passed with the API request"""
-        return self.get("params", "")
-
     @property
     def use_ssl(self):
         """Specifies if we are using https."""
@@ -60,18 +56,70 @@
 
     @property
     def username(self):
-        """Username to use for Nova API requests. Defaults to 'admin'."""
-        return self.get("user", "admin")
+        """Username to use for Identity API requests."""
+        return self.get("user", None)
 
     @property
     def tenant_name(self):
-        """Tenant name to use for Nova API requests. Defaults to 'admin'."""
-        return self.get("tenant_name", "admin")
+        """Tenant name to use for Identity API requests."""
+        return self.get("tenant_name", None)
 
     @property
-    def api_key(self):
-        """API key to use when authenticating. Defaults to 'admin_key'."""
-        return self.get("api_key", "admin_key")
+    def password(self):
+        """Password to use when authenticating."""
+        return self.get("password", None)
+
+    @property
+    def strategy(self):
+        """Which auth method does the environment use? (basic|keystone)"""
+        return self.get("strategy", 'keystone')
+
+
+class ComputeConfig(object):
+    def __init__(self, conf):
+        """Initialize a Compute-specific configuration object."""
+        self.conf = conf
+
+    def get(self, item_name, default_value):
+        try:
+            return self.conf.get("compute", item_name)
+        except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
+            return default_value
+
+    @property
+    def image_ref(self):
+        """Valid primary image to use in tests."""
+        return self.get("image_ref", 'e7ddc02e-92fa-4f82-b36f-59b39bf66a67')
+
+    @property
+    def image_ref_alt(self):
+        """Valid secondary image reference to be used in tests."""
+        return self.get("image_ref_alt", '346f4039-a81e-44e0-9223-4a3d13c907')
+
+    @property
+    def flavor_ref(self):
+        """Valid primary flavor to use in tests."""
+        return self.get("flavor_ref", 1)
+
+    @property
+    def flavor_ref_alt(self):
+        """Valid secondary flavor to be used in tests."""
+        return self.get("flavor_ref_alt", 2)
+
+    @property
+    def resize_available(self):
+        """Does the test environment support resizing?"""
+        return self.get("resize_available", 'false') != 'false'
+
+    @property
+    def create_image_enabled(self):
+        """Does the test environment support snapshots?"""
+        return self.get("create_image_enabled", 'false') != 'false'
+
+    @property
+    def release_name(self):
+        """Which release is this?"""
+        return self.get("release_name", 'essex')
 
     @property
     def build_interval(self):
@@ -90,62 +138,10 @@
 
     @property
     def catalog_type(self):
-        """Catalog name of the Nova service."""
+        """Catalog type of the Compute service."""
         return self.get("catalog_type", 'compute')
 
 
-class EnvironmentConfig(object):
-    def __init__(self, conf):
-        """Initialize a Environment-specific configuration object."""
-        self.conf = conf
-
-    def get(self, item_name, default_value):
-        try:
-            return self.conf.get("environment", item_name)
-        except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
-            return default_value
-
-    @property
-    def image_ref(self):
-        """Valid imageRef to use """
-        return self.get("image_ref", 3)
-
-    @property
-    def image_ref_alt(self):
-        """Valid imageRef to rebuild images with"""
-        return self.get("image_ref_alt", 3)
-
-    @property
-    def flavor_ref(self):
-        """Valid flavorRef to use"""
-        return self.get("flavor_ref", 1)
-
-    @property
-    def flavor_ref_alt(self):
-        """Valid flavorRef to resize images with"""
-        return self.get("flavor_ref_alt", 2)
-
-    @property
-    def resize_available(self):
-        """ Does the test environment support resizing """
-        return self.get("resize_available", 'false') != 'false'
-
-    @property
-    def create_image_enabled(self):
-        """ Does the test environment support snapshots """
-        return self.get("create_image_enabled", 'false') != 'false'
-
-    @property
-    def authentication(self):
-        """ What auth method does the environment use (basic|keystone) """
-        return self.get("authentication", 'keystone')
-
-    @property
-    def release_name(self):
-        """ Which release is this? """
-        return self.get("release_name", 'essex')
-
-
 class ImagesConfig(object):
     """
     Provides configuration information for connecting to an
@@ -229,8 +225,8 @@
             raise RuntimeError(msg)
 
         self._conf = self.load_config(path)
-        self.nova = NovaConfig(self._conf)
-        self.env = EnvironmentConfig(self._conf)
+        self.compute = ComputeConfig(self._conf)
+        self.identity = IdentityConfig(self._conf)
         self.images = ImagesConfig(self._conf)
 
     def load_config(self, path):
diff --git a/tempest/exceptions.py b/tempest/exceptions.py
index a3fabe3..9f33740 100644
--- a/tempest/exceptions.py
+++ b/tempest/exceptions.py
@@ -27,6 +27,10 @@
         return self._error_string
 
 
+class InvalidConfiguration(TempestException):
+    message = "Invalid Configuration"
+
+
 class NotFound(TempestException):
     message = "Object not found"
 
diff --git a/tempest/openstack.py b/tempest/openstack.py
index 3504589..862b517 100644
--- a/tempest/openstack.py
+++ b/tempest/openstack.py
@@ -1,4 +1,5 @@
 import tempest.config
+from tempest import exceptions
 from tempest.services.image import service as image_service
 from tempest.services.nova.json.images_client import ImagesClient
 from tempest.services.nova.json.flavors_client import FlavorsClient
@@ -8,7 +9,6 @@
 from tempest.services.nova.json.security_groups_client \
 import SecurityGroupsClient
 from tempest.services.nova.json.floating_ips_client import FloatingIPsClient
-
 from tempest.services.nova.json.keypairs_client import KeyPairsClient
 
 
@@ -19,82 +19,29 @@
         Top level manager for all Openstack APIs
         """
         self.config = tempest.config.TempestConfig()
+        username = self.config.identity.username
+        password = self.config.identity.password
+        tenant_name = self.config.identity.tenant_name
 
-        if self.config.env.authentication == 'keystone_v2':
-            self.servers_client = ServersClient(self.config,
-                                                self.config.nova.username,
-                                                self.config.nova.api_key,
-                                                self.config.nova.auth_url,
-                                                self.config.nova.tenant_name)
-            self.flavors_client = FlavorsClient(self.config,
-                                                self.config.nova.username,
-                                                self.config.nova.api_key,
-                                                self.config.nova.auth_url,
-                                                self.config.nova.tenant_name)
-            self.images_client = ImagesClient(self.config,
-                                              self.config.nova.username,
-                                              self.config.nova.api_key,
-                                              self.config.nova.auth_url,
-                                              self.config.nova.tenant_name)
-            self.limits_client = LimitsClient(self.config,
-                                              self.config.nova.username,
-                                              self.config.nova.api_key,
-                                              self.config.nova.auth_url,
-                                              self.config.nova.tenant_name)
-            self.extensions_client = ExtensionsClient(self.config,
-                                              self.config.nova.username,
-                                              self.config.nova.api_key,
-                                              self.config.nova.auth_url,
-                                              self.config.nova.tenant_name)
-            self.keypairs_client = KeyPairsClient(self.config,
-                                              self.config.nova.username,
-                                              self.config.nova.api_key,
-                                              self.config.nova.auth_url,
-                                              self.config.nova.tenant_name)
-            self.security_groups_client = SecurityGroupsClient(self.config,
-                                              self.config.nova.username,
-                                              self.config.nova.api_key,
-                                              self.config.nova.auth_url,
-                                              self.config.nova.tenant_name)
-            self.floating_ips_client = FloatingIPsClient(self.config,
-                                              self.config.nova.username,
-                                              self.config.nova.api_key,
-                                              self.config.nova.auth_url,
-                                              self.config.nova.tenant_name)
+        if None in [username, password, tenant_name]:
+            raise exceptions.InvalidConfiguration(message="Missing complete \
+                                                  user credentials.")
+        auth_url = self.config.identity.auth_url
+
+        if self.config.identity.strategy == 'keystone':
+            client_args = (self.config, username, password, auth_url,
+                           tenant_name)
         else:
-            #Assuming basic/native authentication
-            self.servers_client = ServersClient(self.config,
-                                                self.config.nova.username,
-                                                self.config.nova.api_key,
-                                                self.config.nova.auth_url)
-            self.flavors_client = FlavorsClient(self.config,
-                                                self.config.nova.username,
-                                                self.config.nova.api_key,
-                                                self.config.nova.auth_url)
-            self.images_client = ImagesClient(self.config,
-                                              self.config.nova.username,
-                                              self.config.nova.api_key,
-                                              self.config.nova.auth_url)
-            self.limits_client = LimitsClient(self.config,
-                                              self.config.nova.username,
-                                              self.config.nova.api_key,
-                                              self.config.nova.auth_url)
-            self.extensions_client = ExtensionsClient(self.config,
-                                              self.config.nova.username,
-                                              self.config.nova.api_key,
-                                              self.config.nova.auth_url)
-            self.security_groups_client = SecurityGroupsClient(self.config,
-                                              self.config.nova.username,
-                                              self.config.nova.api_key,
-                                              self.config.nova.auth_url)
-            self.keypairs_client = KeyPairsClient(self.config,
-                                              self.config.nova.username,
-                                              self.config.nova.api_key,
-                                              self.config.nova.auth_url)
-            self.floating_ips_client = FloatingIPsClient(self.config,
-                                              self.config.nova.username,
-                                              self.config.nova.api_key,
-                                              self.config.nova.auth_url)
+            client_args = (self.config, username, password, auth_url)
+
+        self.servers_client = ServersClient(*client_args)
+        self.flavors_client = FlavorsClient(*client_args)
+        self.images_client = ImagesClient(*client_args)
+        self.limits_client = LimitsClient(*client_args)
+        self.extensions_client = ExtensionsClient(*client_args)
+        self.keypairs_client = KeyPairsClient(*client_args)
+        self.security_groups_client = SecurityGroupsClient(*client_args)
+        self.floating_ips_client = FloatingIPsClient(*client_args)
 
 
 class ServiceManager(object):
diff --git a/tempest/services/nova/json/extensions_client.py b/tempest/services/nova/json/extensions_client.py
index 8f26847..284a655 100644
--- a/tempest/services/nova/json/extensions_client.py
+++ b/tempest/services/nova/json/extensions_client.py
@@ -4,10 +4,10 @@
 
 class ExtensionsClient(object):
 
-    def __init__(self, config, username, key, auth_url, tenant_name=None):
+    def __init__(self, config, username, password, auth_url, tenant_name=None):
         self.config = config
-        catalog_type = self.config.nova.catalog_type
-        self.client = rest_client.RestClient(config, username, key,
+        catalog_type = self.config.compute.catalog_type
+        self.client = rest_client.RestClient(config, username, password,
                                              auth_url, catalog_type,
                                              tenant_name)
 
diff --git a/tempest/services/nova/json/flavors_client.py b/tempest/services/nova/json/flavors_client.py
index 990990b..7d612d7 100644
--- a/tempest/services/nova/json/flavors_client.py
+++ b/tempest/services/nova/json/flavors_client.py
@@ -4,10 +4,10 @@
 
 class FlavorsClient(object):
 
-    def __init__(self, config, username, key, auth_url, tenant_name=None):
+    def __init__(self, config, username, password, auth_url, tenant_name=None):
         self.config = config
-        catalog_type = self.config.nova.catalog_type
-        self.client = rest_client.RestClient(config, username, key,
+        catalog_type = self.config.compute.catalog_type
+        self.client = rest_client.RestClient(config, username, password,
                                              auth_url, catalog_type,
                                              tenant_name)
 
diff --git a/tempest/services/nova/json/floating_ips_client.py b/tempest/services/nova/json/floating_ips_client.py
index 8a179b9..3ab8f28 100644
--- a/tempest/services/nova/json/floating_ips_client.py
+++ b/tempest/services/nova/json/floating_ips_client.py
@@ -4,10 +4,10 @@
 
 
 class FloatingIPsClient(object):
-    def __init__(self, config, username, key, auth_url, tenant_name=None):
+    def __init__(self, config, username, password, auth_url, tenant_name=None):
         self.config = config
-        catalog_type = self.config.nova.catalog_type
-        self.client = rest_client.RestClient(config, username, key,
+        catalog_type = self.config.compute.catalog_type
+        self.client = rest_client.RestClient(config, username, password,
                                              auth_url, catalog_type,
                                              tenant_name)
         self.headers = {'Content-Type': 'application/json',
diff --git a/tempest/services/nova/json/images_client.py b/tempest/services/nova/json/images_client.py
index e4d2c65..5bf10ef 100644
--- a/tempest/services/nova/json/images_client.py
+++ b/tempest/services/nova/json/images_client.py
@@ -6,15 +6,15 @@
 
 class ImagesClient(object):
 
-    def __init__(self, config, username, key, auth_url, tenant_name=None):
+    def __init__(self, config, username, password, auth_url, tenant_name=None):
         self.config = config
-        catalog_type = self.config.nova.catalog_type
-        self.client = rest_client.RestClient(config, username, key,
+        catalog_type = self.config.compute.catalog_type
+        self.client = rest_client.RestClient(config, username, password,
                                              auth_url, catalog_type,
                                              tenant_name)
 
-        self.build_interval = self.config.nova.build_interval
-        self.build_timeout = self.config.nova.build_timeout
+        self.build_interval = self.config.compute.build_interval
+        self.build_timeout = self.config.compute.build_timeout
         self.headers = {'Content-Type': 'application/json',
                         'Accept': 'application/json'}
 
diff --git a/tempest/services/nova/json/keypairs_client.py b/tempest/services/nova/json/keypairs_client.py
index 9c912ef..a0bef15 100644
--- a/tempest/services/nova/json/keypairs_client.py
+++ b/tempest/services/nova/json/keypairs_client.py
@@ -4,10 +4,10 @@
 
 class KeyPairsClient(object):
 
-    def __init__(self, config, username, key, auth_url, tenant_name=None):
+    def __init__(self, config, username, password, auth_url, tenant_name=None):
         self.config = config
-        catalog_type = self.config.nova.catalog_type
-        self.client = rest_client.RestClient(config, username, key,
+        catalog_type = self.config.compute.catalog_type
+        self.client = rest_client.RestClient(config, username, password,
                                              auth_url, catalog_type,
                                              tenant_name)
         self.headers = {'Content-Type': 'application/json',
diff --git a/tempest/services/nova/json/limits_client.py b/tempest/services/nova/json/limits_client.py
index 93be33e..6f5f57a 100644
--- a/tempest/services/nova/json/limits_client.py
+++ b/tempest/services/nova/json/limits_client.py
@@ -4,10 +4,10 @@
 
 class LimitsClient(object):
 
-    def __init__(self, config, username, key, auth_url, tenant_name=None):
+    def __init__(self, config, username, password, auth_url, tenant_name=None):
         self.config = config
-        catalog_type = self.config.nova.catalog_type
-        self.client = rest_client.RestClient(config, username, key,
+        catalog_type = self.config.compute.catalog_type
+        self.client = rest_client.RestClient(config, username, password,
                                              auth_url, catalog_type,
                                              tenant_name)
 
diff --git a/tempest/services/nova/json/security_groups_client.py b/tempest/services/nova/json/security_groups_client.py
index 0e6b6cf..29223ea 100644
--- a/tempest/services/nova/json/security_groups_client.py
+++ b/tempest/services/nova/json/security_groups_client.py
@@ -4,10 +4,10 @@
 
 class SecurityGroupsClient(object):
 
-    def __init__(self, config, username, key, auth_url, tenant_name=None):
+    def __init__(self, config, username, password, auth_url, tenant_name=None):
         self.config = config
-        catalog_type = self.config.nova.catalog_type
-        self.client = rest_client.RestClient(config, username, key,
+        catalog_type = self.config.compute.catalog_type
+        self.client = rest_client.RestClient(config, username, password,
                                              auth_url, catalog_type,
                                              tenant_name)
         self.headers = {'Content-Type': 'application/json',
diff --git a/tempest/services/nova/json/servers_client.py b/tempest/services/nova/json/servers_client.py
index e0a26de..35e5782 100644
--- a/tempest/services/nova/json/servers_client.py
+++ b/tempest/services/nova/json/servers_client.py
@@ -6,15 +6,15 @@
 
 class ServersClient(object):
 
-    def __init__(self, config, username, key, auth_url, tenant_name=None):
+    def __init__(self, config, username, password, auth_url, tenant_name=None):
         self.config = config
-        catalog_type = self.config.nova.catalog_type
-        self.client = rest_client.RestClient(config, username, key,
+        catalog_type = self.config.compute.catalog_type
+        self.client = rest_client.RestClient(config, username, password,
                                              auth_url, catalog_type,
                                              tenant_name)
 
-        self.build_interval = self.config.nova.build_interval
-        self.build_timeout = self.config.nova.build_timeout
+        self.build_interval = self.config.compute.build_interval
+        self.build_timeout = self.config.compute.build_timeout
         self.headers = {'Content-Type': 'application/json',
                         'Accept': 'application/json'}
 
diff --git a/tempest/tests/compute/test_server_addresses.py b/tempest/tests/compute/test_server_addresses.py
index 3416baf..4f4bfb3 100644
--- a/tempest/tests/compute/test_server_addresses.py
+++ b/tempest/tests/compute/test_server_addresses.py
@@ -12,8 +12,8 @@
         cls.os = openstack.Manager()
         cls.client = cls.os.servers_client
         cls.config = cls.os.config
-        cls.image_ref = cls.config.env.image_ref
-        cls.flavor_ref = cls.config.env.flavor_ref
+        cls.image_ref = cls.config.compute.image_ref
+        cls.flavor_ref = cls.config.compute.flavor_ref
 
         cls.name = rand_name('server')
         resp, cls.server = cls.client.create_server(cls.name,
diff --git a/tempest/tests/test_flavors.py b/tempest/tests/test_flavors.py
index 3ddcb58..ac58dba 100644
--- a/tempest/tests/test_flavors.py
+++ b/tempest/tests/test_flavors.py
@@ -7,14 +7,14 @@
 
 class FlavorsTest(unittest.TestCase):
 
-    release = tempest.config.TempestConfig().env.release_name
+    release = tempest.config.TempestConfig().compute.release_name
 
     @classmethod
     def setUpClass(cls):
         cls.os = openstack.Manager()
         cls.client = cls.os.flavors_client
         cls.config = cls.os.config
-        cls.flavor_id = cls.config.env.flavor_ref
+        cls.flavor_id = cls.config.compute.flavor_ref
 
     @attr(type='smoke')
     def test_list_flavors(self):
diff --git a/tempest/tests/test_floating_ips_actions.py b/tempest/tests/test_floating_ips_actions.py
index e5862c1..1c0331c 100644
--- a/tempest/tests/test_floating_ips_actions.py
+++ b/tempest/tests/test_floating_ips_actions.py
@@ -15,8 +15,8 @@
         cls.client = cls.os.floating_ips_client
         cls.servers_client = cls.os.servers_client
         cls.config = cls.os.config
-        cls.image_ref = cls.config.env.image_ref
-        cls.flavor_ref = cls.config.env.flavor_ref
+        cls.image_ref = cls.config.compute.image_ref
+        cls.flavor_ref = cls.config.compute.flavor_ref
         #Server creation
         resp, server = cls.servers_client.create_server('floating-server',
                                                         cls.image_ref,
diff --git a/tempest/tests/test_image_metadata.py b/tempest/tests/test_image_metadata.py
index 80f5a0a..50d4182 100644
--- a/tempest/tests/test_image_metadata.py
+++ b/tempest/tests/test_image_metadata.py
@@ -13,8 +13,8 @@
         cls.servers_client = cls.os.servers_client
         cls.client = cls.os.images_client
         cls.config = cls.os.config
-        cls.image_ref = cls.config.env.image_ref
-        cls.flavor_ref = cls.config.env.flavor_ref
+        cls.image_ref = cls.config.compute.image_ref
+        cls.flavor_ref = cls.config.compute.flavor_ref
         cls.ssh_timeout = cls.config.nova.ssh_timeout
 
         name = rand_name('server')
diff --git a/tempest/tests/test_images.py b/tempest/tests/test_images.py
index e761034..c422708 100644
--- a/tempest/tests/test_images.py
+++ b/tempest/tests/test_images.py
@@ -14,7 +14,7 @@
 class ImagesTest(unittest.TestCase):
 
     create_image_enabled = tempest.config.TempestConfig().\
-            env.create_image_enabled
+            compute.create_image_enabled
 
     @classmethod
     def setUpClass(cls):
@@ -22,9 +22,9 @@
         cls.client = cls.os.images_client
         cls.servers_client = cls.os.servers_client
         cls.config = cls.os.config
-        cls.image_ref = cls.config.env.image_ref
-        cls.flavor_ref = cls.config.env.flavor_ref
-        cls.create_image_enabled = cls.config.env.create_image_enabled
+        cls.image_ref = cls.config.compute.image_ref
+        cls.flavor_ref = cls.config.compute.flavor_ref
+        cls.create_image_enabled = cls.config.compute.create_image_enabled
 
     @attr(type='smoke')
     @unittest.skipUnless(create_image_enabled,
diff --git a/tempest/tests/test_keypairs.py b/tempest/tests/test_keypairs.py
index 53fcd0b..9f17922 100644
--- a/tempest/tests/test_keypairs.py
+++ b/tempest/tests/test_keypairs.py
@@ -8,7 +8,7 @@
 
 class KeyPairsTest(unittest.TestCase):
 
-    release = tempest.config.TempestConfig().env.release_name
+    release = tempest.config.TempestConfig().compute.release_name
 
     @classmethod
     def setUpClass(cls):
diff --git a/tempest/tests/test_list_images.py b/tempest/tests/test_list_images.py
index b81ee27..e63c447 100644
--- a/tempest/tests/test_list_images.py
+++ b/tempest/tests/test_list_images.py
@@ -20,8 +20,8 @@
         cls.client = cls.os.images_client
         cls.servers_client = cls.os.servers_client
         cls.config = cls.os.config
-        cls.image_ref = cls.config.env.image_ref
-        cls.flavor_ref = cls.config.env.flavor_ref
+        cls.image_ref = cls.config.compute.image_ref
+        cls.flavor_ref = cls.config.compute.flavor_ref
 
         name = rand_name('server')
         resp, cls.server1 = cls.servers_client.create_server(name,
diff --git a/tempest/tests/test_list_servers.py b/tempest/tests/test_list_servers.py
index fa95d54..de69cb3 100644
--- a/tempest/tests/test_list_servers.py
+++ b/tempest/tests/test_list_servers.py
@@ -16,10 +16,10 @@
         cls.client = cls.os.servers_client
         cls.images_client = cls.os.images_client
         cls.config = cls.os.config
-        cls.image_ref = cls.config.env.image_ref
-        cls.flavor_ref = cls.config.env.flavor_ref
-        cls.image_ref_alt = cls.config.env.image_ref_alt
-        cls.flavor_ref_alt = cls.config.env.flavor_ref_alt
+        cls.image_ref = cls.config.compute.image_ref
+        cls.flavor_ref = cls.config.compute.flavor_ref
+        cls.image_ref_alt = cls.config.compute.image_ref_alt
+        cls.flavor_ref_alt = cls.config.compute.flavor_ref_alt
 
         # Check to see if the alternate image ref actually exists...
         images_client = cls.os.images_client
diff --git a/tempest/tests/test_server_actions.py b/tempest/tests/test_server_actions.py
index 46e7ed5..d9f6a1e 100644
--- a/tempest/tests/test_server_actions.py
+++ b/tempest/tests/test_server_actions.py
@@ -11,19 +11,19 @@
 
 class ServerActionsTest(unittest.TestCase):
 
-    resize_available = tempest.config.TempestConfig().env.resize_available
+    resize_available = tempest.config.TempestConfig().compute.resize_available
 
     @classmethod
     def setUpClass(cls):
         cls.os = openstack.Manager()
         cls.client = cls.os.servers_client
         cls.config = cls.os.config
-        cls.image_ref = cls.config.env.image_ref
-        cls.image_ref_alt = cls.config.env.image_ref_alt
-        cls.flavor_ref = cls.config.env.flavor_ref
-        cls.flavor_ref_alt = cls.config.env.flavor_ref_alt
-        cls.build_interval = cls.config.nova.build_interval
-        cls.build_timeout = cls.config.nova.build_timeout
+        cls.image_ref = cls.config.compute.image_ref
+        cls.image_ref_alt = cls.config.compute.image_ref_alt
+        cls.flavor_ref = cls.config.compute.flavor_ref
+        cls.flavor_ref_alt = cls.config.compute.flavor_ref_alt
+        cls.build_interval = cls.config.compute.build_interval
+        cls.build_timeout = cls.config.compute.build_timeout
 
     def setUp(self):
         self.name = rand_name('server')
diff --git a/tempest/tests/test_server_metadata.py b/tempest/tests/test_server_metadata.py
index 18491ca..e2dc111 100644
--- a/tempest/tests/test_server_metadata.py
+++ b/tempest/tests/test_server_metadata.py
@@ -11,8 +11,8 @@
         cls.os = openstack.Manager()
         cls.client = cls.os.servers_client
         cls.config = cls.os.config
-        cls.image_ref = cls.config.env.image_ref
-        cls.flavor_ref = cls.config.env.flavor_ref
+        cls.image_ref = cls.config.compute.image_ref
+        cls.flavor_ref = cls.config.compute.flavor_ref
 
         #Create a server to be used for all read only tests
         name = rand_name('server')
diff --git a/tempest/tests/test_server_personality.py b/tempest/tests/test_server_personality.py
index e81f5fa..3b516c5 100644
--- a/tempest/tests/test_server_personality.py
+++ b/tempest/tests/test_server_personality.py
@@ -13,8 +13,8 @@
         cls.os = openstack.Manager()
         cls.client = cls.os.servers_client
         cls.config = cls.config = cls.os.config
-        cls.image_ref = cls.config.env.image_ref
-        cls.flavor_ref = cls.config.env.flavor_ref
+        cls.image_ref = cls.config.compute.image_ref
+        cls.flavor_ref = cls.config.compute.flavor_ref
         cls.user_client = cls.os.limits_client
 
     def test_personality_files_exceed_limit(self):
diff --git a/tempest/tests/test_servers.py b/tempest/tests/test_servers.py
index 71d9aa7..cdb2e89 100644
--- a/tempest/tests/test_servers.py
+++ b/tempest/tests/test_servers.py
@@ -12,8 +12,8 @@
         cls.os = openstack.Manager()
         cls.client = cls.os.servers_client
         cls.config = cls.os.config
-        cls.image_ref = cls.config.env.image_ref
-        cls.flavor_ref = cls.config.env.flavor_ref
+        cls.image_ref = cls.config.compute.image_ref
+        cls.flavor_ref = cls.config.compute.flavor_ref
 
     @attr(type='smoke')
     def test_create_delete_server(self):
diff --git a/tempest/tests/test_servers_negative.py b/tempest/tests/test_servers_negative.py
index b038b61..f8de727 100644
--- a/tempest/tests/test_servers_negative.py
+++ b/tempest/tests/test_servers_negative.py
@@ -7,16 +7,16 @@
 
 class ServersNegativeTest(unittest.TestCase):
     release = tempest.config.TempestConfig().\
-            env.release_name
+            compute.release_name
 
     @classmethod
     def setUpClass(cls):
         cls.os = openstack.Manager()
         cls.client = cls.os.servers_client
         cls.config = cls.os.config
-        cls.image_ref = cls.config.env.image_ref
-        cls.flavor_ref = cls.config.env.flavor_ref
-        cls.ssh_timeout = cls.config.nova.ssh_timeout
+        cls.image_ref = cls.config.compute.image_ref
+        cls.flavor_ref = cls.config.compute.flavor_ref
+        cls.ssh_timeout = cls.config.compute.ssh_timeout
 
     def test_server_name_blank(self):
         """Create a server with name parameter empty"""
diff --git a/tempest/tools/conf_from_devstack b/tempest/tools/conf_from_devstack
index 8baa8fb..81df659 100755
--- a/tempest/tools/conf_from_devstack
+++ b/tempest/tools/conf_from_devstack
@@ -135,17 +135,15 @@
     if options.verbose:
         print "Found base image with UUID %s" % conf_settings['base_image_uuid']
 
-    tempest_conf = """[nova]
+    tempest_conf = """[identity]
 host=%(service_host)s
 port=%(service_port)s
-apiVer=%(identity_api_version)s
+api_version=%(identity_api_version)s
 path=tokens
 user=%(user)s
-api_key=%(password)s
+password=%(password)s
 tenant_name=%(user)s
-ssh_timeout=300
-build_interval=10
-build_timeout=600
+strategy=keystone
 
 [image]
 host = %(service_host)s
@@ -157,14 +155,16 @@
 strategy = keystone
 service_token = servicetoken
 
-[environment]
+[compute]
 image_ref=%(base_image_uuid)s
 image_ref_alt=%(base_image_uuid)s
 flavor_ref=1
 flavor_ref_alt=2
 create_image_enabled=true
-resize_available=true
-authentication=keystone_v2""" % conf_settings
+resize_available=false
+ssh_timeout=300
+build_interval=10
+build_timeout=600""" % conf_settings
 
     if options.outfile:
         outfile_path = os.path.abspath(options.outfile)