Merge "Remove vim headers"
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 230f61c..872a841 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -260,6 +260,8 @@
@classmethod
def setUpClass(cls):
+ # By default compute tests do not create network resources
+ cls.set_network_resources()
super(BaseV3ComputeTest, cls).setUpClass()
if not cls.config.compute_feature_enabled.api_v3:
cls.tearDownClass()
@@ -285,6 +287,7 @@
cls.aggregates_client = cls.os.aggregates_v3_client
cls.hosts_client = cls.os.hosts_v3_client
cls.quotas_client = cls.os.quotas_v3_client
+ cls.version_client = cls.os.version_v3_client
@classmethod
def create_image_from_server(cls, server_id, **kwargs):
diff --git a/tempest/api/compute/v3/servers/test_attach_interfaces.py b/tempest/api/compute/v3/servers/test_attach_interfaces.py
index d12f708..d05296b 100644
--- a/tempest/api/compute/v3/servers/test_attach_interfaces.py
+++ b/tempest/api/compute/v3/servers/test_attach_interfaces.py
@@ -26,6 +26,8 @@
def setUpClass(cls):
if not cls.config.service_available.neutron:
raise cls.skipException("Neutron is required")
+ # This test class requires network and subnet
+ cls.set_network_resources(network=True, subnet=True)
super(AttachInterfacesV3TestJSON, cls).setUpClass()
cls.client = cls.interfaces_client
diff --git a/tempest/api/compute/v3/servers/test_server_addresses.py b/tempest/api/compute/v3/servers/test_server_addresses.py
index 06ddac5..6ecd28b 100644
--- a/tempest/api/compute/v3/servers/test_server_addresses.py
+++ b/tempest/api/compute/v3/servers/test_server_addresses.py
@@ -23,6 +23,8 @@
@classmethod
def setUpClass(cls):
+ # This test module might use a network and a subnet
+ cls.set_network_resources(network=True, subnet=True)
super(ServerAddressesV3Test, cls).setUpClass()
cls.client = cls.servers_client
diff --git a/tempest/api/compute/v3/test_version.py b/tempest/api/compute/v3/test_version.py
new file mode 100644
index 0000000..166d161
--- /dev/null
+++ b/tempest/api/compute/v3/test_version.py
@@ -0,0 +1,34 @@
+# Copyright 2014 NEC Corporation.
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+
+from tempest.api.compute import base
+from tempest import test
+
+
+class VersionV3TestJSON(base.BaseV3ComputeTest):
+ _interface = 'json'
+
+ @test.attr(type='gate')
+ def test_version(self):
+ # Get version information
+ resp, version = self.version_client.get_version()
+ self.assertEqual(200, resp.status)
+ self.assertIn("id", version)
+ self.assertEqual("v3.0", version["id"])
+
+
+class VersionV3TestXML(VersionV3TestJSON):
+ _interface = 'xml'
diff --git a/tempest/clients.py b/tempest/clients.py
index da0913d..e44da84 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -76,6 +76,8 @@
ServicesV3ClientJSON
from tempest.services.compute.v3.json.tenant_usages_client import \
TenantUsagesV3ClientJSON
+from tempest.services.compute.v3.json.version_client import \
+ VersionV3ClientJSON
from tempest.services.compute.v3.xml.aggregates_client import \
AggregatesV3ClientXML
from tempest.services.compute.v3.xml.availability_zone_client import \
@@ -100,6 +102,7 @@
ServicesV3ClientXML
from tempest.services.compute.v3.xml.tenant_usages_client import \
TenantUsagesV3ClientXML
+from tempest.services.compute.v3.xml.version_client import VersionV3ClientXML
from tempest.services.compute.xml.aggregates_client import AggregatesClientXML
from tempest.services.compute.xml.availability_zone_client import \
AvailabilityZoneClientXML
@@ -277,6 +280,7 @@
self.tenant_usages_v3_client = TenantUsagesV3ClientXML(
*client_args)
self.tenant_usages_client = TenantUsagesClientXML(*client_args)
+ self.version_v3_client = VersionV3ClientXML(*client_args)
self.policy_client = PolicyClientXML(*client_args)
self.hosts_client = HostsClientXML(*client_args)
self.hypervisor_v3_client = HypervisorV3ClientXML(*client_args)
@@ -342,6 +346,7 @@
self.tenant_usages_v3_client = TenantUsagesV3ClientJSON(
*client_args)
self.tenant_usages_client = TenantUsagesClientJSON(*client_args)
+ self.version_v3_client = VersionV3ClientJSON(*client_args)
self.policy_client = PolicyClientJSON(*client_args)
self.hosts_client = HostsClientJSON(*client_args)
self.hypervisor_v3_client = HypervisorV3ClientJSON(*client_args)
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index e3070fc..c4f8ced 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -13,6 +13,7 @@
from tempest.common.utils import data_utils
from tempest.openstack.common import log
from tempest.scenario import manager
+import tempest.test
from tempest.test import services
@@ -125,6 +126,7 @@
actual = self._get_content(ssh_client)
self.assertEqual(expected, actual)
+ @tempest.test.skip_because(bug="1270608")
@services('compute', 'volume', 'image')
def test_volume_boot_pattern(self):
keypair = self.create_keypair()
diff --git a/tempest/services/compute/v3/json/version_client.py b/tempest/services/compute/v3/json/version_client.py
new file mode 100644
index 0000000..1773af5
--- /dev/null
+++ b/tempest/services/compute/v3/json/version_client.py
@@ -0,0 +1,32 @@
+# Copyright 2014 NEC Corporation.
+# 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 import rest_client
+
+
+class VersionV3ClientJSON(rest_client.RestClient):
+
+ def __init__(self, config, username, password, auth_url, tenant_name=None):
+ super(VersionV3ClientJSON, self).__init__(config, username,
+ password, auth_url,
+ tenant_name)
+ self.service = self.config.compute.catalog_v3_type
+
+ def get_version(self):
+ resp, body = self.get('')
+ body = json.loads(body)
+ return resp, body['version']
diff --git a/tempest/services/compute/v3/xml/version_client.py b/tempest/services/compute/v3/xml/version_client.py
new file mode 100644
index 0000000..7ecb31f
--- /dev/null
+++ b/tempest/services/compute/v3/xml/version_client.py
@@ -0,0 +1,37 @@
+# Copyright 2014 NEC Corporation
+# 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 import rest_client
+from tempest.services.compute.xml import common
+
+
+class VersionV3ClientXML(rest_client.RestClientXML):
+
+ def __init__(self, config, username, password, auth_url, tenant_name=None):
+ super(VersionV3ClientXML, self).__init__(config, username,
+ password, auth_url,
+ tenant_name)
+ self.service = self.config.compute.catalog_v3_type
+
+ def _parse_array(self, node):
+ json = common.xml_to_json(node)
+ return json
+
+ def get_version(self):
+ resp, body = self.get('', self.headers)
+ body = self._parse_array(etree.fromstring(body))
+ return resp, body