General cleanup/organization of compute tests

* Renamed services/nova to compute
* Added OpenStack license where missed to compute services/tests
* Broke down compute tests into separate packages by functionality

Change-Id: Ibb1f3ec74b83816205a0bed7d0e062ebf9677525
diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py
index fbe05e7..6683b78 100644
--- a/tempest/common/rest_client.py
+++ b/tempest/common/rest_client.py
@@ -22,7 +22,7 @@
 import time
 
 from tempest import exceptions
-from tempest.services.nova.xml.common import xml_to_json
+from tempest.services.compute.xml.common import xml_to_json
 
 # redrive rate limited calls at most twice
 MAX_RECURSION_DEPTH = 2
diff --git a/tempest/manager.py b/tempest/manager.py
index ce7cf93..fda887c 100644
--- a/tempest/manager.py
+++ b/tempest/manager.py
@@ -31,16 +31,16 @@
 # Tempest REST Fuzz testing client libs
 from tempest.services.network.json import network_client
 from tempest.services.volume.json import volumes_client
-from tempest.services.nova.json import images_client
-from tempest.services.nova.json import flavors_client
-from tempest.services.nova.json import servers_client
-from tempest.services.nova.json import limits_client
-from tempest.services.nova.json import extensions_client
-from tempest.services.nova.json import security_groups_client
-from tempest.services.nova.json import floating_ips_client
-from tempest.services.nova.json import keypairs_client
-from tempest.services.nova.json import volumes_extensions_client
-from tempest.services.nova.json import console_output_client
+from tempest.services.compute.json import images_client
+from tempest.services.compute.json import flavors_client
+from tempest.services.compute.json import servers_client
+from tempest.services.compute.json import limits_client
+from tempest.services.compute.json import extensions_client
+from tempest.services.compute.json import security_groups_client
+from tempest.services.compute.json import floating_ips_client
+from tempest.services.compute.json import keypairs_client
+from tempest.services.compute.json import volumes_extensions_client
+from tempest.services.compute.json import console_output_client
 
 NetworkClient = network_client.NetworkClient
 ImagesClient = images_client.ImagesClientJSON
diff --git a/tempest/openstack.py b/tempest/openstack.py
index 359e6c6..35562b1 100644
--- a/tempest/openstack.py
+++ b/tempest/openstack.py
@@ -25,31 +25,32 @@
 from tempest.services.identity.xml.admin_client import TokenClientXML
 from tempest.services.image import service as image_service
 from tempest.services.network.json.network_client import NetworkClient
-from tempest.services.nova.json.extensions_client import ExtensionsClientJSON
-from tempest.services.nova.json.flavors_client import FlavorsClientJSON
-from tempest.services.nova.json.floating_ips_client import \
+from tempest.services.compute.json.extensions_client import \
+ExtensionsClientJSON
+from tempest.services.compute.json.flavors_client import FlavorsClientJSON
+from tempest.services.compute.json.floating_ips_client import \
 FloatingIPsClientJSON
-from tempest.services.nova.json.images_client import ImagesClientJSON
-from tempest.services.nova.json.limits_client import LimitsClientJSON
-from tempest.services.nova.json.servers_client import ServersClientJSON
-from tempest.services.nova.json.security_groups_client \
+from tempest.services.compute.json.images_client import ImagesClientJSON
+from tempest.services.compute.json.limits_client import LimitsClientJSON
+from tempest.services.compute.json.servers_client import ServersClientJSON
+from tempest.services.compute.json.security_groups_client \
 import SecurityGroupsClientJSON
-from tempest.services.nova.json.keypairs_client import KeyPairsClientJSON
-from tempest.services.nova.json.volumes_extensions_client \
+from tempest.services.compute.json.keypairs_client import KeyPairsClientJSON
+from tempest.services.compute.json.volumes_extensions_client \
 import VolumesExtensionsClientJSON
-from tempest.services.nova.json.console_output_client \
+from tempest.services.compute.json.console_output_client \
 import ConsoleOutputsClient
-from tempest.services.nova.xml.extensions_client import ExtensionsClientXML
-from tempest.services.nova.xml.flavors_client import FlavorsClientXML
-from tempest.services.nova.xml.floating_ips_client import \
+from tempest.services.compute.xml.extensions_client import ExtensionsClientXML
+from tempest.services.compute.xml.flavors_client import FlavorsClientXML
+from tempest.services.compute.xml.floating_ips_client import \
 FloatingIPsClientXML
-from tempest.services.nova.xml.images_client import ImagesClientXML
-from tempest.services.nova.xml.keypairs_client import KeyPairsClientXML
-from tempest.services.nova.xml.limits_client import LimitsClientXML
-from tempest.services.nova.xml.security_groups_client \
+from tempest.services.compute.xml.images_client import ImagesClientXML
+from tempest.services.compute.xml.keypairs_client import KeyPairsClientXML
+from tempest.services.compute.xml.limits_client import LimitsClientXML
+from tempest.services.compute.xml.security_groups_client \
 import SecurityGroupsClientXML
-from tempest.services.nova.xml.servers_client import ServersClientXML
-from tempest.services.nova.xml.volumes_extensions_client \
+from tempest.services.compute.xml.servers_client import ServersClientXML
+from tempest.services.compute.xml.volumes_extensions_client \
 import VolumesExtensionsClientXML
 from tempest.services.volume.json.volumes_client import VolumesClientJSON
 from tempest.services.volume.xml.volumes_client import VolumesClientXML
diff --git a/tempest/services/nova/__init__.py b/tempest/services/compute/__init__.py
similarity index 100%
rename from tempest/services/nova/__init__.py
rename to tempest/services/compute/__init__.py
diff --git a/tempest/services/nova/json/__init__.py b/tempest/services/compute/json/__init__.py
similarity index 100%
rename from tempest/services/nova/json/__init__.py
rename to tempest/services/compute/json/__init__.py
diff --git a/tempest/services/compute/json/console_output_client.py b/tempest/services/compute/json/console_output_client.py
new file mode 100644
index 0000000..d12fd7d
--- /dev/null
+++ b/tempest/services/compute/json/console_output_client.py
@@ -0,0 +1,35 @@
+# 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.common.rest_client import RestClient
+import json
+
+
+class ConsoleOutputsClient(RestClient):
+
+    def __init__(self, config, username, password, auth_url, tenant_name=None):
+        super(ConsoleOutputsClient, self).__init__(config, username, password,
+                                                   auth_url, tenant_name)
+        self.service = self.config.compute.catalog_type
+
+    def get_console_output(self, server_id, length):
+        post_body = {'os-getConsoleOutput': {'length': length}}
+        url = "/servers/%s/action" % server_id
+        post_body = json.dumps(post_body)
+        resp, body = self.post(url, post_body, self.headers)
+        body = json.loads(body)
+        return resp, body['output']
diff --git a/tempest/services/compute/json/extensions_client.py b/tempest/services/compute/json/extensions_client.py
new file mode 100644
index 0000000..c0200df
--- /dev/null
+++ b/tempest/services/compute/json/extensions_client.py
@@ -0,0 +1,38 @@
+# 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.common.rest_client import RestClient
+import json
+
+
+class ExtensionsClientJSON(RestClient):
+
+    def __init__(self, config, username, password, auth_url, tenant_name=None):
+        super(ExtensionsClientJSON, self).__init__(config, username, password,
+                                                   auth_url, tenant_name)
+        self.service = self.config.compute.catalog_type
+
+    def list_extensions(self):
+        url = 'extensions'
+        resp, body = self.get(url)
+        body = json.loads(body)
+        return resp, body
+
+    def is_enabled(self, extension):
+        _, extensions = self.list_extensions()
+        exts = extensions['extensions']
+        return any([e for e in exts if e['name'] == extension])
diff --git a/tempest/services/nova/json/flavors_client.py b/tempest/services/compute/json/flavors_client.py
similarity index 75%
rename from tempest/services/nova/json/flavors_client.py
rename to tempest/services/compute/json/flavors_client.py
index ca1770b..01708a2 100644
--- a/tempest/services/nova/json/flavors_client.py
+++ b/tempest/services/compute/json/flavors_client.py
@@ -1,3 +1,20 @@
+# 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.common.rest_client import RestClient
 import json
 
diff --git a/tempest/services/nova/json/floating_ips_client.py b/tempest/services/compute/json/floating_ips_client.py
similarity index 80%
rename from tempest/services/nova/json/floating_ips_client.py
rename to tempest/services/compute/json/floating_ips_client.py
index 8a1b08f..6219f34 100644
--- a/tempest/services/nova/json/floating_ips_client.py
+++ b/tempest/services/compute/json/floating_ips_client.py
@@ -1,3 +1,20 @@
+# 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.common.rest_client import RestClient
 from tempest import exceptions
 import json
diff --git a/tempest/services/nova/json/hosts_client.py b/tempest/services/compute/json/hosts_client.py
similarity index 100%
rename from tempest/services/nova/json/hosts_client.py
rename to tempest/services/compute/json/hosts_client.py
diff --git a/tempest/services/nova/json/images_client.py b/tempest/services/compute/json/images_client.py
similarity index 88%
rename from tempest/services/nova/json/images_client.py
rename to tempest/services/compute/json/images_client.py
index b2a4a12..102590c 100644
--- a/tempest/services/nova/json/images_client.py
+++ b/tempest/services/compute/json/images_client.py
@@ -1,3 +1,20 @@
+# 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.common.rest_client import RestClient
 from tempest import exceptions
 import json
diff --git a/tempest/services/nova/json/keypairs_client.py b/tempest/services/compute/json/keypairs_client.py
similarity index 68%
rename from tempest/services/nova/json/keypairs_client.py
rename to tempest/services/compute/json/keypairs_client.py
index ce80de8..553936c 100644
--- a/tempest/services/nova/json/keypairs_client.py
+++ b/tempest/services/compute/json/keypairs_client.py
@@ -1,3 +1,20 @@
+# 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.common.rest_client import RestClient
 import json
 
diff --git a/tempest/services/compute/json/limits_client.py b/tempest/services/compute/json/limits_client.py
new file mode 100644
index 0000000..f363bf7
--- /dev/null
+++ b/tempest/services/compute/json/limits_client.py
@@ -0,0 +1,44 @@
+# 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.
+
+import json
+from tempest.common.rest_client import RestClient
+
+
+class LimitsClientJSON(RestClient):
+
+    def __init__(self, config, username, password, auth_url, tenant_name=None):
+        super(LimitsClientJSON, self).__init__(config, username, password,
+                                               auth_url, tenant_name)
+        self.service = self.config.compute.catalog_type
+
+    def get_limits(self):
+        resp, body = self.get("limits")
+        body = json.loads(body)
+        return resp, body['limits']
+
+    def get_max_server_meta(self):
+        resp, limits_dict = self.get_limits()
+        return resp, limits_dict['absolute']['maxServerMeta']
+
+    def get_personality_file_limit(self):
+        resp, limits_dict = self.get_limits()
+        return resp, limits_dict['absolute']['maxPersonality']
+
+    def get_personality_size_limit(self):
+        resp, limits_dict = self.get_limits()
+        return resp, limits_dict['absolute']['maxPersonalitySize']
diff --git a/tempest/services/nova/json/security_groups_client.py b/tempest/services/compute/json/security_groups_client.py
similarity index 82%
rename from tempest/services/nova/json/security_groups_client.py
rename to tempest/services/compute/json/security_groups_client.py
index 7939249..9d8de23 100644
--- a/tempest/services/nova/json/security_groups_client.py
+++ b/tempest/services/compute/json/security_groups_client.py
@@ -1,3 +1,20 @@
+# 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.common.rest_client import RestClient
 import json
 
diff --git a/tempest/services/nova/json/servers_client.py b/tempest/services/compute/json/servers_client.py
similarity index 95%
rename from tempest/services/nova/json/servers_client.py
rename to tempest/services/compute/json/servers_client.py
index a96dacb..5f37f59 100644
--- a/tempest/services/nova/json/servers_client.py
+++ b/tempest/services/compute/json/servers_client.py
@@ -1,3 +1,20 @@
+# 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 exceptions
 from tempest.common.rest_client import RestClient
 import json
diff --git a/tempest/services/nova/json/volumes_extensions_client.py b/tempest/services/compute/json/volumes_extensions_client.py
similarity index 84%
rename from tempest/services/nova/json/volumes_extensions_client.py
rename to tempest/services/compute/json/volumes_extensions_client.py
index 4c0a962..5ac1124 100644
--- a/tempest/services/nova/json/volumes_extensions_client.py
+++ b/tempest/services/compute/json/volumes_extensions_client.py
@@ -1,3 +1,20 @@
+# 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 exceptions
 from tempest.common.rest_client import RestClient
 import json
diff --git a/tempest/services/nova/xml/__init__.py b/tempest/services/compute/xml/__init__.py
similarity index 100%
rename from tempest/services/nova/xml/__init__.py
rename to tempest/services/compute/xml/__init__.py
diff --git a/tempest/services/nova/xml/common.py b/tempest/services/compute/xml/common.py
similarity index 100%
rename from tempest/services/nova/xml/common.py
rename to tempest/services/compute/xml/common.py
diff --git a/tempest/services/compute/xml/extensions_client.py b/tempest/services/compute/xml/extensions_client.py
new file mode 100644
index 0000000..3deaa55
--- /dev/null
+++ b/tempest/services/compute/xml/extensions_client.py
@@ -0,0 +1,45 @@
+# 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 lxml import etree
+from tempest.common.rest_client import RestClientXML
+from tempest.services.compute.xml.common import xml_to_json
+
+
+class ExtensionsClientXML(RestClientXML):
+
+    def __init__(self, config, username, password, auth_url, tenant_name=None):
+        super(ExtensionsClientXML, self).__init__(config, username, password,
+                                                  auth_url, tenant_name)
+        self.service = self.config.compute.catalog_type
+
+    def _parse_array(self, node):
+        array = []
+        for child in node:
+            array.append(xml_to_json(child))
+        return array
+
+    def list_extensions(self):
+        url = 'extensions'
+        resp, body = self.get(url, self.headers)
+        body = self._parse_array(etree.fromstring(body))
+        return resp, {'extensions': body}
+
+    def is_enabled(self, extension):
+        _, extensions = self.list_extensions()
+        exts = extensions['extensions']
+        return any([e for e in exts if e['name'] == extension])
diff --git a/tempest/services/nova/xml/flavors_client.py b/tempest/services/compute/xml/flavors_client.py
similarity index 76%
rename from tempest/services/nova/xml/flavors_client.py
rename to tempest/services/compute/xml/flavors_client.py
index 43a9a11..63ce267 100644
--- a/tempest/services/nova/xml/flavors_client.py
+++ b/tempest/services/compute/xml/flavors_client.py
@@ -1,12 +1,29 @@
+# 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.
+
 import urllib
 
 from lxml import etree
 
 from tempest.common.rest_client import RestClientXML
-from tempest.services.nova.xml.common import Document
-from tempest.services.nova.xml.common import Element
-from tempest.services.nova.xml.common import xml_to_json
-from tempest.services.nova.xml.common import XMLNS_11
+from tempest.services.compute.xml.common import Document
+from tempest.services.compute.xml.common import Element
+from tempest.services.compute.xml.common import xml_to_json
+from tempest.services.compute.xml.common import XMLNS_11
 
 
 XMLNS_OS_FLV_EXT_DATA = \
diff --git a/tempest/services/nova/xml/floating_ips_client.py b/tempest/services/compute/xml/floating_ips_client.py
similarity index 95%
rename from tempest/services/nova/xml/floating_ips_client.py
rename to tempest/services/compute/xml/floating_ips_client.py
index 21b0cc5..2f87926 100644
--- a/tempest/services/nova/xml/floating_ips_client.py
+++ b/tempest/services/compute/xml/floating_ips_client.py
@@ -19,9 +19,9 @@
 
 from tempest.common.rest_client import RestClientXML
 from tempest import exceptions
-from tempest.services.nova.xml.common import xml_to_json
-from tempest.services.nova.xml.common import Document
-from tempest.services.nova.xml.common import Element
+from tempest.services.compute.xml.common import xml_to_json
+from tempest.services.compute.xml.common import Document
+from tempest.services.compute.xml.common import Element
 
 
 class FloatingIPsClientXML(RestClientXML):
diff --git a/tempest/services/nova/xml/images_client.py b/tempest/services/compute/xml/images_client.py
similarity index 96%
rename from tempest/services/nova/xml/images_client.py
rename to tempest/services/compute/xml/images_client.py
index 0df8dfc..12ad4d4 100644
--- a/tempest/services/nova/xml/images_client.py
+++ b/tempest/services/compute/xml/images_client.py
@@ -22,11 +22,11 @@
 
 from tempest import exceptions
 from tempest.common.rest_client import RestClientXML
-from tempest.services.nova.xml.common import Document
-from tempest.services.nova.xml.common import Element
-from tempest.services.nova.xml.common import Text
-from tempest.services.nova.xml.common import xml_to_json
-from tempest.services.nova.xml.common import XMLNS_11
+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
+from tempest.services.compute.xml.common import XMLNS_11
 
 
 class ImagesClientXML(RestClientXML):
diff --git a/tempest/services/nova/xml/keypairs_client.py b/tempest/services/compute/xml/keypairs_client.py
similarity index 90%
rename from tempest/services/nova/xml/keypairs_client.py
rename to tempest/services/compute/xml/keypairs_client.py
index 7c05480..d258537 100644
--- a/tempest/services/nova/xml/keypairs_client.py
+++ b/tempest/services/compute/xml/keypairs_client.py
@@ -18,10 +18,10 @@
 
 from lxml import etree
 from tempest.common.rest_client import RestClientXML
-from tempest.services.nova.xml.common import Document
-from tempest.services.nova.xml.common import Element
-from tempest.services.nova.xml.common import Text
-from tempest.services.nova.xml.common import xml_to_json
+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
 
 
 class KeyPairsClientXML(RestClientXML):
diff --git a/tempest/services/nova/xml/limits_client.py b/tempest/services/compute/xml/limits_client.py
similarity index 100%
rename from tempest/services/nova/xml/limits_client.py
rename to tempest/services/compute/xml/limits_client.py
diff --git a/tempest/services/nova/xml/security_groups_client.py b/tempest/services/compute/xml/security_groups_client.py
similarity index 95%
rename from tempest/services/nova/xml/security_groups_client.py
rename to tempest/services/compute/xml/security_groups_client.py
index 8edd1af..0e35112 100644
--- a/tempest/services/nova/xml/security_groups_client.py
+++ b/tempest/services/compute/xml/security_groups_client.py
@@ -18,10 +18,10 @@
 from lxml import etree
 
 from tempest.common.rest_client import RestClientXML
-from tempest.services.nova.xml.common import Document
-from tempest.services.nova.xml.common import Element
-from tempest.services.nova.xml.common import Text
-from tempest.services.nova.xml.common import xml_to_json
+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
 
 
 class SecurityGroupsClientXML(RestClientXML):
diff --git a/tempest/services/nova/xml/servers_client.py b/tempest/services/compute/xml/servers_client.py
similarity index 97%
rename from tempest/services/nova/xml/servers_client.py
rename to tempest/services/compute/xml/servers_client.py
index 353f1c3..d7c88b7 100644
--- a/tempest/services/nova/xml/servers_client.py
+++ b/tempest/services/compute/xml/servers_client.py
@@ -19,11 +19,11 @@
 from lxml import etree
 from tempest import exceptions
 from tempest.common.rest_client import RestClientXML
-from tempest.services.nova.xml.common import Document
-from tempest.services.nova.xml.common import Element
-from tempest.services.nova.xml.common import Text
-from tempest.services.nova.xml.common import xml_to_json
-from tempest.services.nova.xml.common import XMLNS_11
+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
+from tempest.services.compute.xml.common import XMLNS_11
 import time
 
 LOG = logging.getLogger(__name__)
diff --git a/tempest/services/nova/xml/volumes_extensions_client.py b/tempest/services/compute/xml/volumes_extensions_client.py
similarity index 94%
rename from tempest/services/nova/xml/volumes_extensions_client.py
rename to tempest/services/compute/xml/volumes_extensions_client.py
index fffea44..6869360 100644
--- a/tempest/services/nova/xml/volumes_extensions_client.py
+++ b/tempest/services/compute/xml/volumes_extensions_client.py
@@ -15,17 +15,16 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-
 import time
 from lxml import etree
 
 from tempest import exceptions
 from tempest.common.rest_client import RestClientXML
-from tempest.services.nova.xml.common import xml_to_json
-from tempest.services.nova.xml.common import XMLNS_11
-from tempest.services.nova.xml.common import Element
-from tempest.services.nova.xml.common import Text
-from tempest.services.nova.xml.common import Document
+from tempest.services.compute.xml.common import xml_to_json
+from tempest.services.compute.xml.common import XMLNS_11
+from tempest.services.compute.xml.common import Element
+from tempest.services.compute.xml.common import Text
+from tempest.services.compute.xml.common import Document
 
 
 class VolumesExtensionsClientXML(RestClientXML):
diff --git a/tempest/services/identity/xml/admin_client.py b/tempest/services/identity/xml/admin_client.py
index 953a4d5..0ace184 100644
--- a/tempest/services/identity/xml/admin_client.py
+++ b/tempest/services/identity/xml/admin_client.py
@@ -19,10 +19,10 @@
 from lxml import etree
 from tempest.common.rest_client import RestClient
 from tempest.common.rest_client import RestClientXML
-from tempest.services.nova.xml.common import Document
-from tempest.services.nova.xml.common import Element
-from tempest.services.nova.xml.common import Text
-from tempest.services.nova.xml.common import xml_to_json
+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
 from tempest import exceptions
 import httplib2
 import json
diff --git a/tempest/services/nova/json/console_output_client.py b/tempest/services/nova/json/console_output_client.py
deleted file mode 100644
index b2f2a39..0000000
--- a/tempest/services/nova/json/console_output_client.py
+++ /dev/null
@@ -1,18 +0,0 @@
-from tempest.common.rest_client import RestClient
-import json
-
-
-class ConsoleOutputsClient(RestClient):
-
-    def __init__(self, config, username, password, auth_url, tenant_name=None):
-        super(ConsoleOutputsClient, self).__init__(config, username, password,
-                                                   auth_url, tenant_name)
-        self.service = self.config.compute.catalog_type
-
-    def get_console_output(self, server_id, length):
-        post_body = {'os-getConsoleOutput': {'length': length}}
-        url = "/servers/%s/action" % server_id
-        post_body = json.dumps(post_body)
-        resp, body = self.post(url, post_body, self.headers)
-        body = json.loads(body)
-        return resp, body['output']
diff --git a/tempest/services/nova/json/extensions_client.py b/tempest/services/nova/json/extensions_client.py
deleted file mode 100644
index 620b240..0000000
--- a/tempest/services/nova/json/extensions_client.py
+++ /dev/null
@@ -1,21 +0,0 @@
-from tempest.common.rest_client import RestClient
-import json
-
-
-class ExtensionsClientJSON(RestClient):
-
-    def __init__(self, config, username, password, auth_url, tenant_name=None):
-        super(ExtensionsClientJSON, self).__init__(config, username, password,
-                                                   auth_url, tenant_name)
-        self.service = self.config.compute.catalog_type
-
-    def list_extensions(self):
-        url = 'extensions'
-        resp, body = self.get(url)
-        body = json.loads(body)
-        return resp, body
-
-    def is_enabled(self, extension):
-        _, extensions = self.list_extensions()
-        exts = extensions['extensions']
-        return any([e for e in exts if e['name'] == extension])
diff --git a/tempest/services/nova/json/limits_client.py b/tempest/services/nova/json/limits_client.py
deleted file mode 100644
index 1f83ebf..0000000
--- a/tempest/services/nova/json/limits_client.py
+++ /dev/null
@@ -1,27 +0,0 @@
-import json
-from tempest.common.rest_client import RestClient
-
-
-class LimitsClientJSON(RestClient):
-
-    def __init__(self, config, username, password, auth_url, tenant_name=None):
-        super(LimitsClientJSON, self).__init__(config, username, password,
-                                               auth_url, tenant_name)
-        self.service = self.config.compute.catalog_type
-
-    def get_limits(self):
-        resp, body = self.get("limits")
-        body = json.loads(body)
-        return resp, body['limits']
-
-    def get_max_server_meta(self):
-        resp, limits_dict = self.get_limits()
-        return resp, limits_dict['absolute']['maxServerMeta']
-
-    def get_personality_file_limit(self):
-        resp, limits_dict = self.get_limits()
-        return resp, limits_dict['absolute']['maxPersonality']
-
-    def get_personality_size_limit(self):
-        resp, limits_dict = self.get_limits()
-        return resp, limits_dict['absolute']['maxPersonalitySize']
diff --git a/tempest/services/nova/xml/extensions_client.py b/tempest/services/nova/xml/extensions_client.py
deleted file mode 100644
index c64efc8..0000000
--- a/tempest/services/nova/xml/extensions_client.py
+++ /dev/null
@@ -1,28 +0,0 @@
-from lxml import etree
-from tempest.common.rest_client import RestClientXML
-from tempest.services.nova.xml.common import xml_to_json
-
-
-class ExtensionsClientXML(RestClientXML):
-
-    def __init__(self, config, username, password, auth_url, tenant_name=None):
-        super(ExtensionsClientXML, self).__init__(config, username, password,
-                                                  auth_url, tenant_name)
-        self.service = self.config.compute.catalog_type
-
-    def _parse_array(self, node):
-        array = []
-        for child in node:
-            array.append(xml_to_json(child))
-        return array
-
-    def list_extensions(self):
-        url = 'extensions'
-        resp, body = self.get(url, self.headers)
-        body = self._parse_array(etree.fromstring(body))
-        return resp, {'extensions': body}
-
-    def is_enabled(self, extension):
-        _, extensions = self.list_extensions()
-        exts = extensions['extensions']
-        return any([e for e in exts if e['name'] == extension])
diff --git a/tempest/services/volume/xml/volumes_client.py b/tempest/services/volume/xml/volumes_client.py
index d05e85b..ef5f3e9 100644
--- a/tempest/services/volume/xml/volumes_client.py
+++ b/tempest/services/volume/xml/volumes_client.py
@@ -21,11 +21,11 @@
 
 from tempest.common.rest_client import RestClientXML
 from tempest import exceptions
-from tempest.services.nova.xml.common import xml_to_json
-from tempest.services.nova.xml.common import XMLNS_11
-from tempest.services.nova.xml.common import Element
-from tempest.services.nova.xml.common import Text
-from tempest.services.nova.xml.common import Document
+from tempest.services.compute.xml.common import xml_to_json
+from tempest.services.compute.xml.common import XMLNS_11
+from tempest.services.compute.xml.common import Element
+from tempest.services.compute.xml.common import Text
+from tempest.services.compute.xml.common import Document
 
 
 class VolumesClientXML(RestClientXML):
diff --git a/tempest/services/nova/__init__.py b/tempest/tests/compute/flavors/__init__.py
similarity index 100%
copy from tempest/services/nova/__init__.py
copy to tempest/tests/compute/flavors/__init__.py
diff --git a/tempest/tests/compute/test_flavors.py b/tempest/tests/compute/flavors/test_flavors.py
similarity index 100%
rename from tempest/tests/compute/test_flavors.py
rename to tempest/tests/compute/flavors/test_flavors.py
diff --git a/tempest/services/nova/__init__.py b/tempest/tests/compute/floating_ips/__init__.py
similarity index 100%
copy from tempest/services/nova/__init__.py
copy to tempest/tests/compute/floating_ips/__init__.py
diff --git a/tempest/tests/compute/test_floating_ips_actions.py b/tempest/tests/compute/floating_ips/test_floating_ips_actions.py
similarity index 100%
rename from tempest/tests/compute/test_floating_ips_actions.py
rename to tempest/tests/compute/floating_ips/test_floating_ips_actions.py
diff --git a/tempest/tests/compute/test_list_floating_ips.py b/tempest/tests/compute/floating_ips/test_list_floating_ips.py
similarity index 100%
rename from tempest/tests/compute/test_list_floating_ips.py
rename to tempest/tests/compute/floating_ips/test_list_floating_ips.py
diff --git a/tempest/services/nova/__init__.py b/tempest/tests/compute/images/__init__.py
similarity index 100%
copy from tempest/services/nova/__init__.py
copy to tempest/tests/compute/images/__init__.py
diff --git a/tempest/tests/compute/test_image_metadata.py b/tempest/tests/compute/images/test_image_metadata.py
similarity index 100%
rename from tempest/tests/compute/test_image_metadata.py
rename to tempest/tests/compute/images/test_image_metadata.py
diff --git a/tempest/tests/compute/test_images.py b/tempest/tests/compute/images/test_images.py
similarity index 100%
rename from tempest/tests/compute/test_images.py
rename to tempest/tests/compute/images/test_images.py
diff --git a/tempest/tests/compute/test_images_whitebox.py b/tempest/tests/compute/images/test_images_whitebox.py
similarity index 100%
rename from tempest/tests/compute/test_images_whitebox.py
rename to tempest/tests/compute/images/test_images_whitebox.py
diff --git a/tempest/tests/compute/test_list_image_filters.py b/tempest/tests/compute/images/test_list_image_filters.py
similarity index 100%
rename from tempest/tests/compute/test_list_image_filters.py
rename to tempest/tests/compute/images/test_list_image_filters.py
diff --git a/tempest/tests/compute/test_list_images.py b/tempest/tests/compute/images/test_list_images.py
similarity index 100%
rename from tempest/tests/compute/test_list_images.py
rename to tempest/tests/compute/images/test_list_images.py
diff --git a/tempest/services/nova/__init__.py b/tempest/tests/compute/keypairs/__init__.py
similarity index 100%
copy from tempest/services/nova/__init__.py
copy to tempest/tests/compute/keypairs/__init__.py
diff --git a/tempest/tests/compute/test_keypairs.py b/tempest/tests/compute/keypairs/test_keypairs.py
similarity index 100%
rename from tempest/tests/compute/test_keypairs.py
rename to tempest/tests/compute/keypairs/test_keypairs.py
diff --git a/tempest/services/nova/__init__.py b/tempest/tests/compute/security_groups/__init__.py
similarity index 100%
copy from tempest/services/nova/__init__.py
copy to tempest/tests/compute/security_groups/__init__.py
diff --git a/tempest/tests/compute/test_security_group_rules.py b/tempest/tests/compute/security_groups/test_security_group_rules.py
similarity index 100%
rename from tempest/tests/compute/test_security_group_rules.py
rename to tempest/tests/compute/security_groups/test_security_group_rules.py
diff --git a/tempest/tests/compute/test_security_groups.py b/tempest/tests/compute/security_groups/test_security_groups.py
similarity index 100%
rename from tempest/tests/compute/test_security_groups.py
rename to tempest/tests/compute/security_groups/test_security_groups.py
diff --git a/tempest/services/nova/__init__.py b/tempest/tests/compute/servers/__init__.py
similarity index 100%
copy from tempest/services/nova/__init__.py
copy to tempest/tests/compute/servers/__init__.py
diff --git a/tempest/tests/compute/test_console_output.py b/tempest/tests/compute/servers/test_console_output.py
similarity index 100%
rename from tempest/tests/compute/test_console_output.py
rename to tempest/tests/compute/servers/test_console_output.py
diff --git a/tempest/tests/compute/test_create_server.py b/tempest/tests/compute/servers/test_create_server.py
similarity index 100%
rename from tempest/tests/compute/test_create_server.py
rename to tempest/tests/compute/servers/test_create_server.py
diff --git a/tempest/tests/compute/test_disk_config.py b/tempest/tests/compute/servers/test_disk_config.py
similarity index 100%
rename from tempest/tests/compute/test_disk_config.py
rename to tempest/tests/compute/servers/test_disk_config.py
diff --git a/tempest/tests/compute/test_list_server_filters.py b/tempest/tests/compute/servers/test_list_server_filters.py
similarity index 100%
rename from tempest/tests/compute/test_list_server_filters.py
rename to tempest/tests/compute/servers/test_list_server_filters.py
diff --git a/tempest/tests/compute/test_list_servers_negative.py b/tempest/tests/compute/servers/test_list_servers_negative.py
similarity index 100%
rename from tempest/tests/compute/test_list_servers_negative.py
rename to tempest/tests/compute/servers/test_list_servers_negative.py
diff --git a/tempest/tests/compute/test_server_actions.py b/tempest/tests/compute/servers/test_server_actions.py
similarity index 100%
rename from tempest/tests/compute/test_server_actions.py
rename to tempest/tests/compute/servers/test_server_actions.py
diff --git a/tempest/tests/compute/test_server_addresses.py b/tempest/tests/compute/servers/test_server_addresses.py
similarity index 100%
rename from tempest/tests/compute/test_server_addresses.py
rename to tempest/tests/compute/servers/test_server_addresses.py
diff --git a/tempest/tests/compute/test_server_advanced_ops.py b/tempest/tests/compute/servers/test_server_advanced_ops.py
similarity index 100%
rename from tempest/tests/compute/test_server_advanced_ops.py
rename to tempest/tests/compute/servers/test_server_advanced_ops.py
diff --git a/tempest/tests/compute/test_server_basic_ops.py b/tempest/tests/compute/servers/test_server_basic_ops.py
similarity index 100%
rename from tempest/tests/compute/test_server_basic_ops.py
rename to tempest/tests/compute/servers/test_server_basic_ops.py
diff --git a/tempest/tests/compute/test_server_metadata.py b/tempest/tests/compute/servers/test_server_metadata.py
similarity index 100%
rename from tempest/tests/compute/test_server_metadata.py
rename to tempest/tests/compute/servers/test_server_metadata.py
diff --git a/tempest/tests/compute/test_server_personality.py b/tempest/tests/compute/servers/test_server_personality.py
similarity index 100%
rename from tempest/tests/compute/test_server_personality.py
rename to tempest/tests/compute/servers/test_server_personality.py
diff --git a/tempest/tests/compute/test_servers.py b/tempest/tests/compute/servers/test_servers.py
similarity index 100%
rename from tempest/tests/compute/test_servers.py
rename to tempest/tests/compute/servers/test_servers.py
diff --git a/tempest/tests/compute/test_servers_negative.py b/tempest/tests/compute/servers/test_servers_negative.py
similarity index 100%
rename from tempest/tests/compute/test_servers_negative.py
rename to tempest/tests/compute/servers/test_servers_negative.py
diff --git a/tempest/tests/compute/test_servers_whitebox.py b/tempest/tests/compute/servers/test_servers_whitebox.py
similarity index 100%
rename from tempest/tests/compute/test_servers_whitebox.py
rename to tempest/tests/compute/servers/test_servers_whitebox.py
diff --git a/tempest/tests/compute/test_live_block_migration.py b/tempest/tests/compute/test_live_block_migration.py
index fb175f3..ae8b774 100644
--- a/tempest/tests/compute/test_live_block_migration.py
+++ b/tempest/tests/compute/test_live_block_migration.py
@@ -26,8 +26,8 @@
 from tempest import config
 from tempest import exceptions
 
-from tempest.services.nova.json.hosts_client import HostsClientJSON
-from tempest.services.nova.json.servers_client import ServersClientJSON
+from tempest.services.compute.json.hosts_client import HostsClientJSON
+from tempest.services.compute.json.servers_client import ServersClientJSON
 
 
 @attr(category='live-migration')
diff --git a/tempest/services/nova/__init__.py b/tempest/tests/compute/volumes/__init__.py
similarity index 100%
copy from tempest/services/nova/__init__.py
copy to tempest/tests/compute/volumes/__init__.py
diff --git a/tempest/tests/compute/test_attach_volume.py b/tempest/tests/compute/volumes/test_attach_volume.py
similarity index 100%
rename from tempest/tests/compute/test_attach_volume.py
rename to tempest/tests/compute/volumes/test_attach_volume.py
diff --git a/tempest/tests/compute/test_volumes_get.py b/tempest/tests/compute/volumes/test_volumes_get.py
similarity index 100%
rename from tempest/tests/compute/test_volumes_get.py
rename to tempest/tests/compute/volumes/test_volumes_get.py
diff --git a/tempest/tests/compute/test_volumes_list.py b/tempest/tests/compute/volumes/test_volumes_list.py
similarity index 100%
rename from tempest/tests/compute/test_volumes_list.py
rename to tempest/tests/compute/volumes/test_volumes_list.py
diff --git a/tempest/tests/compute/test_volumes_negative.py b/tempest/tests/compute/volumes/test_volumes_negative.py
similarity index 100%
rename from tempest/tests/compute/test_volumes_negative.py
rename to tempest/tests/compute/volumes/test_volumes_negative.py