Merge "Add unit tests to increase coverage"
diff --git a/bindep.txt b/bindep.txt
index 7d34939..3eb3bbd 100644
--- a/bindep.txt
+++ b/bindep.txt
@@ -5,7 +5,6 @@
libffi-devel [platform:rpm]
gcc [platform:rpm]
gcc [platform:dpkg]
-python-devel [platform:rpm]
python3-dev [platform:dpkg]
python3-devel [platform:rpm]
openssl-devel [platform:rpm]
diff --git a/doc/source/supported_version.rst b/doc/source/supported_version.rst
index 3d221c9..89f0f90 100644
--- a/doc/source/supported_version.rst
+++ b/doc/source/supported_version.rst
@@ -9,10 +9,10 @@
Tempest master supports the below OpenStack Releases:
+* 2023.2
+* 2023.1
* Zed
* Yoga
-* Xena
-* Wallaby
For older OpenStack Release:
@@ -35,3 +35,5 @@
* Python 3.8
* Python 3.9
+* Python 3.10
+* Python 3.11
diff --git a/releasenotes/notes/remove-glance-v1-api-tests-5a39d3ea4b6bd71e.yaml b/releasenotes/notes/remove-glance-v1-api-tests-5a39d3ea4b6bd71e.yaml
new file mode 100644
index 0000000..dc36ac0
--- /dev/null
+++ b/releasenotes/notes/remove-glance-v1-api-tests-5a39d3ea4b6bd71e.yaml
@@ -0,0 +1,8 @@
+---
+prelude: >
+ Glance v1 APIs were removed in Rocky release and last
+ supported release for v1 was Queens. Tempest master does
+ not support the Rocky or Queens release so we removed
+ the Glance v1 tests, config option, and its service clients.
+ If you would like to test the v1 APIs then you can use the old
+ Tempest version.
diff --git a/releasenotes/notes/remove-nova-network-tests-f694bcd30a97a4ca.yaml b/releasenotes/notes/remove-nova-network-tests-f694bcd30a97a4ca.yaml
new file mode 100644
index 0000000..6ee5691
--- /dev/null
+++ b/releasenotes/notes/remove-nova-network-tests-f694bcd30a97a4ca.yaml
@@ -0,0 +1,11 @@
+---
+prelude: >
+ Tempest remove the nova-network tests and service clients.
+ The nova-network was removed from Rocky release and current
+ Tempest master does not support the Rocky release. Below are
+ the service clients have been removed:
+
+ * floating_ip_pools_client
+ * floating_ips_bulk_client
+ * fixed_ips_client
+ * list_virtual_interfaces
diff --git a/releasenotes/notes/tempest-2023-2-release-e913af3f36762afb.yaml b/releasenotes/notes/tempest-2023-2-release-e913af3f36762afb.yaml
new file mode 100644
index 0000000..1147465
--- /dev/null
+++ b/releasenotes/notes/tempest-2023-2-release-e913af3f36762afb.yaml
@@ -0,0 +1,17 @@
+---
+prelude: |
+ This release is to tag Tempest for OpenStack 2023.2 release.
+ This release marks the start of 2023.2 release support in Tempest.
+ After this release, Tempest will support below OpenStack Releases:
+
+ * 2023.2
+ * 2023.1
+ * Zed
+ * Yoga
+
+ Current development of Tempest is for OpenStack 2024.1 development
+ cycle. Every Tempest commit is also tested against master during
+ the 2024.1 cycle. However, this does not necessarily mean that using
+ Tempest as of this tag will work against a 2024.1 (or future release)
+ cloud.
+ To be on safe side, use this tag to test the OpenStack 2023.2 release.
diff --git a/releasenotes/source/index.rst b/releasenotes/source/index.rst
index 4c1edd5..989d3b5 100644
--- a/releasenotes/source/index.rst
+++ b/releasenotes/source/index.rst
@@ -6,6 +6,8 @@
:maxdepth: 1
unreleased
+ v36.0.0
+ v35.0.0
v34.2.0
v34.0.0
v33.0.0
diff --git a/releasenotes/source/v35.0.0.rst b/releasenotes/source/v35.0.0.rst
new file mode 100644
index 0000000..3e5dcbd
--- /dev/null
+++ b/releasenotes/source/v35.0.0.rst
@@ -0,0 +1,6 @@
+=====================
+v35.0.0 Release Notes
+=====================
+
+.. release-notes:: 35.0.0 Release Notes
+ :version: 35.0.0
diff --git a/releasenotes/source/v36.0.0.rst b/releasenotes/source/v36.0.0.rst
new file mode 100644
index 0000000..7cf477d
--- /dev/null
+++ b/releasenotes/source/v36.0.0.rst
@@ -0,0 +1,6 @@
+=====================
+v36.0.0 Release Notes
+=====================
+
+.. release-notes:: 36.0.0 Release Notes
+ :version: 36.0.0
diff --git a/setup.cfg b/setup.cfg
index beaf9b4..bb1ced5 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -18,6 +18,7 @@
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
+ Programming Language :: Python :: 3.11
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: Implementation :: CPython
diff --git a/tempest/api/compute/admin/test_assisted_volume_snapshots.py b/tempest/api/compute/admin/test_assisted_volume_snapshots.py
index 5e30444..b7be796 100644
--- a/tempest/api/compute/admin/test_assisted_volume_snapshots.py
+++ b/tempest/api/compute/admin/test_assisted_volume_snapshots.py
@@ -26,6 +26,13 @@
create_default_network = True
+ # TODO(gmann): Remove the admin access to service user
+ # once nova change the default of this API to service
+ # role. To merge the nova changing the policy default
+ # we need to use token with admin as well as service
+ # role and later we can use only service token.
+ credentials = ['primary', 'admin', ['service_user', 'admin', 'service']]
+
@classmethod
def skip_checks(cls):
super(VolumesAssistedSnapshotsTest, cls).skip_checks()
@@ -37,7 +44,7 @@
def setup_clients(cls):
super(VolumesAssistedSnapshotsTest, cls).setup_clients()
cls.assisted_v_client = (
- cls.os_admin.assisted_volume_snapshots_client)
+ cls.os_service_user.assisted_volume_snapshots_client)
cls.volumes_client = cls.os_admin.volumes_client_latest
cls.servers_client = cls.os_admin.servers_client
diff --git a/tempest/api/compute/admin/test_fixed_ips.py b/tempest/api/compute/admin/test_fixed_ips.py
deleted file mode 100644
index 9de3da9..0000000
--- a/tempest/api/compute/admin/test_fixed_ips.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# Copyright 2013 IBM Corp
-# 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.common import utils
-from tempest import config
-from tempest.lib import decorators
-
-CONF = config.CONF
-
-
-class FixedIPsTestJson(base.BaseV2ComputeAdminTest):
- """Test fixed ips API"""
-
- @classmethod
- def skip_checks(cls):
- super(FixedIPsTestJson, cls).skip_checks()
- if CONF.service_available.neutron:
- msg = ("%s skipped as neutron is available" % cls.__name__)
- raise cls.skipException(msg)
- if not utils.get_service_list()['network']:
- raise cls.skipException("network service not enabled.")
-
- @classmethod
- def setup_clients(cls):
- super(FixedIPsTestJson, cls).setup_clients()
- cls.client = cls.os_admin.fixed_ips_client
-
- @classmethod
- def resource_setup(cls):
- super(FixedIPsTestJson, cls).resource_setup()
- server = cls.create_test_server(wait_until='ACTIVE')
- server = cls.servers_client.show_server(server['id'])['server']
- cls.ip = None
- for ip_set in server['addresses']:
- for ip in server['addresses'][ip_set]:
- if ip['OS-EXT-IPS:type'] == 'fixed':
- cls.ip = ip['addr']
- break
- if cls.ip:
- break
- if cls.ip is None:
- raise cls.skipException("No fixed ip found for server: %s"
- % server['id'])
-
- @decorators.idempotent_id('16b7d848-2f7c-4709-85a3-2dfb4576cc52')
- def test_list_fixed_ip_details(self):
- """Test getting fixed ip details"""
- fixed_ip = self.client.show_fixed_ip(self.ip)
- self.assertEqual(fixed_ip['fixed_ip']['address'], self.ip)
-
- @decorators.idempotent_id('5485077b-7e46-4cec-b402-91dc3173433b')
- def test_set_reserve(self):
- """Test reserving fixed ip"""
- self.client.reserve_fixed_ip(self.ip, reserve="None")
-
- @decorators.idempotent_id('7476e322-b9ff-4710-bf82-49d51bac6e2e')
- def test_set_unreserve(self):
- """Test unreserving fixed ip"""
- self.client.reserve_fixed_ip(self.ip, unreserve="None")
diff --git a/tempest/api/compute/admin/test_fixed_ips_negative.py b/tempest/api/compute/admin/test_fixed_ips_negative.py
deleted file mode 100644
index 1629faa..0000000
--- a/tempest/api/compute/admin/test_fixed_ips_negative.py
+++ /dev/null
@@ -1,101 +0,0 @@
-# Copyright 2013 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.common import utils
-from tempest import config
-from tempest.lib import decorators
-from tempest.lib import exceptions as lib_exc
-
-CONF = config.CONF
-
-
-class FixedIPsNegativeTestJson(base.BaseV2ComputeAdminTest):
- """Negative tests of fixed ips API"""
-
- @classmethod
- def skip_checks(cls):
- super(FixedIPsNegativeTestJson, cls).skip_checks()
- if CONF.service_available.neutron:
- msg = ("%s skipped as neutron is available" % cls.__name__)
- raise cls.skipException(msg)
- if not utils.get_service_list()['network']:
- raise cls.skipException("network service not enabled.")
-
- @classmethod
- def setup_clients(cls):
- super(FixedIPsNegativeTestJson, cls).setup_clients()
- cls.client = cls.os_admin.fixed_ips_client
- cls.non_admin_client = cls.fixed_ips_client
-
- @classmethod
- def resource_setup(cls):
- super(FixedIPsNegativeTestJson, cls).resource_setup()
- server = cls.create_test_server(wait_until='ACTIVE')
- server = cls.servers_client.show_server(server['id'])['server']
- cls.ip = None
- for ip_set in server['addresses']:
- for ip in server['addresses'][ip_set]:
- if ip['OS-EXT-IPS:type'] == 'fixed':
- cls.ip = ip['addr']
- break
- if cls.ip:
- break
- if cls.ip is None:
- raise cls.skipException("No fixed ip found for server: %s"
- % server['id'])
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('9f17f47d-daad-4adc-986e-12370c93e407')
- def test_list_fixed_ip_details_with_non_admin_user(self):
- """Test listing fixed ip with detail by non-admin user is forbidden"""
- self.assertRaises(lib_exc.Forbidden,
- self.non_admin_client.show_fixed_ip, self.ip)
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('ce60042c-fa60-4836-8d43-1c8e3359dc47')
- def test_set_reserve_with_non_admin_user(self):
- """Test reserving fixed ip by non-admin user is forbidden"""
- self.assertRaises(lib_exc.Forbidden,
- self.non_admin_client.reserve_fixed_ip,
- self.ip, reserve="None")
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('f1f7a35b-0390-48c5-9803-5f27461439db')
- def test_set_unreserve_with_non_admin_user(self):
- """Test unreserving fixed ip by non-admin user is forbidden"""
- self.assertRaises(lib_exc.Forbidden,
- self.non_admin_client.reserve_fixed_ip,
- self.ip, unreserve="None")
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('f51cf464-7fc5-4352-bc3e-e75cfa2cb717')
- def test_set_reserve_with_invalid_ip(self):
- """Test reserving invalid fixed ip should fail"""
- # NOTE(maurosr): since this exercises the same code snippet, we do it
- # only for reserve action
- # NOTE(eliqiao): in Juno, the exception is NotFound, but in master, we
- # change the error code to BadRequest, both exceptions should be
- # accepted by tempest
- self.assertRaises((lib_exc.NotFound, lib_exc.BadRequest),
- self.client.reserve_fixed_ip,
- "my.invalid.ip", reserve="None")
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('fd26ef50-f135-4232-9d32-281aab3f9176')
- def test_fixed_ip_with_invalid_action(self):
- """Test operating fixed ip with invalid action should fail"""
- self.assertRaises(lib_exc.BadRequest,
- self.client.reserve_fixed_ip,
- self.ip, invalid_action="None")
diff --git a/tempest/api/compute/admin/test_floating_ips_bulk.py b/tempest/api/compute/admin/test_floating_ips_bulk.py
deleted file mode 100644
index 786c7f0..0000000
--- a/tempest/api/compute/admin/test_floating_ips_bulk.py
+++ /dev/null
@@ -1,85 +0,0 @@
-# Copyright 2014 NEC Technologies India Ltd.
-# 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 netaddr
-
-from tempest.api.compute import base
-from tempest.common import utils
-from tempest import config
-from tempest.lib.common.utils import test_utils
-from tempest.lib import decorators
-from tempest.lib import exceptions
-
-CONF = config.CONF
-
-
-# TODO(stephenfin): Remove this test class once the nova queens branch goes
-# into extended maintenance mode.
-class FloatingIPsBulkAdminTestJSON(base.BaseV2ComputeAdminTest):
- """Tests Floating IPs Bulk APIs that require admin privileges.
-
- API documentation - http://docs.openstack.org/api/openstack-compute/2/
- content/ext-os-floating-ips-bulk.html
- """
- max_microversion = '2.35'
- depends_on_nova_network = True
-
- @classmethod
- def setup_clients(cls):
- super(FloatingIPsBulkAdminTestJSON, cls).setup_clients()
- cls.client = cls.os_admin.floating_ips_bulk_client
-
- @classmethod
- def resource_setup(cls):
- super(FloatingIPsBulkAdminTestJSON, cls).resource_setup()
- cls.ip_range = CONF.validation.floating_ip_range
- cls.verify_unallocated_floating_ip_range(cls.ip_range)
-
- @classmethod
- def verify_unallocated_floating_ip_range(cls, ip_range):
- # Verify whether configure floating IP range is not already allocated.
- body = cls.client.list_floating_ips_bulk()['floating_ip_info']
- allocated_ips_list = map(lambda x: x['address'], body)
- for ip_addr in netaddr.IPNetwork(ip_range).iter_hosts():
- if str(ip_addr) in allocated_ips_list:
- msg = ("Configured unallocated floating IP range is already "
- "allocated. Configure the correct unallocated range "
- "as 'floating_ip_range'")
- raise exceptions.InvalidConfiguration(msg)
- return
-
- @decorators.idempotent_id('2c8f145f-8012-4cb8-ac7e-95a587f0e4ab')
- @utils.services('network')
- def test_create_list_delete_floating_ips_bulk(self):
- """Creating, listing and deleting the Floating IPs Bulk"""
- pool = 'test_pool'
- # NOTE(GMann): Reserving the IP range but those are not attached
- # anywhere. Using the below mentioned interface which is not ever
- # expected to be used. Clean Up has been done for created IP range
- interface = 'eth0'
- body = (self.client.create_floating_ips_bulk(self.ip_range,
- pool,
- interface)
- ['floating_ips_bulk_create'])
- self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- self.client.delete_floating_ips_bulk, self.ip_range)
- self.assertEqual(self.ip_range, body['ip_range'])
- ips_list = self.client.list_floating_ips_bulk()['floating_ip_info']
- self.assertNotEmpty(ips_list)
- for ip in netaddr.IPNetwork(self.ip_range).iter_hosts():
- self.assertIn(str(ip), map(lambda x: x['address'], ips_list))
- body = (self.client.delete_floating_ips_bulk(self.ip_range)
- ['floating_ips_bulk_delete'])
- self.assertEqual(self.ip_range, body)
diff --git a/tempest/api/compute/admin/test_live_migration.py b/tempest/api/compute/admin/test_live_migration.py
index a02820a..d68334f 100644
--- a/tempest/api/compute/admin/test_live_migration.py
+++ b/tempest/api/compute/admin/test_live_migration.py
@@ -258,7 +258,8 @@
port = self.ports_client.show_port(port_id)['port']
return port['status'] == 'ACTIVE'
- @decorators.unstable_test(bug='2027605')
+ @decorators.unstable_test(bug='2024160')
+ @decorators.unstable_test(bug='2033887')
@decorators.attr(type='multinode')
@decorators.idempotent_id('0022c12e-a482-42b0-be2d-396b5f0cffe3')
@utils.requires_ext(service='network', extension='trunk')
diff --git a/tempest/api/compute/admin/test_server_external_events.py b/tempest/api/compute/admin/test_server_external_events.py
index 1c5c295..d867a39 100644
--- a/tempest/api/compute/admin/test_server_external_events.py
+++ b/tempest/api/compute/admin/test_server_external_events.py
@@ -19,6 +19,13 @@
class ServerExternalEventsTest(base.BaseV2ComputeAdminTest):
"""Test server external events test"""
+ # TODO(gmann): Remove the admin access to service user
+ # once nova change the default of this API to service
+ # role. To merge the nova changing the policy default
+ # we need to use token with admin as well as service
+ # role and later we can use only service token.
+ credentials = ['primary', 'admin', ['service_user', 'admin', 'service']]
+
@decorators.idempotent_id('6bbf4723-61d2-4372-af55-7ba27f1c9ba6')
def test_create_server_external_events(self):
"""Test create a server and add some external events"""
@@ -29,7 +36,7 @@
"server_uuid": server_id,
}
]
- client = self.os_admin.server_external_events_client
+ client = self.os_service_user.server_external_events_client
events_resp = client.create_server_external_events(
events=events)['events'][0]
self.assertEqual(server_id, events_resp['server_uuid'])
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 9aa5d35..d02532d 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -82,7 +82,6 @@
cls.flavors_client = cls.os_primary.flavors_client
cls.compute_images_client = cls.os_primary.compute_images_client
cls.extensions_client = cls.os_primary.extensions_client
- cls.floating_ip_pools_client = cls.os_primary.floating_ip_pools_client
cls.floating_ips_client = cls.os_primary.compute_floating_ips_client
cls.keypairs_client = cls.os_primary.keypairs_client
cls.security_group_rules_client = (
@@ -97,7 +96,6 @@
cls.snapshots_extensions_client =\
cls.os_primary.snapshots_extensions_client
cls.interfaces_client = cls.os_primary.interfaces_client
- cls.fixed_ips_client = cls.os_primary.fixed_ips_client
cls.availability_zone_client = cls.os_primary.availability_zone_client
cls.agents_client = cls.os_primary.agents_client
cls.aggregates_client = cls.os_primary.aggregates_client
@@ -115,43 +113,11 @@
cls.attachments_client = cls.os_primary.attachments_client_latest
cls.snapshots_client = cls.os_primary.snapshots_client_latest
if CONF.service_available.glance:
- if CONF.image_feature_enabled.api_v1:
- cls.images_client = cls.os_primary.image_client
- elif CONF.image_feature_enabled.api_v2:
+ if CONF.image_feature_enabled.api_v2:
cls.images_client = cls.os_primary.image_client_v2
else:
raise lib_exc.InvalidConfiguration(
- 'Either api_v1 or api_v2 must be True in '
- '[image-feature-enabled].')
- cls._check_depends_on_nova_network()
-
- @classmethod
- def _check_depends_on_nova_network(cls):
- # Since nova-network APIs were removed from Nova in the Rocky release,
- # determine, based on the max version from the version document, if
- # the compute API is >Queens and if so, skip tests that rely on
- # nova-network.
- if not getattr(cls, 'depends_on_nova_network', False):
- return
- versions = cls.versions_client.list_versions()['versions']
- # Find the v2.1 version which will tell us our max version for the
- # compute API we're testing against.
- for version in versions:
- if version['id'] == 'v2.1':
- max_version = api_version_request.APIVersionRequest(
- version['version'])
- break
- else:
- LOG.warning(
- 'Unable to determine max v2.1 compute API version: %s',
- versions)
- return
-
- # The max compute API version in Queens is 2.60 so we cap
- # at that version.
- queens = api_version_request.APIVersionRequest('2.60')
- if max_version > queens:
- raise cls.skipException('nova-network is gone')
+ 'api_v2 must be True in [image-feature-enabled].')
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/compute/flavors/test_flavors_negative.py b/tempest/api/compute/flavors/test_flavors_negative.py
index 5d6a7d7..22b71fc 100644
--- a/tempest/api/compute/flavors/test_flavors_negative.py
+++ b/tempest/api/compute/flavors/test_flavors_negative.py
@@ -17,7 +17,6 @@
import random
from tempest.api.compute import base
-from tempest.common import image as common_image
from tempest.common import utils
from tempest import config
from tempest.lib.common.utils import data_utils
@@ -48,23 +47,15 @@
'name': data_utils.rand_name('image'),
'container_format': CONF.image.container_formats[0],
'disk_format': CONF.image.disk_formats[0],
- 'min_ram': min_img_ram
+ 'min_ram': min_img_ram,
+ 'visibility': 'private'
}
- if CONF.image_feature_enabled.api_v1:
- params.update({'is_public': False})
- params = {'headers': common_image.image_meta_to_headers(**params)}
- else:
- params.update({'visibility': 'private'})
-
image = self.images_client.create_image(**params)
image = image['image'] if 'image' in image else image
self.addCleanup(self.images_client.delete_image, image['id'])
- if CONF.image_feature_enabled.api_v1:
- self.images_client.update_image(image['id'], data=image_file)
- else:
- self.images_client.store_image_file(image['id'], data=image_file)
+ self.images_client.store_image_file(image['id'], data=image_file)
self.assertEqual(min_img_ram, image['min_ram'])
diff --git a/tempest/api/compute/floating_ips/base.py b/tempest/api/compute/floating_ips/base.py
index 262a3c1..d6c302d 100644
--- a/tempest/api/compute/floating_ips/base.py
+++ b/tempest/api/compute/floating_ips/base.py
@@ -41,4 +41,3 @@
def setup_clients(cls):
super(BaseFloatingIPsTest, cls).setup_clients()
cls.client = cls.floating_ips_client
- cls.pools_client = cls.floating_ip_pools_client
diff --git a/tempest/api/compute/floating_ips/test_list_floating_ips.py b/tempest/api/compute/floating_ips/test_list_floating_ips.py
index 6bfee95..fcbea2f 100644
--- a/tempest/api/compute/floating_ips/test_list_floating_ips.py
+++ b/tempest/api/compute/floating_ips/test_list_floating_ips.py
@@ -66,10 +66,3 @@
self.assertEqual(floating_ip_fixed_ip,
body['fixed_ip'])
self.assertEqual(floating_ip_id, body['id'])
-
- @decorators.idempotent_id('df389fc8-56f5-43cc-b290-20eda39854d3')
- def test_list_floating_ip_pools(self):
- """Test listing floating ip pools"""
- floating_ip_pools = self.pools_client.list_floating_ip_pools()
- self.assertNotEmpty(floating_ip_pools['floating_ip_pools'],
- "Expected floating IP Pools. Got zero.")
diff --git a/tempest/api/compute/images/test_image_metadata.py b/tempest/api/compute/images/test_image_metadata.py
index ece983d..f630bc8 100644
--- a/tempest/api/compute/images/test_image_metadata.py
+++ b/tempest/api/compute/images/test_image_metadata.py
@@ -16,7 +16,6 @@
import io
from tempest.api.compute import base
-from tempest.common import image as common_image
from tempest.common import waiters
from tempest import config
from tempest.lib.common.utils import data_utils
@@ -42,17 +41,11 @@
@classmethod
def setup_clients(cls):
super(ImagesMetadataTestJSON, cls).setup_clients()
- # Check if glance v1 is available to determine which client to use. We
- # prefer glance v1 for the compute API tests since the compute image
- # API proxy was written for glance v1.
- if CONF.image_feature_enabled.api_v1:
- cls.glance_client = cls.os_primary.image_client
- elif CONF.image_feature_enabled.api_v2:
+ if CONF.image_feature_enabled.api_v2:
cls.glance_client = cls.os_primary.image_client_v2
else:
raise exceptions.InvalidConfiguration(
- 'Either api_v1 or api_v2 must be True in '
- '[image-feature-enabled].')
+ 'api_v2 must be True in [image-feature-enabled].')
cls.client = cls.compute_images_client
@classmethod
@@ -63,13 +56,9 @@
params = {
'name': data_utils.rand_name('image'),
'container_format': 'bare',
- 'disk_format': 'raw'
+ 'disk_format': 'raw',
+ 'visibility': 'private'
}
- if CONF.image_feature_enabled.api_v1:
- params.update({'is_public': False})
- params = {'headers': common_image.image_meta_to_headers(**params)}
- else:
- params.update({'visibility': 'private'})
body = cls.glance_client.create_image(**params)
body = body['image'] if 'image' in body else body
@@ -78,10 +67,7 @@
cls.glance_client.delete_image,
cls.image_id)
image_file = io.BytesIO((b'*' * 1024))
- if CONF.image_feature_enabled.api_v1:
- cls.glance_client.update_image(cls.image_id, data=image_file)
- else:
- cls.glance_client.store_image_file(cls.image_id, data=image_file)
+ cls.glance_client.store_image_file(cls.image_id, data=image_file)
waiters.wait_for_image_status(cls.client, cls.image_id, 'ACTIVE')
def setUp(self):
diff --git a/tempest/api/compute/images/test_list_image_filters.py b/tempest/api/compute/images/test_list_image_filters.py
index 15b8a00..c6eff9b 100644
--- a/tempest/api/compute/images/test_list_image_filters.py
+++ b/tempest/api/compute/images/test_list_image_filters.py
@@ -19,7 +19,6 @@
import testtools
from tempest.api.compute import base
-from tempest.common import image as common_image
from tempest.common import waiters
from tempest import config
from tempest.lib.common.utils import data_utils
@@ -46,17 +45,11 @@
def setup_clients(cls):
super(ListImageFiltersTestJSON, cls).setup_clients()
cls.client = cls.compute_images_client
- # Check if glance v1 is available to determine which client to use. We
- # prefer glance v1 for the compute API tests since the compute image
- # API proxy was written for glance v1.
- if CONF.image_feature_enabled.api_v1:
- cls.glance_client = cls.os_primary.image_client
- elif CONF.image_feature_enabled.api_v2:
+ if CONF.image_feature_enabled.api_v2:
cls.glance_client = cls.os_primary.image_client_v2
else:
raise exceptions.InvalidConfiguration(
- 'Either api_v1 or api_v2 must be True in '
- '[image-feature-enabled].')
+ 'api_v2 must be True in [image-feature-enabled].')
@classmethod
def resource_setup(cls):
@@ -66,14 +59,9 @@
params = {
'name': data_utils.rand_name(cls.__name__ + '-image'),
'container_format': 'bare',
- 'disk_format': 'raw'
+ 'disk_format': 'raw',
+ 'visibility': 'private'
}
- if CONF.image_feature_enabled.api_v1:
- params.update({'is_public': False})
- params = {'headers':
- common_image.image_meta_to_headers(**params)}
- else:
- params.update({'visibility': 'private'})
body = cls.glance_client.create_image(**params)
body = body['image'] if 'image' in body else body
@@ -86,10 +74,7 @@
# between created_at and updated_at.
time.sleep(1)
image_file = io.BytesIO((b'*' * 1024))
- if CONF.image_feature_enabled.api_v1:
- cls.glance_client.update_image(image_id, data=image_file)
- else:
- cls.glance_client.store_image_file(image_id, data=image_file)
+ cls.glance_client.store_image_file(image_id, data=image_file)
waiters.wait_for_image_status(cls.client, image_id, 'ACTIVE')
body = cls.client.show_image(image_id)['image']
return body
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index 81f9e55..a181839 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -127,29 +127,23 @@
self.assertGreater(new_boot_time, boot_time,
'%s > %s' % (new_boot_time, boot_time))
- def _test_rebuild_server(self):
+ def _test_rebuild_server(self, server_id):
# Get the IPs the server has before rebuilding it
- original_addresses = (self.client.show_server(self.server_id)['server']
+ original_addresses = (self.client.show_server(server_id)['server']
['addresses'])
# The server should be rebuilt using the provided image and data
meta = {'rebuild': 'server'}
new_name = data_utils.rand_name(self.__class__.__name__ + '-server')
password = 'rebuildPassw0rd'
rebuilt_server = self.client.rebuild_server(
- self.server_id,
+ server_id,
self.image_ref_alt,
name=new_name,
metadata=meta,
adminPass=password)['server']
- # If the server was rebuilt on a different image, restore it to the
- # original image once the test ends
- if self.image_ref_alt != self.image_ref:
- self.addCleanup(self._rebuild_server_and_check, self.image_ref,
- rebuilt_server)
-
# Verify the properties in the initial response are correct
- self.assertEqual(self.server_id, rebuilt_server['id'])
+ self.assertEqual(server_id, rebuilt_server['id'])
rebuilt_image_id = rebuilt_server['image']['id']
self.assertTrue(self.image_ref_alt.endswith(rebuilt_image_id))
self.assert_flavor_equal(self.flavor_ref, rebuilt_server['flavor'])
@@ -221,23 +215,6 @@
self.assertNotEqual('None', parsed_url.hostname)
self.assertIn(parsed_url.scheme, valid_scheme)
- def _rebuild_server_and_check(self, image_ref, server):
- rebuilt_server = (self.client.rebuild_server(server['id'], image_ref)
- ['server'])
- if CONF.validation.run_validation:
- tenant_network = self.get_tenant_network()
- compute.wait_for_ssh_or_ping(
- server, self.os_primary, tenant_network,
- True, self.validation_resources, "SSHABLE", True)
- else:
- waiters.wait_for_server_status(self.client, server['id'],
- 'ACTIVE')
-
- msg = ('Server was not rebuilt to the original image. '
- 'The original image: {0}. The current image: {1}'
- .format(image_ref, rebuilt_server['image']['id']))
- self.assertEqual(image_ref, rebuilt_server['image']['id'], msg)
-
class ServerActionsTestJSON(ServerActionsBase):
@decorators.idempotent_id('6158df09-4b82-4ab3-af6d-29cf36af858d')
@@ -287,7 +264,18 @@
The server should be rebuilt using the provided image and data.
"""
- self._test_rebuild_server()
+ tenant_network = self.get_tenant_network()
+ _, servers = compute.create_test_server(
+ self.os_primary,
+ wait_until='ACTIVE',
+ tenant_network=tenant_network)
+ server = servers[0]
+
+ self.addCleanup(waiters.wait_for_server_termination,
+ self.client, server['id'])
+ self.addCleanup(self.client.delete_server, server['id'])
+
+ self._test_rebuild_server(server_id=server['id'])
@decorators.idempotent_id('1499262a-9328-4eda-9068-db1ac57498d2')
@testtools.skipUnless(CONF.compute_feature_enabled.resize,
@@ -410,21 +398,27 @@
The server in stop state should be rebuilt using the provided
image and remain in SHUTOFF state.
"""
- server = self.client.show_server(self.server_id)['server']
+ tenant_network = self.get_tenant_network()
+ _, servers = compute.create_test_server(
+ self.os_primary,
+ wait_until='ACTIVE',
+ tenant_network=tenant_network)
+ server = servers[0]
+
+ self.addCleanup(waiters.wait_for_server_termination,
+ self.client, server['id'])
+ self.addCleanup(self.client.delete_server, server['id'])
+ server = self.client.show_server(server['id'])['server']
old_image = server['image']['id']
new_image = (self.image_ref_alt
if old_image == self.image_ref else self.image_ref)
- self.client.stop_server(self.server_id)
- waiters.wait_for_server_status(self.client, self.server_id, 'SHUTOFF')
- rebuilt_server = (self.client.rebuild_server(self.server_id, new_image)
+ self.client.stop_server(server['id'])
+ waiters.wait_for_server_status(self.client, server['id'], 'SHUTOFF')
+ rebuilt_server = (self.client.rebuild_server(server['id'], new_image)
['server'])
- # If the server was rebuilt on a different image, restore it to the
- # original image once the test ends
- if self.image_ref_alt != self.image_ref:
- self.addCleanup(self._rebuild_server_and_check, old_image, server)
# Verify the properties in the initial response are correct
- self.assertEqual(self.server_id, rebuilt_server['id'])
+ self.assertEqual(server['id'], rebuilt_server['id'])
rebuilt_image_id = rebuilt_server['image']['id']
self.assertEqual(new_image, rebuilt_image_id)
self.assert_flavor_equal(self.flavor_ref, rebuilt_server['flavor'])
@@ -436,8 +430,6 @@
rebuilt_image_id = server['image']['id']
self.assertEqual(new_image, rebuilt_image_id)
- self.client.start_server(self.server_id)
-
# NOTE(mriedem): Marked as slow because while rebuild and volume-backed is
# common, we don't actually change the image (you can't with volume-backed
# rebuild) so this isn't testing much outside normal rebuild
@@ -451,29 +443,34 @@
The volume should be attached to the instance after rebuild.
"""
# create a new volume and attach it to the server
- volume = self.create_volume()
+ volume = self.create_volume(wait_for_available=False)
+ network = self.get_tenant_network()
+ validation_resources = self.get_test_validation_resources(
+ self.os_primary)
+ _, servers = compute.create_test_server(
+ self.os_primary, tenant_network=network,
+ validatable=True,
+ validation_resources=validation_resources,
+ wait_until='SSHABLE')
+ server = servers[0]
+ self.addCleanup(waiters.wait_for_server_termination,
+ self.client, server['id'])
+ self.addCleanup(self.client.delete_server, server['id'])
- server = self.client.show_server(self.server_id)['server']
+ server = self.client.show_server(server['id'])['server']
+ waiters.wait_for_volume_resource_status(self.volumes_client,
+ volume['id'], 'available')
self.attach_volume(server, volume)
# run general rebuild test
- self._test_rebuild_server()
+ self._test_rebuild_server(server_id=server['id'])
# make sure the volume is attached to the instance after rebuild
vol_after_rebuild = self.volumes_client.show_volume(volume['id'])
vol_after_rebuild = vol_after_rebuild['volume']
self.assertEqual('in-use', vol_after_rebuild['status'])
- self.assertEqual(self.server_id,
+ self.assertEqual(server['id'],
vol_after_rebuild['attachments'][0]['server_id'])
- if CONF.validation.run_validation:
- linux_client = remote_client.RemoteClient(
- self.get_server_ip(server, self.validation_resources),
- self.ssh_alt_user,
- password=None,
- pkey=self.validation_resources['keypair']['private_key'],
- server=server,
- servers_client=self.client)
- linux_client.validate_authentication()
@decorators.idempotent_id('e6c28180-7454-4b59-b188-0257af08a63b')
@decorators.related_bug('1728603')
@@ -572,17 +569,11 @@
# create the first and the second backup
- # Check if glance v1 is available to determine which client to use. We
- # prefer glance v1 for the compute API tests since the compute image
- # API proxy was written for glance v1.
- if CONF.image_feature_enabled.api_v1:
- glance_client = self.os_primary.image_client
- elif CONF.image_feature_enabled.api_v2:
+ if CONF.image_feature_enabled.api_v2:
glance_client = self.os_primary.image_client_v2
else:
raise lib_exc.InvalidConfiguration(
- 'Either api_v1 or api_v2 must be True in '
- '[image-feature-enabled].')
+ 'api_v2 must be True in [image-feature-enabled].')
backup1 = data_utils.rand_name('backup-1')
resp = self.client.create_backup(self.server_id,
@@ -638,16 +629,9 @@
'sort_key': 'created_at',
'sort_dir': 'asc'
}
- if CONF.image_feature_enabled.api_v1:
- for key, value in properties.items():
- params['property-%s' % key] = value
- image_list = glance_client.list_images(
- detail=True,
- **params)['images']
- else:
- # Additional properties are flattened in glance v2.
- params.update(properties)
- image_list = glance_client.list_images(params)['images']
+ # Additional properties are flattened in glance v2.
+ params.update(properties)
+ image_list = glance_client.list_images(params)['images']
self.assertEqual(2, len(image_list))
self.assertEqual((backup1, backup2),
@@ -671,11 +655,7 @@
waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
glance_client.wait_for_resource_deletion(image1_id)
oldest_backup_exist = False
- if CONF.image_feature_enabled.api_v1:
- image_list = glance_client.list_images(
- detail=True, **params)['images']
- else:
- image_list = glance_client.list_images(params)['images']
+ image_list = glance_client.list_images(params)['images']
self.assertEqual(2, len(image_list),
'Unexpected number of images for '
'v2:test_create_backup; was the oldest backup not '
@@ -736,23 +716,16 @@
"""Test shelving and unshelving server"""
if CONF.image_feature_enabled.api_v2:
glance_client = self.os_primary.image_client_v2
- elif CONF.image_feature_enabled.api_v1:
- glance_client = self.os_primary.image_client
else:
raise lib_exc.InvalidConfiguration(
- 'Either api_v1 or api_v2 must be True in '
- '[image-feature-enabled].')
+ 'api_v2 must be True in [image-feature-enabled].')
compute.shelve_server(self.client, self.server_id,
force_shelve_offload=True)
server = self.client.show_server(self.server_id)['server']
image_name = server['name'] + '-shelved'
params = {'name': image_name}
- if CONF.image_feature_enabled.api_v2:
- images = glance_client.list_images(params)['images']
- elif CONF.image_feature_enabled.api_v1:
- images = glance_client.list_images(
- detail=True, **params)['images']
+ images = glance_client.list_images(params)['images']
self.assertEqual(1, len(images))
self.assertEqual(image_name, images[0]['name'])
diff --git a/tempest/api/compute/servers/test_servers_negative.py b/tempest/api/compute/servers/test_servers_negative.py
index 4f85048..bd383d3 100644
--- a/tempest/api/compute/servers/test_servers_negative.py
+++ b/tempest/api/compute/servers/test_servers_negative.py
@@ -508,10 +508,7 @@
server = self.client.show_server(self.server_id)['server']
image_name = server['name'] + '-shelved'
- if CONF.image_feature_enabled.api_v1:
- kwargs = {'name': image_name}
- else:
- kwargs = {'params': {'name': image_name}}
+ kwargs = {'params': {'name': image_name}}
images = self.images_client.list_images(**kwargs)['images']
self.assertEqual(1, len(images))
self.assertEqual(image_name, images[0]['name'])
diff --git a/tempest/api/compute/servers/test_virtual_interfaces.py b/tempest/api/compute/servers/test_virtual_interfaces.py
deleted file mode 100644
index b2e02c5..0000000
--- a/tempest/api/compute/servers/test_virtual_interfaces.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright 2013 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-import netaddr
-import testtools
-
-from tempest.api.compute import base
-from tempest.common import utils
-from tempest import config
-from tempest.lib import decorators
-from tempest.lib import exceptions
-
-CONF = config.CONF
-
-
-# TODO(mriedem): Remove this test class once the nova queens branch goes into
-# extended maintenance mode.
-class VirtualInterfacesTestJSON(base.BaseV2ComputeTest):
- """Test virtual interfaces API with compute microversion less than 2.44"""
-
- max_microversion = '2.43'
-
- depends_on_nova_network = True
-
- create_default_network = True
-
- @classmethod
- def setup_clients(cls):
- super(VirtualInterfacesTestJSON, cls).setup_clients()
- cls.client = cls.servers_client
-
- @classmethod
- def resource_setup(cls):
- super(VirtualInterfacesTestJSON, cls).resource_setup()
- cls.server = cls.create_test_server(wait_until='ACTIVE')
-
- @decorators.idempotent_id('96c4e2ef-5e4d-4d7f-87f5-fed6dca18016')
- @utils.services('network')
- def test_list_virtual_interfaces(self):
- """Test listing virtual interfaces of a server"""
- if CONF.service_available.neutron:
- with testtools.ExpectedException(exceptions.BadRequest):
- self.client.list_virtual_interfaces(self.server['id'])
- else:
- output = self.client.list_virtual_interfaces(self.server['id'])
- virt_ifaces = output['virtual_interfaces']
- self.assertNotEmpty(virt_ifaces,
- 'Expected virtual interfaces, got 0 '
- 'interfaces.')
- for virt_iface in virt_ifaces:
- mac_address = virt_iface['mac_address']
- self.assertTrue(netaddr.valid_mac(mac_address),
- "Invalid mac address detected. mac address: %s"
- % mac_address)
diff --git a/tempest/api/compute/servers/test_virtual_interfaces_negative.py b/tempest/api/compute/servers/test_virtual_interfaces_negative.py
deleted file mode 100644
index 5667281..0000000
--- a/tempest/api/compute/servers/test_virtual_interfaces_negative.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright 2013 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from tempest.api.compute import base
-from tempest.common import utils
-from tempest.lib.common.utils import data_utils
-from tempest.lib import decorators
-from tempest.lib import exceptions as lib_exc
-
-
-# TODO(mriedem): Remove this test class once the nova queens branch goes into
-# extended maintenance mode.
-class VirtualInterfacesNegativeTestJSON(base.BaseV2ComputeTest):
- """Negative tests of virtual interfaces API
-
- Negative tests of virtual interfaces API for compute microversion less
- than 2.44.
- """
-
- max_microversion = '2.43'
-
- depends_on_nova_network = True
-
- @classmethod
- def setup_credentials(cls):
- # For this test no network resources are needed
- cls.set_network_resources()
- super(VirtualInterfacesNegativeTestJSON, cls).setup_credentials()
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('64ebd03c-1089-4306-93fa-60f5eb5c803c')
- @utils.services('network')
- def test_list_virtual_interfaces_invalid_server_id(self):
- """Test listing virtual interfaces of an invalid server should fail"""
- invalid_server_id = data_utils.rand_uuid()
- self.assertRaises(lib_exc.NotFound,
- self.servers_client.list_virtual_interfaces,
- invalid_server_id)
diff --git a/tempest/api/identity/v3/test_access_rules.py b/tempest/api/identity/v3/test_access_rules.py
index 608eb59..64a6959 100644
--- a/tempest/api/identity/v3/test_access_rules.py
+++ b/tempest/api/identity/v3/test_access_rules.py
@@ -17,6 +17,7 @@
from tempest.api.identity import base
from tempest import config
from tempest.lib.common.utils import data_utils
+from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
@@ -37,10 +38,6 @@
super(AccessRulesV3Test, cls).resource_setup()
cls.user_id = cls.os_primary.credentials.user_id
cls.project_id = cls.os_primary.credentials.project_id
-
- def setUp(self):
- super(AccessRulesV3Test, self).setUp()
- ac = self.non_admin_app_creds_client
access_rules = [
{
"path": "/v2.1/servers/*/ips",
@@ -48,11 +45,15 @@
"service": "compute"
}
]
- self.app_cred = ac.create_application_credential(
- self.user_id,
+ cls.ac = cls.non_admin_app_creds_client
+ cls.app_cred = cls.ac.create_application_credential(
+ cls.user_id,
name=data_utils.rand_name('application_credential'),
access_rules=access_rules
)['application_credential']
+ cls.addClassResourceCleanup(
+ cls.ac.delete_application_credential,
+ cls.user_id, cls.app_cred['id'])
@decorators.idempotent_id('2354c498-5119-4ba5-9f0d-44f16f78fb0e')
def test_list_access_rules(self):
@@ -67,18 +68,33 @@
@decorators.idempotent_id('278757e9-e193-4bf8-adf2-0b0a229a17d0')
def test_delete_access_rule(self):
- access_rule_id = self.app_cred['access_rules'][0]['id']
- app_cred_id = self.app_cred['id']
+ access_rules = [
+ {
+ "path": "/v2.1/servers/*/ips",
+ "method": "GET",
+ "service": "monitoring"
+ }
+ ]
+ app_cred = self.ac.create_application_credential(
+ self.user_id,
+ name=data_utils.rand_name('application_credential'),
+ access_rules=access_rules
+ )['application_credential']
+ self.addCleanup(
+ test_utils.call_and_ignore_notfound_exc,
+ self.ac.delete_application_credential,
+ self.user_id, app_cred['id'])
+ access_rule_id = app_cred['access_rules'][0]['id']
self.assertRaises(
lib_exc.Forbidden,
self.non_admin_access_rules_client.delete_access_rule,
self.user_id,
access_rule_id)
- self.non_admin_app_creds_client.delete_application_credential(
- self.user_id, app_cred_id)
+ self.ac.delete_application_credential(
+ self.user_id, app_cred['id'])
ar = self.non_admin_access_rules_client.list_access_rules(self.user_id)
- self.assertEqual(1, len(ar['access_rules']))
+ self.assertIn(access_rule_id, [x['id'] for x in ar['access_rules']])
self.non_admin_access_rules_client.delete_access_rule(
self.user_id, access_rule_id)
ar = self.non_admin_access_rules_client.list_access_rules(self.user_id)
- self.assertEqual(0, len(ar['access_rules']))
+ self.assertNotIn(access_rule_id, [x['id'] for x in ar['access_rules']])
diff --git a/tempest/api/image/base.py b/tempest/api/image/base.py
index 11a1e6c..7bae712 100644
--- a/tempest/api/image/base.py
+++ b/tempest/api/image/base.py
@@ -12,10 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-import io
import time
-from tempest.common import image as common_image
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib.common.utils import test_utils
@@ -56,17 +54,7 @@
name = data_utils.rand_name(cls.__name__ + "-image")
kwargs['name'] = name
- params = cls._get_create_params(**kwargs)
- if data:
- # NOTE: On glance v1 API, the data should be passed on
- # a header. Then here handles the data separately.
- params['data'] = data
-
- image = cls.client.create_image(**params)
- # Image objects returned by the v1 client have the image
- # data inside a dict that is keyed against 'image'.
- if 'image' in image:
- image = image['image']
+ image = cls.client.create_image(**kwargs)
cls.created_images.append(image['id'])
cls.addClassResourceCleanup(cls.client.wait_for_resource_deletion,
image['id'])
@@ -74,54 +62,6 @@
cls.client.delete_image, image['id'])
return image
- @classmethod
- def _get_create_params(cls, **kwargs):
- return kwargs
-
-
-class BaseV1ImageTest(BaseImageTest):
-
- @classmethod
- def skip_checks(cls):
- super(BaseV1ImageTest, cls).skip_checks()
- if not CONF.image_feature_enabled.api_v1:
- msg = "Glance API v1 not supported"
- raise cls.skipException(msg)
-
- @classmethod
- def setup_clients(cls):
- super(BaseV1ImageTest, cls).setup_clients()
- cls.client = cls.os_primary.image_client
-
- @classmethod
- def _get_create_params(cls, **kwargs):
- return {'headers': common_image.image_meta_to_headers(**kwargs)}
-
-
-class BaseV1ImageMembersTest(BaseV1ImageTest):
-
- credentials = ['primary', 'alt']
-
- @classmethod
- def setup_clients(cls):
- super(BaseV1ImageMembersTest, cls).setup_clients()
- cls.image_member_client = cls.os_primary.image_member_client
- cls.alt_image_member_client = cls.os_alt.image_member_client
- cls.alt_img_cli = cls.os_alt.image_client
-
- @classmethod
- def resource_setup(cls):
- super(BaseV1ImageMembersTest, cls).resource_setup()
- cls.alt_tenant_id = cls.alt_image_member_client.tenant_id
-
- def _create_image(self):
- image_file = io.BytesIO(data_utils.random_bytes())
- image = self.create_image(container_format='bare',
- disk_format='raw',
- is_public=False,
- data=image_file)
- return image['id']
-
class BaseV2ImageTest(BaseImageTest):
diff --git a/tempest/api/image/v1/__init__.py b/tempest/api/image/v1/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/api/image/v1/__init__.py
+++ /dev/null
diff --git a/tempest/api/image/v1/test_image_members.py b/tempest/api/image/v1/test_image_members.py
deleted file mode 100644
index 5e2c8af..0000000
--- a/tempest/api/image/v1/test_image_members.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright 2013 IBM Corp.
-#
-# 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.image import base
-from tempest.lib import decorators
-from tempest.lib import exceptions as lib_exc
-
-
-class ImageMembersTest(base.BaseV1ImageMembersTest):
- """Test image members"""
-
- @decorators.idempotent_id('1d6ef640-3a20-4c84-8710-d95828fdb6ad')
- def test_add_image_member(self):
- """Test adding member for image"""
- image = self._create_image()
- self.image_member_client.create_image_member(image, self.alt_tenant_id)
- body = self.image_member_client.list_image_members(image)
- members = body['members']
- members = [member['member_id'] for member in members]
- self.assertIn(self.alt_tenant_id, members)
- # get image as alt user
- self.alt_img_cli.show_image(image)
-
- @decorators.idempotent_id('6a5328a5-80e8-4b82-bd32-6c061f128da9')
- def test_get_shared_images(self):
- """Test getting shared images"""
- image = self._create_image()
- self.image_member_client.create_image_member(image, self.alt_tenant_id)
- share_image = self._create_image()
- self.image_member_client.create_image_member(share_image,
- self.alt_tenant_id)
- body = self.image_member_client.list_shared_images(
- self.alt_tenant_id)
- images = body['shared_images']
- images = [img['image_id'] for img in images]
- self.assertIn(share_image, images)
- self.assertIn(image, images)
-
- @decorators.idempotent_id('a76a3191-8948-4b44-a9d6-4053e5f2b138')
- def test_remove_member(self):
- """Test removing member from image"""
- image_id = self._create_image()
- self.image_member_client.create_image_member(image_id,
- self.alt_tenant_id)
- self.image_member_client.delete_image_member(image_id,
- self.alt_tenant_id)
- body = self.image_member_client.list_image_members(image_id)
- members = body['members']
- self.assertEmpty(members)
- self.assertRaises(
- lib_exc.NotFound, self.alt_img_cli.show_image, image_id)
diff --git a/tempest/api/image/v1/test_image_members_negative.py b/tempest/api/image/v1/test_image_members_negative.py
deleted file mode 100644
index 4e3c27c..0000000
--- a/tempest/api/image/v1/test_image_members_negative.py
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright 2013 IBM Corp.
-#
-# 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.image import base
-from tempest.lib.common.utils import data_utils
-from tempest.lib import decorators
-from tempest.lib import exceptions as lib_exc
-
-
-class ImageMembersNegativeTest(base.BaseV1ImageMembersTest):
- """Negative tests of image members"""
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('147a9536-18e3-45da-91ea-b037a028f364')
- def test_add_member_with_non_existing_image(self):
- """Add member with non existing image"""
- non_exist_image = data_utils.rand_uuid()
- self.assertRaises(lib_exc.NotFound,
- self.image_member_client.create_image_member,
- non_exist_image, self.alt_tenant_id)
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('e1559f05-b667-4f1b-a7af-518b52dc0c0f')
- def test_delete_member_with_non_existing_image(self):
- """Delete member with non existing image"""
- non_exist_image = data_utils.rand_uuid()
- self.assertRaises(lib_exc.NotFound,
- self.image_member_client.delete_image_member,
- non_exist_image, self.alt_tenant_id)
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('f5720333-dd69-4194-bb76-d2f048addd56')
- def test_delete_member_with_non_existing_tenant(self):
- """Delete member from image with non existing tenant"""
- image_id = self._create_image()
- non_exist_tenant = data_utils.rand_uuid_hex()
- self.assertRaises(lib_exc.NotFound,
- self.image_member_client.delete_image_member,
- image_id, non_exist_tenant)
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('f25f89e4-0b6c-453b-a853-1f80b9d7ef26')
- def test_get_image_without_membership(self):
- """Get image without membership
-
- Image is hidden from another tenants.
- """
- image_id = self._create_image()
- self.assertRaises(lib_exc.NotFound,
- self.alt_img_cli.show_image,
- image_id)
diff --git a/tempest/api/image/v1/test_images.py b/tempest/api/image/v1/test_images.py
deleted file mode 100644
index 6fd6c4e..0000000
--- a/tempest/api/image/v1/test_images.py
+++ /dev/null
@@ -1,341 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-import io
-
-from tempest.api.image import base
-from tempest.common import image as common_image
-from tempest.common import waiters
-from tempest import config
-from tempest.lib.common.utils import data_utils
-from tempest.lib import decorators
-from tempest.lib import exceptions
-
-CONF = config.CONF
-
-
-def get_container_and_disk_format():
- a_formats = ['ami', 'ari', 'aki']
-
- container_format = CONF.image.container_formats[0]
-
- # In v1, If container_format is one of ['ami', 'ari', 'aki'], then
- # disk_format must be same with container_format.
- # If they are of different item sequence in tempest.conf, such as:
- # container_formats = ami,ari,aki,bare
- # disk_formats = ari,ami,aki,vhd
- # we can select one in disk_format list that is same with container_format.
- if container_format in a_formats:
- if container_format in CONF.image.disk_formats:
- disk_format = container_format
- else:
- msg = ("The container format and the disk format don't match. "
- "Container format: %(container)s, Disk format: %(disk)s." %
- {'container': container_format, 'disk':
- CONF.image.disk_formats})
- raise exceptions.InvalidConfiguration(msg)
- else:
- disk_format = CONF.image.disk_formats[0]
-
- return container_format, disk_format
-
-
-class CreateRegisterImagesTest(base.BaseV1ImageTest):
- """Here we test the registration and creation of images."""
-
- @decorators.idempotent_id('3027f8e6-3492-4a11-8575-c3293017af4d')
- def test_register_then_upload(self):
- """Register, then upload an image"""
- properties = {'prop1': 'val1'}
- container_format, disk_format = get_container_and_disk_format()
- image = self.create_image(name='New Name',
- container_format=container_format,
- disk_format=disk_format,
- is_public=False,
- properties=properties)
- self.assertEqual('New Name', image.get('name'))
- self.assertFalse(image.get('is_public'))
- self.assertEqual('queued', image.get('status'))
- for key, val in properties.items():
- self.assertEqual(val, image.get('properties')[key])
-
- # Now try uploading an image file
- image_file = io.BytesIO(data_utils.random_bytes())
- body = self.client.update_image(image['id'], data=image_file)['image']
- self.assertIn('size', body)
- self.assertEqual(1024, body.get('size'))
-
- @decorators.idempotent_id('69da74d9-68a9-404b-9664-ff7164ccb0f5')
- def test_register_remote_image(self):
- """Register a new remote image"""
- container_format, disk_format = get_container_and_disk_format()
- body = self.create_image(name='New Remote Image',
- container_format=container_format,
- disk_format=disk_format, is_public=False,
- location=CONF.image.http_image,
- properties={'key1': 'value1',
- 'key2': 'value2'})
- self.assertEqual('New Remote Image', body.get('name'))
- self.assertFalse(body.get('is_public'))
- self.assertEqual('active', body.get('status'))
- properties = body.get('properties')
- self.assertEqual(properties['key1'], 'value1')
- self.assertEqual(properties['key2'], 'value2')
-
- @decorators.idempotent_id('6d0e13a7-515b-460c-b91f-9f4793f09816')
- def test_register_http_image(self):
- """Register a new image from an http image path url"""
- container_format, disk_format = get_container_and_disk_format()
- image = self.create_image(name='New Http Image',
- container_format=container_format,
- disk_format=disk_format, is_public=False,
- copy_from=CONF.image.http_image)
- self.assertEqual('New Http Image', image.get('name'))
- self.assertFalse(image.get('is_public'))
- waiters.wait_for_image_status(self.client, image['id'], 'active')
- self.client.show_image(image['id'])
-
- @decorators.idempotent_id('05b19d55-140c-40d0-b36b-fafd774d421b')
- def test_register_image_with_min_ram(self):
- """Register an image with min ram"""
- container_format, disk_format = get_container_and_disk_format()
- properties = {'prop1': 'val1'}
- body = self.create_image(name='New_image_with_min_ram',
- container_format=container_format,
- disk_format=disk_format,
- is_public=False,
- min_ram=40,
- properties=properties)
- self.assertEqual('New_image_with_min_ram', body.get('name'))
- self.assertFalse(body.get('is_public'))
- self.assertEqual('queued', body.get('status'))
- self.assertEqual(40, body.get('min_ram'))
- for key, val in properties.items():
- self.assertEqual(val, body.get('properties')[key])
- self.client.delete_image(body['id'])
-
-
-class ListImagesTest(base.BaseV1ImageTest):
- """Here we test the listing of image information"""
-
- @classmethod
- def skip_checks(cls):
- super(ListImagesTest, cls).skip_checks()
- if (len(CONF.image.container_formats) < 2 or
- len(CONF.image.disk_formats) < 2):
- skip_msg = ("%s skipped as multiple container formats "
- "or disk formats are not available." % cls.__name__)
- raise cls.skipException(skip_msg)
-
- @classmethod
- def resource_setup(cls):
- super(ListImagesTest, cls).resource_setup()
- # We add a few images here to test the listing functionality of
- # the images API
- a_formats = ['ami', 'ari', 'aki']
-
- (cls.container_format,
- container_format_alt) = CONF.image.container_formats[:2]
- cls.disk_format, cls.disk_format_alt = CONF.image.disk_formats[:2]
- if cls.container_format in a_formats:
- cls.disk_format = cls.container_format
- if container_format_alt in a_formats:
- cls.disk_format_alt = container_format_alt
-
- img1 = cls._create_remote_image('one', cls.container_format,
- cls.disk_format)
- img2 = cls._create_remote_image('two', container_format_alt,
- cls.disk_format_alt)
- img3 = cls._create_remote_image('dup', cls.container_format,
- cls.disk_format)
- img4 = cls._create_remote_image('dup', cls.container_format,
- cls.disk_format)
- img5 = cls._create_standard_image('1', container_format_alt,
- cls.disk_format_alt, 42)
- img6 = cls._create_standard_image('2', container_format_alt,
- cls.disk_format_alt, 142)
- img7 = cls._create_standard_image('33', cls.container_format,
- cls.disk_format, 142)
- img8 = cls._create_standard_image('33', cls.container_format,
- cls.disk_format, 142)
- cls.created_set = set(cls.created_images)
- # same container format
- cls.same_container_format_set = set((img1, img3, img4, img7, img8))
- # same disk format
- cls.same_disk_format_set = set((img2, img5, img6))
-
- # 1x with size 42
- cls.size42_set = set((img5,))
- # 3x with size 142
- cls.size142_set = set((img6, img7, img8,))
- # dup named
- cls.dup_set = set((img3, img4))
-
- @classmethod
- def _create_remote_image(cls, name, container_format, disk_format):
- """Create a new remote image and return newly-registered image-id"""
-
- name = 'New Remote Image %s' % name
- location = CONF.image.http_image
- image = cls.create_image(name=name,
- container_format=container_format,
- disk_format=disk_format,
- is_public=False,
- location=location)
- return image['id']
-
- @classmethod
- def _create_standard_image(cls, name, container_format,
- disk_format, size):
- """Create a new standard image and return newly-registered image-id
-
- Note that the size of the new image is a random number between
- 1024 and 4096
- """
- image_file = io.BytesIO(data_utils.random_bytes(size))
- name = 'New Standard Image %s' % name
- image = cls.create_image(name=name,
- container_format=container_format,
- disk_format=disk_format,
- is_public=False, data=image_file)
- return image['id']
-
- @decorators.idempotent_id('246178ab-3b33-4212-9a4b-a7fe8261794d')
- def test_index_no_params(self):
- """Simple test to see all fixture images returned"""
- images_list = self.client.list_images()['images']
- image_list = [image['id'] for image in images_list]
- for image_id in self.created_images:
- self.assertIn(image_id, image_list)
-
- @decorators.idempotent_id('f1755589-63d6-4468-b098-589820eb4031')
- def test_index_disk_format(self):
- """Test listing images by disk format"""
- images_list = self.client.list_images(
- disk_format=self.disk_format_alt)['images']
- for image in images_list:
- self.assertEqual(image['disk_format'], self.disk_format_alt)
- result_set = set(map(lambda x: x['id'], images_list))
- self.assertTrue(self.same_disk_format_set <= result_set)
- self.assertFalse(self.created_set - self.same_disk_format_set <=
- result_set)
-
- @decorators.idempotent_id('2143655d-96d9-4bec-9188-8674206b4b3b')
- def test_index_container_format(self):
- """Test listing images by container format"""
- images_list = self.client.list_images(
- container_format=self.container_format)['images']
- for image in images_list:
- self.assertEqual(image['container_format'], self.container_format)
- result_set = set(map(lambda x: x['id'], images_list))
- self.assertTrue(self.same_container_format_set <= result_set)
- self.assertFalse(self.created_set - self.same_container_format_set <=
- result_set)
-
- @decorators.idempotent_id('feb32ac6-22bb-4a16-afd8-9454bb714b14')
- def test_index_max_size(self):
- """Test listing images by max size"""
- images_list = self.client.list_images(size_max=42)['images']
- for image in images_list:
- self.assertLessEqual(image['size'], 42)
- result_set = set(map(lambda x: x['id'], images_list))
- self.assertTrue(self.size42_set <= result_set)
- self.assertFalse(self.created_set - self.size42_set <= result_set)
-
- @decorators.idempotent_id('6ffc16d0-4cbf-4401-95c8-4ac63eac34d8')
- def test_index_min_size(self):
- """Test listing images by min size"""
- images_list = self.client.list_images(size_min=142)['images']
- for image in images_list:
- self.assertGreaterEqual(image['size'], 142)
- result_set = set(map(lambda x: x['id'], images_list))
- self.assertTrue(self.size142_set <= result_set)
- self.assertFalse(self.size42_set <= result_set)
-
- @decorators.idempotent_id('e5dc26d9-9aa2-48dd-bda5-748e1445da98')
- def test_index_status_active_detail(self):
- """Test listing active images sorting by size in descending order"""
- images_list = self.client.list_images(detail=True,
- status='active',
- sort_key='size',
- sort_dir='desc')['images']
- top_size = images_list[0]['size'] # We have non-zero sized images
- for image in images_list:
- size = image['size']
- self.assertLessEqual(size, top_size)
- top_size = size
- self.assertEqual(image['status'], 'active')
-
- @decorators.idempotent_id('097af10a-bae8-4342-bff4-edf89969ed2a')
- def test_index_name(self):
- """Test listing images by its name"""
- images_list = self.client.list_images(
- detail=True,
- name='New Remote Image dup')['images']
- result_set = set(map(lambda x: x['id'], images_list))
- for image in images_list:
- self.assertEqual(image['name'], 'New Remote Image dup')
- self.assertTrue(self.dup_set <= result_set)
- self.assertFalse(self.created_set - self.dup_set <= result_set)
-
-
-class UpdateImageMetaTest(base.BaseV1ImageTest):
- """Test image metadata"""
-
- @classmethod
- def resource_setup(cls):
- super(UpdateImageMetaTest, cls).resource_setup()
- container_format, disk_format = get_container_and_disk_format()
- cls.image_id = cls._create_standard_image('1', container_format,
- disk_format, 42)
-
- @classmethod
- def _create_standard_image(cls, name, container_format,
- disk_format, size):
- """Create a new standard image and return newly-registered image-id"""
-
- image_file = io.BytesIO(data_utils.random_bytes(size))
- name = 'New Standard Image %s' % name
- image = cls.create_image(name=name,
- container_format=container_format,
- disk_format=disk_format,
- is_public=False, data=image_file,
- properties={'key1': 'value1'})
- return image['id']
-
- @decorators.idempotent_id('01752c1c-0275-4de3-9e5b-876e44541928')
- def test_list_image_metadata(self):
- """Test listing image metadata"""
- # All metadata key/value pairs for an image should be returned
- resp = self.client.check_image(self.image_id)
- resp_metadata = common_image.get_image_meta_from_headers(resp)
- expected = {'key1': 'value1'}
- self.assertEqual(expected, resp_metadata['properties'])
-
- @decorators.idempotent_id('d6d7649c-08ce-440d-9ea7-e3dda552f33c')
- def test_update_image_metadata(self):
- """Test updating image metadata"""
- # The metadata for the image should match the updated values
- req_metadata = {'key1': 'alt1', 'key2': 'value2'}
- resp = self.client.check_image(self.image_id)
- metadata = common_image.get_image_meta_from_headers(resp)
- self.assertEqual(metadata['properties'], {'key1': 'value1'})
- metadata['properties'].update(req_metadata)
- headers = common_image.image_meta_to_headers(
- properties=metadata['properties'])
- self.client.update_image(self.image_id, headers=headers)
- resp = self.client.check_image(self.image_id)
- resp_metadata = common_image.get_image_meta_from_headers(resp)
- self.assertEqual(req_metadata, resp_metadata['properties'])
diff --git a/tempest/api/image/v1/test_images_negative.py b/tempest/api/image/v1/test_images_negative.py
deleted file mode 100644
index 2af1288..0000000
--- a/tempest/api/image/v1/test_images_negative.py
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright 2013 IBM Corp.
-# 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.image import base
-from tempest.lib.common.utils import data_utils
-from tempest.lib import decorators
-from tempest.lib import exceptions as lib_exc
-
-
-class CreateDeleteImagesNegativeTest(base.BaseV1ImageTest):
- """Here are negative tests for the deletion and creation of images."""
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('036ede36-6160-4463-8c01-c781eee6369d')
- def test_register_with_invalid_container_format(self):
- """Create image with invalid container format
-
- Negative tests for invalid data supplied to POST /images
- """
- self.assertRaises(lib_exc.BadRequest, self.client.create_image,
- headers={'x-image-meta-name': 'test',
- 'x-image-meta-container_format': 'wrong',
- 'x-image-meta-disk_format': 'vhd'})
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('993face5-921d-4e84-aabf-c1bba4234a67')
- def test_register_with_invalid_disk_format(self):
- """Create image with invalid disk format"""
- self.assertRaises(lib_exc.BadRequest, self.client.create_image,
- headers={'x-image-meta-name': 'test',
- 'x-image-meta-container_format': 'bare',
- 'x-image-meta-disk_format': 'wrong'})
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('ec652588-7e3c-4b67-a2f2-0fa96f57c8fc')
- def test_delete_non_existent_image(self):
- """Return an error while trying to delete a non-existent image"""
-
- non_existent_image_id = data_utils.rand_uuid()
- self.assertRaises(lib_exc.NotFound, self.client.delete_image,
- non_existent_image_id)
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('04f72aa3-fcec-45a3-81a3-308ef7cc82bc')
- def test_delete_image_blank_id(self):
- """Return an error while trying to delete an image with blank Id"""
- self.assertRaises(lib_exc.NotFound, self.client.delete_image, '')
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('950e5054-a3c7-4dee-ada5-e576f1087abd')
- def test_delete_image_non_hex_string_id(self):
- """Return an error while trying to delete an image with non hex id"""
- invalid_image_id = data_utils.rand_uuid()[:-1] + "j"
- self.assertRaises(lib_exc.NotFound, self.client.delete_image,
- invalid_image_id)
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('4ed757cd-450c-44b1-9fd1-c819748c650d')
- def test_delete_image_negative_image_id(self):
- """Return an error while trying to delete an image with negative id"""
- self.assertRaises(lib_exc.NotFound, self.client.delete_image, -1)
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('a4a448ab-3db2-4d2d-b9b2-6a1271241dfe')
- def test_delete_image_id_over_character_limit(self):
- """Return an error while trying to delete image with id over limit"""
- overlimit_image_id = data_utils.rand_uuid() + "1"
- self.assertRaises(lib_exc.NotFound, self.client.delete_image,
- overlimit_image_id)
diff --git a/tempest/api/image/v2/admin/test_image_task.py b/tempest/api/image/v2/admin/test_image_task.py
index 8cebdae..9439e91 100644
--- a/tempest/api/image/v2/admin/test_image_task.py
+++ b/tempest/api/image/v2/admin/test_image_task.py
@@ -94,6 +94,7 @@
self.assertEqual(observed_disk_format, expected_disk_format,
message="Expected disk format not match ")
+ @decorators.skip_because(bug='2030527')
@decorators.idempotent_id('669d5387-0340-4abf-b62d-7cc89f539c8c')
def test_image_tasks_create(self):
"""Test task type 'import' image """
diff --git a/tempest/api/network/admin/test_negative_quotas.py b/tempest/api/network/admin/test_negative_quotas.py
deleted file mode 100644
index 1ce9f47..0000000
--- a/tempest/api/network/admin/test_negative_quotas.py
+++ /dev/null
@@ -1,86 +0,0 @@
-# Copyright 2015 Cloudwatt
-# 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.network import base
-from tempest.common import identity
-from tempest.common import utils
-from tempest.lib.common.utils import data_utils
-from tempest.lib.common.utils import test_utils
-from tempest.lib import decorators
-from tempest.lib import exceptions as lib_exc
-
-
-class QuotasNegativeTest(base.BaseAdminNetworkTest):
- """Tests the following operations in the Neutron API:
-
- set network quota and exceed this quota
-
- v2.0 of the API is assumed.
- It is also assumed that the per-project quota extension API is configured
- in /etc/neutron/neutron.conf as follows:
-
- quota_driver = neutron.db.quota.driver.DbQuotaDriver
- """
-
- @classmethod
- def skip_checks(cls):
- super(QuotasNegativeTest, cls).skip_checks()
- if not utils.is_extension_enabled('quotas', 'network'):
- msg = "quotas extension not enabled."
- raise cls.skipException(msg)
-
- def setUp(self):
- super(QuotasNegativeTest, self).setUp()
- name = data_utils.rand_name('test_project_')
- description = data_utils.rand_name('desc_')
- self.creds_client = identity.identity_utils(self.os_admin)
- self.project = self.creds_client.create_project(
- name=name, description=description)
- self.addCleanup(identity.identity_utils(self.os_admin).delete_project,
- self.project['id'])
-
- def tearDown(self):
- super(QuotasNegativeTest, self).tearDown()
- self.credentials_provider.cleanup_default_secgroup(
- self.os_admin.security_groups_client, self.project['id'])
-
- @decorators.attr(type=['negative'])
- @decorators.idempotent_id('644f4e1b-1bf9-4af0-9fd8-eb56ac0f51cf')
- def test_network_quota_exceeding(self):
- """Test creating network when exceeding network quota will fail"""
- # Set the network quota to two
- self.admin_quotas_client.update_quotas(self.project['id'], network=2)
-
- # Create two networks
- n1 = self.admin_networks_client.create_network(
- project_id=self.project['id'])
- self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- self.admin_networks_client.delete_network,
- n1['network']['id'])
- n2 = self.admin_networks_client.create_network(
- project_id=self.project['id'])
- self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- self.admin_networks_client.delete_network,
- n2['network']['id'])
-
- # Try to create a third network while the quota is two
- with self.assertRaisesRegex(
- lib_exc.Conflict,
- r"Quota exceeded for resources: \['network'\].*"):
- n3 = self.admin_networks_client.create_network(
- project_id=self.project['id'])
- self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- self.admin_networks_client.delete_network,
- n3['network']['id'])
diff --git a/tempest/api/network/admin/test_quotas.py b/tempest/api/network/admin/test_quotas.py
deleted file mode 100644
index d8db298..0000000
--- a/tempest/api/network/admin/test_quotas.py
+++ /dev/null
@@ -1,107 +0,0 @@
-# Copyright 2013 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-import testtools
-
-from tempest.api.network import base
-from tempest.common import identity
-from tempest.common import utils
-from tempest.lib.common.utils import data_utils
-from tempest.lib.common.utils import test_utils
-from tempest.lib import decorators
-
-
-class QuotasTest(base.BaseAdminNetworkTest):
- """Tests the following operations in the Neutron API:
-
- list quotas for projects who have non-default quota values
- show quotas for a specified project
- update quotas for a specified project
- reset quotas to default values for a specified project
-
- v2.0 of the API is assumed.
- It is also assumed that the per-project quota extension API is configured
- in /etc/neutron/neutron.conf as follows:
-
- quota_driver = neutron.db.quota.driver.DbQuotaDriver
- """
-
- @classmethod
- def skip_checks(cls):
- super(QuotasTest, cls).skip_checks()
- if not utils.is_extension_enabled('quotas', 'network'):
- msg = "quotas extension not enabled."
- raise cls.skipException(msg)
-
- def _check_quotas(self, new_quotas):
- # Add a project to conduct the test
- project = data_utils.rand_name('test_project_')
- description = data_utils.rand_name('desc_')
- project = identity.identity_utils(self.os_admin).create_project(
- name=project, description=description)
- project_id = project['id']
- self.addCleanup(identity.identity_utils(self.os_admin).delete_project,
- project_id)
-
- # Change quotas for project
- quota_set = self.admin_quotas_client.update_quotas(
- project_id, **new_quotas)['quota']
- self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- self.admin_quotas_client.reset_quotas, project_id)
- for key, value in new_quotas.items():
- self.assertEqual(value, quota_set[key])
-
- # Confirm our project is listed among projects with non default quotas
- non_default_quotas = self.admin_quotas_client.list_quotas()
- found = False
- for qs in non_default_quotas['quotas']:
- if qs['project_id'] == project_id:
- found = True
- self.assertTrue(found)
-
- # Confirm from API quotas were changed as requested for project
- quota_set = self.admin_quotas_client.show_quotas(project_id)
- quota_set = quota_set['quota']
- for key, value in new_quotas.items():
- self.assertEqual(value, quota_set[key])
-
- # Reset quotas to default and confirm
- self.admin_quotas_client.reset_quotas(project_id)
- non_default_quotas = self.admin_quotas_client.list_quotas()
- for q in non_default_quotas['quotas']:
- self.assertNotEqual(project_id, q['project_id'])
- quota_set = self.admin_quotas_client.show_quotas(project_id)['quota']
- default_quotas = self.admin_quotas_client.show_default_quotas(
- project_id)['quota']
- self.assertEqual(default_quotas, quota_set)
-
- @decorators.idempotent_id('2390f766-836d-40ef-9aeb-e810d78207fb')
- def test_quotas(self):
- """Test update/list/show/reset of network quotas"""
- new_quotas = {'network': 0, 'port': 0}
- self._check_quotas(new_quotas)
-
- @testtools.skipUnless(utils.is_extension_enabled(
- 'quota_details', 'network'), 'Quota details extension not enabled.')
- @decorators.idempotent_id('7b05ec5f-bf44-43cb-b28f-ddd72a824288')
- def test_show_quota_details(self):
- """Test showing network quota details"""
- # Show quota details for an existing project
- quota_details = self.admin_quotas_client.show_quota_details(
- self.admin_quotas_client.tenant_id)['quota']
- expected_keys = ['used', 'limit', 'reserved']
- for resource_type in quota_details:
- for key in expected_keys:
- self.assertIn(key, quota_details[resource_type])
diff --git a/tempest/clients.py b/tempest/clients.py
index 99e114c..5b31cf8 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -83,8 +83,6 @@
def _set_image_clients(self):
if CONF.service_available.glance:
- self.image_client = self.image_v1.ImagesClient()
- self.image_member_client = self.image_v1.ImageMembersClient()
self.image_client_v2 = self.image_v2.ImagesClient()
self.image_member_client_v2 = self.image_v2.ImageMembersClient()
self.image_cache_client = self.image_v2.ImageCacheClient()
@@ -125,15 +123,12 @@
self.quota_classes_client = self.compute.QuotaClassesClient()
self.flavors_client = self.compute.FlavorsClient()
self.extensions_client = self.compute.ExtensionsClient()
- self.floating_ip_pools_client = self.compute.FloatingIPPoolsClient()
- self.floating_ips_bulk_client = self.compute.FloatingIPsBulkClient()
self.compute_floating_ips_client = self.compute.FloatingIPsClient()
self.compute_security_group_rules_client = (
self.compute.SecurityGroupRulesClient())
self.compute_security_groups_client = (
self.compute.SecurityGroupsClient())
self.interfaces_client = self.compute.InterfacesClient()
- self.fixed_ips_client = self.compute.FixedIPsClient()
self.availability_zone_client = self.compute.AvailabilityZoneClient()
self.aggregates_client = self.compute.AggregatesClient()
self.services_client = self.compute.ServicesClient()
diff --git a/tempest/cmd/verify_tempest_config.py b/tempest/cmd/verify_tempest_config.py
index 3d476b9..b105c70 100644
--- a/tempest/cmd/verify_tempest_config.py
+++ b/tempest/cmd/verify_tempest_config.py
@@ -118,25 +118,16 @@
# Since we want to verify that the configuration is correct, we cannot
# rely on a specific version of the API being available.
try:
- _, versions = os.image_v1.ImagesClient().get_versions()
+ versions = os.image_v2.VersionsClient().list_versions()['versions']
+ versions = [x['id'] for x in versions]
except lib_exc.NotFound:
- # If not found, we use v2. The assumption is that either v1 or v2
- # are available, since glance is marked as available in the catalog.
- # If not, glance should be disabled in Tempest conf.
- try:
- versions = os.image_v2.VersionsClient().list_versions()['versions']
- versions = [x['id'] for x in versions]
- except lib_exc.NotFound:
- msg = ('Glance is available in the catalog, but no known version, '
- '(v1.x or v2.x) of Glance could be found, so Glance should '
- 'be configured as not available')
- LOG.warning(msg)
- print_and_or_update('glance', 'service-available', False, update)
- return
+ msg = ('Glance is available in the catalog, but no known version, '
+ 'of Glance could be found, so Glance should '
+ 'be configured as not available')
+ LOG.warning(msg)
+ print_and_or_update('glance', 'service-available', False, update)
+ return
- if CONF.image_feature_enabled.api_v1 != contains_version('v1.', versions):
- print_and_or_update('api_v1', 'image-feature-enabled',
- not CONF.image_feature_enabled.api_v1, update)
if CONF.image_feature_enabled.api_v2 != contains_version('v2.', versions):
print_and_or_update('api_v2', 'image-feature-enabled',
not CONF.image_feature_enabled.api_v2, update)
diff --git a/tempest/common/utils/linux/remote_client.py b/tempest/common/utils/linux/remote_client.py
index 4fdf6a4..0d93430 100644
--- a/tempest/common/utils/linux/remote_client.py
+++ b/tempest/common/utils/linux/remote_client.py
@@ -183,7 +183,7 @@
self.exec_command('sudo umount %s' % mount_path)
def make_fs(self, dev_name, fs='ext4'):
- cmd_mkfs = 'sudo mke2fs -t %s /dev/%s' % (fs, dev_name)
+ cmd_mkfs = 'sudo mkfs -t %s /dev/%s' % (fs, dev_name)
try:
self.exec_command(cmd_mkfs)
except tempest.lib.exceptions.SSHExecCommandFailed:
diff --git a/tempest/common/waiters.py b/tempest/common/waiters.py
index 291f201..d3be6fd 100644
--- a/tempest/common/waiters.py
+++ b/tempest/common/waiters.py
@@ -16,12 +16,10 @@
from oslo_log import log as logging
-from tempest.common import image as common_image
from tempest import config
from tempest import exceptions
from tempest.lib.common.utils import test_utils
from tempest.lib import exceptions as lib_exc
-from tempest.lib.services.image.v1 import images_client as images_v1_client
CONF = config.CONF
LOG = logging.getLogger(__name__)
@@ -156,17 +154,7 @@
The client should have a show_image(image_id) method to get the image.
The client should also have build_interval and build_timeout attributes.
"""
- if isinstance(client, images_v1_client.ImagesClient):
- # The 'check_image' method is used here because the show_image method
- # returns image details plus the image itself which is very expensive.
- # The 'check_image' method returns just image details.
- def _show_image_v1(image_id):
- resp = client.check_image(image_id)
- return common_image.get_image_meta_from_headers(resp)
-
- show_image = _show_image_v1
- else:
- show_image = client.show_image
+ show_image = client.show_image
current_status = 'An unknown status'
start = int(time.time())
diff --git a/tempest/config.py b/tempest/config.py
index 5107726..ee083d8 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -719,14 +719,6 @@
'are current one. In future, Tempest will '
'test v2 APIs only so this config option '
'will be removed.'),
- cfg.BoolOpt('api_v1',
- default=False,
- help="Is the v1 image API enabled",
- deprecated_for_removal=True,
- deprecated_reason='Glance v1 APIs are deprecated and v2 APIs '
- 'are current one. In future, Tempest will '
- 'test v2 APIs only so this config option '
- 'will be removed.'),
# Image import feature is setup in devstack victoria onwards.
# Once all stable branches setup the same via glance standalone
# mode or with uwsgi, we can remove this config option.
diff --git a/tempest/lib/api_schema/response/compute/v2_1/fixed_ips.py b/tempest/lib/api_schema/response/compute/v2_1/fixed_ips.py
deleted file mode 100644
index a653213..0000000
--- a/tempest/lib/api_schema/response/compute/v2_1/fixed_ips.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# 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.lib.api_schema.response.compute.v2_1 import parameter_types
-
-get_fixed_ip = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'fixed_ip': {
- 'type': 'object',
- 'properties': {
- 'address': parameter_types.ip_address,
- 'cidr': {'type': 'string'},
- 'host': {'type': 'string'},
- 'hostname': {'type': 'string'}
- },
- 'additionalProperties': False,
- 'required': ['address', 'cidr', 'host', 'hostname']
- }
- },
- 'additionalProperties': False,
- 'required': ['fixed_ip']
- }
-}
-
-reserve_unreserve_fixed_ip = {
- 'status_code': [202]
-}
diff --git a/tempest/lib/api_schema/response/compute/v2_1/floating_ips.py b/tempest/lib/api_schema/response/compute/v2_1/floating_ips.py
index 0c66590..274540c 100644
--- a/tempest/lib/api_schema/response/compute/v2_1/floating_ips.py
+++ b/tempest/lib/api_schema/response/compute/v2_1/floating_ips.py
@@ -58,91 +58,6 @@
}
}
-list_floating_ip_pools = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'floating_ip_pools': {
- 'type': 'array',
- 'items': {
- 'type': 'object',
- 'properties': {
- 'name': {'type': 'string'}
- },
- 'additionalProperties': False,
- 'required': ['name'],
- }
- }
- },
- 'additionalProperties': False,
- 'required': ['floating_ip_pools'],
- }
-}
-
add_remove_floating_ip = {
'status_code': [202]
}
-
-create_floating_ips_bulk = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'floating_ips_bulk_create': {
- 'type': 'object',
- 'properties': {
- 'interface': {'type': ['string', 'null']},
- 'ip_range': {'type': 'string'},
- 'pool': {'type': ['string', 'null']},
- },
- 'additionalProperties': False,
- 'required': ['interface', 'ip_range', 'pool'],
- }
- },
- 'additionalProperties': False,
- 'required': ['floating_ips_bulk_create'],
- }
-}
-
-delete_floating_ips_bulk = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'floating_ips_bulk_delete': {'type': 'string'}
- },
- 'additionalProperties': False,
- 'required': ['floating_ips_bulk_delete'],
- }
-}
-
-list_floating_ips_bulk = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'floating_ip_info': {
- 'type': 'array',
- 'items': {
- 'type': 'object',
- 'properties': {
- 'address': parameter_types.ip_address,
- 'instance_uuid': {'type': ['string', 'null']},
- 'interface': {'type': ['string', 'null']},
- 'pool': {'type': ['string', 'null']},
- 'project_id': {'type': ['string', 'null']},
- 'fixed_ip': parameter_types.ip_address
- },
- 'additionalProperties': False,
- # NOTE: fixed_ip is introduced after JUNO release,
- # So it is not defined as 'required'.
- 'required': ['address', 'instance_uuid', 'interface',
- 'pool', 'project_id'],
- }
- }
- },
- 'additionalProperties': False,
- 'required': ['floating_ip_info'],
- }
-}
diff --git a/tempest/lib/api_schema/response/compute/v2_1/servers.py b/tempest/lib/api_schema/response/compute/v2_1/servers.py
index bd42afd..14e2d3b 100644
--- a/tempest/lib/api_schema/response/compute/v2_1/servers.py
+++ b/tempest/lib/api_schema/response/compute/v2_1/servers.py
@@ -250,33 +250,6 @@
rescue_server_with_admin_pass['response_body'].update(
{'required': ['adminPass']})
-
-list_virtual_interfaces = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'virtual_interfaces': {
- 'type': 'array',
- 'items': {
- 'type': 'object',
- 'properties': {
- 'id': {'type': 'string'},
- 'mac_address': parameter_types.mac_address,
- 'OS-EXT-VIF-NET:net_id': {'type': 'string'}
- },
- 'additionalProperties': False,
- # 'OS-EXT-VIF-NET:net_id' is API extension So it is
- # not defined as 'required'
- 'required': ['id', 'mac_address']
- }
- }
- },
- 'additionalProperties': False,
- 'required': ['virtual_interfaces']
- }
-}
-
common_attach_volume_info = {
'type': 'object',
'properties': {
diff --git a/tempest/lib/common/utils/test_utils.py b/tempest/lib/common/utils/test_utils.py
index 4cf8351..c79db15 100644
--- a/tempest/lib/common/utils/test_utils.py
+++ b/tempest/lib/common/utils/test_utils.py
@@ -93,6 +93,7 @@
if attempt >= 3:
raise
LOG.warning('Got ServerFault while running %s, retrying...', func)
+ time.sleep(1)
def call_until_true(func, duration, sleep_for, *args, **kwargs):
diff --git a/tempest/lib/services/clients.py b/tempest/lib/services/clients.py
index 8b5c758..86ce6ec 100644
--- a/tempest/lib/services/clients.py
+++ b/tempest/lib/services/clients.py
@@ -48,7 +48,6 @@
'placement': placement,
'identity.v2': identity.v2,
'identity.v3': identity.v3,
- 'image.v1': image.v1,
'image.v2': image.v2,
'network': network,
'object-storage': object_storage,
diff --git a/tempest/lib/services/compute/__init__.py b/tempest/lib/services/compute/__init__.py
index da800af..10ec9be 100644
--- a/tempest/lib/services/compute/__init__.py
+++ b/tempest/lib/services/compute/__init__.py
@@ -24,12 +24,7 @@
CertificatesClient
from tempest.lib.services.compute.extensions_client import \
ExtensionsClient
-from tempest.lib.services.compute.fixed_ips_client import FixedIPsClient
from tempest.lib.services.compute.flavors_client import FlavorsClient
-from tempest.lib.services.compute.floating_ip_pools_client import \
- FloatingIPPoolsClient
-from tempest.lib.services.compute.floating_ips_bulk_client import \
- FloatingIPsBulkClient
from tempest.lib.services.compute.floating_ips_client import \
FloatingIPsClient
from tempest.lib.services.compute.hosts_client import HostsClient
@@ -69,10 +64,9 @@
__all__ = ['AgentsClient', 'AggregatesClient', 'AssistedVolumeSnapshotsClient',
'AvailabilityZoneClient', 'BaremetalNodesClient',
- 'CertificatesClient', 'ExtensionsClient', 'FixedIPsClient',
- 'FlavorsClient', 'FloatingIPPoolsClient',
- 'FloatingIPsBulkClient', 'FloatingIPsClient', 'HostsClient',
- 'HypervisorClient', 'ImagesClient', 'InstanceUsagesAuditLogClient',
+ 'CertificatesClient', 'ExtensionsClient', 'FlavorsClient',
+ 'FloatingIPsClient', 'HostsClient', 'HypervisorClient',
+ 'ImagesClient', 'InstanceUsagesAuditLogClient',
'InterfacesClient', 'KeyPairsClient', 'LimitsClient',
'MigrationsClient', 'NetworksClient', 'QuotaClassesClient',
'QuotasClient', 'SecurityGroupDefaultRulesClient',
diff --git a/tempest/lib/services/compute/fixed_ips_client.py b/tempest/lib/services/compute/fixed_ips_client.py
deleted file mode 100644
index 098c856..0000000
--- a/tempest/lib/services/compute/fixed_ips_client.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 2013 IBM Corp
-# 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 oslo_serialization import jsonutils as json
-
-from tempest.lib.api_schema.response.compute.v2_1 import fixed_ips as schema
-from tempest.lib.common import rest_client
-from tempest.lib.services.compute import base_compute_client
-
-
-class FixedIPsClient(base_compute_client.BaseComputeClient):
-
- def show_fixed_ip(self, fixed_ip):
- url = "os-fixed-ips/%s" % fixed_ip
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.get_fixed_ip, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def reserve_fixed_ip(self, fixed_ip, **kwargs):
- """Reserve/Unreserve a fixed IP.
-
- For a full list of available parameters, please refer to the official
- API reference:
- https://docs.openstack.org/api-ref/compute/#reserve-or-release-a-fixed-ip
- """
- url = "os-fixed-ips/%s/action" % fixed_ip
- resp, body = self.post(url, json.dumps(kwargs))
- self.validate_response(schema.reserve_unreserve_fixed_ip, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest/lib/services/compute/floating_ip_pools_client.py b/tempest/lib/services/compute/floating_ip_pools_client.py
deleted file mode 100644
index aa065b8..0000000
--- a/tempest/lib/services/compute/floating_ip_pools_client.py
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from urllib import parse as urllib
-
-from oslo_serialization import jsonutils as json
-
-from tempest.lib.api_schema.response.compute.v2_1 import floating_ips as schema
-from tempest.lib.common import rest_client
-from tempest.lib.services.compute import base_compute_client
-
-
-class FloatingIPPoolsClient(base_compute_client.BaseComputeClient):
-
- def list_floating_ip_pools(self, params=None):
- """Gets all floating IP Pools list."""
- url = 'os-floating-ip-pools'
- if params:
- url += '?%s' % urllib.urlencode(params)
-
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.list_floating_ip_pools, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest/lib/services/compute/floating_ips_bulk_client.py b/tempest/lib/services/compute/floating_ips_bulk_client.py
deleted file mode 100644
index 5f06009..0000000
--- a/tempest/lib/services/compute/floating_ips_bulk_client.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from oslo_serialization import jsonutils as json
-
-from tempest.lib.api_schema.response.compute.v2_1 import floating_ips as schema
-from tempest.lib.common import rest_client
-from tempest.lib.services.compute import base_compute_client
-
-
-class FloatingIPsBulkClient(base_compute_client.BaseComputeClient):
-
- def create_floating_ips_bulk(self, ip_range, pool, interface):
- """Allocate floating IPs in bulk."""
- post_body = {
- 'ip_range': ip_range,
- 'pool': pool,
- 'interface': interface
- }
- post_body = json.dumps({'floating_ips_bulk_create': post_body})
- resp, body = self.post('os-floating-ips-bulk', post_body)
- body = json.loads(body)
- self.validate_response(schema.create_floating_ips_bulk, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def list_floating_ips_bulk(self):
- """Gets all floating IPs in bulk."""
- resp, body = self.get('os-floating-ips-bulk')
- body = json.loads(body)
- self.validate_response(schema.list_floating_ips_bulk, resp, body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_floating_ips_bulk(self, ip_range):
- """Deletes the provided floating IPs in bulk."""
- post_body = json.dumps({'ip_range': ip_range})
- resp, body = self.put('os-floating-ips-bulk/delete', post_body)
- body = json.loads(body)
- self.validate_response(schema.delete_floating_ips_bulk, resp, body)
- return rest_client.ResponseBody(resp, body)
diff --git a/tempest/lib/services/compute/servers_client.py b/tempest/lib/services/compute/servers_client.py
index d2bdb6e..7e3b99f 100644
--- a/tempest/lib/services/compute/servers_client.py
+++ b/tempest/lib/services/compute/servers_client.py
@@ -676,14 +676,6 @@
self.validate_response(schema.get_remote_consoles, resp, body)
return rest_client.ResponseBody(resp, body)
- def list_virtual_interfaces(self, server_id):
- """List the virtual interfaces used in an instance."""
- resp, body = self.get('/'.join(['servers', server_id,
- 'os-virtual-interfaces']))
- body = json.loads(body)
- self.validate_response(schema.list_virtual_interfaces, resp, body)
- return rest_client.ResponseBody(resp, body)
-
def rescue_server(self, server_id, **kwargs):
"""Rescue the provided server.
diff --git a/tempest/lib/services/image/__init__.py b/tempest/lib/services/image/__init__.py
index 4b01663..ee1c32c 100644
--- a/tempest/lib/services/image/__init__.py
+++ b/tempest/lib/services/image/__init__.py
@@ -12,7 +12,6 @@
# License for the specific language governing permissions and limitations under
# the License.
-from tempest.lib.services.image import v1
from tempest.lib.services.image import v2
-__all__ = ['v1', 'v2']
+__all__ = ['v2']
diff --git a/tempest/lib/services/image/v1/__init__.py b/tempest/lib/services/image/v1/__init__.py
deleted file mode 100644
index 1f33cef..0000000
--- a/tempest/lib/services/image/v1/__init__.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
-#
-# 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 warnings
-
-from tempest.lib.services.image.v1.image_members_client import \
- ImageMembersClient
-from tempest.lib.services.image.v1.images_client import ImagesClient
-
-__all__ = ['ImageMembersClient', 'ImagesClient']
-
-
-warnings.warn(
- "The tempest.lib.services.image.v1 module (Image v1 APIs service "
- "clients) is deprecated in favor of tempest.lib.services.image.v2 "
- "(Image v2 APIs service clients) and will be removed once Tempest stop "
- "supporting stable Ussuri.", DeprecationWarning)
diff --git a/tempest/lib/services/image/v1/image_members_client.py b/tempest/lib/services/image/v1/image_members_client.py
deleted file mode 100644
index 7499ec0..0000000
--- a/tempest/lib/services/image/v1/image_members_client.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# 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 oslo_serialization import jsonutils as json
-
-from tempest.lib.common import rest_client
-
-
-class ImageMembersClient(rest_client.RestClient):
- api_version = "v1"
-
- def list_image_members(self, image_id):
- """List all members of an image."""
- url = 'images/%s/members' % image_id
- resp, body = self.get(url)
- self.expected_success(200, resp.status)
- body = json.loads(body)
- return rest_client.ResponseBody(resp, body)
-
- def list_shared_images(self, tenant_id):
- """List image memberships for the given tenant.
-
- For a full list of available parameters, please refer to the official
- API reference:
- https://docs.openstack.org/api-ref/image/v1/#list-shared-images
- """
-
- url = 'shared-images/%s' % tenant_id
- resp, body = self.get(url)
- self.expected_success(200, resp.status)
- body = json.loads(body)
- return rest_client.ResponseBody(resp, body)
-
- def create_image_member(self, image_id, member_id, **kwargs):
- """Add a member to an image.
-
- For a full list of available parameters, please refer to the official
- API reference:
- https://docs.openstack.org/api-ref/image/v1/#add-member-to-image
- """
- url = 'images/%s/members/%s' % (image_id, member_id)
- body = json.dumps({'member': kwargs})
- resp, __ = self.put(url, body)
- self.expected_success(204, resp.status)
- return rest_client.ResponseBody(resp)
-
- def delete_image_member(self, image_id, member_id):
- """Removes a membership from the image.
-
- For a full list of available parameters, please refer to the official
- API reference:
- https://docs.openstack.org/api-ref/image/v1/#remove-member
- """
- url = 'images/%s/members/%s' % (image_id, member_id)
- resp, __ = self.delete(url)
- self.expected_success(204, resp.status)
- return rest_client.ResponseBody(resp)
diff --git a/tempest/lib/services/image/v1/images_client.py b/tempest/lib/services/image/v1/images_client.py
deleted file mode 100644
index c9a4a94..0000000
--- a/tempest/lib/services/image/v1/images_client.py
+++ /dev/null
@@ -1,155 +0,0 @@
-# Copyright 2013 IBM Corp.
-# 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 functools
-from urllib import parse as urllib
-
-from oslo_serialization import jsonutils as json
-
-from tempest.lib.common import rest_client
-from tempest.lib import exceptions as lib_exc
-
-CHUNKSIZE = 1024 * 64 # 64kB
-
-
-class ImagesClient(rest_client.RestClient):
- api_version = "v1"
-
- def _create_with_data(self, headers, data):
- # We are going to do chunked transfert, so split the input data
- # info fixed-sized chunks.
- headers['Content-Type'] = 'application/octet-stream'
- data = iter(functools.partial(data.read, CHUNKSIZE), b'')
- resp, body = self.request('POST', 'images',
- headers=headers, body=data, chunked=True)
- self._error_checker(resp, body)
- body = json.loads(body)
- return rest_client.ResponseBody(resp, body)
-
- def _update_with_data(self, image_id, headers, data):
- # We are going to do chunked transfert, so split the input data
- # info fixed-sized chunks.
- headers['Content-Type'] = 'application/octet-stream'
- data = iter(functools.partial(data.read, CHUNKSIZE), b'')
- url = 'images/%s' % image_id
- resp, body = self.request('PUT', url, headers=headers,
- body=data, chunked=True)
- self._error_checker(resp, body)
- body = json.loads(body)
- return rest_client.ResponseBody(resp, body)
-
- @property
- def http(self):
- if self._http is None:
- self._http = self._get_http()
- return self._http
-
- def create_image(self, data=None, headers=None):
- """Create an image.
-
- For a full list of available parameters, please refer to the official
- API reference:
- https://docs.openstack.org/api-ref/image/v1/index.html#create-image
- """
- if headers is None:
- headers = {}
-
- if data is not None:
- return self._create_with_data(headers, data)
-
- resp, body = self.post('images', None, headers)
- self.expected_success(201, resp.status)
- body = json.loads(body)
- return rest_client.ResponseBody(resp, body)
-
- def update_image(self, image_id, data=None, headers=None):
- """Update an image.
-
- For a full list of available parameters, please refer to the official
- API reference:
- https://docs.openstack.org/api-ref/image/v1/index.html#update-image
- """
- if headers is None:
- headers = {}
-
- if data is not None:
- return self._update_with_data(image_id, headers, data)
-
- url = 'images/%s' % image_id
- resp, body = self.put(url, None, headers)
- self.expected_success(200, resp.status)
- body = json.loads(body)
- return rest_client.ResponseBody(resp, body)
-
- def delete_image(self, image_id):
- url = 'images/%s' % image_id
- resp, body = self.delete(url)
- self.expected_success(200, resp.status)
- return rest_client.ResponseBody(resp, body)
-
- def list_images(self, detail=False, **kwargs):
- """Return a list of all images filtered by input parameters.
-
- For a full list of available parameters, please refer to the official
- API reference:
- https://docs.openstack.org/api-ref/image/v1/#list-images
-
- Most parameters except the following are passed to the API without
- any changes.
- :param changes_since: The name is changed to changes-since
- """
- url = 'images'
-
- if detail:
- url += '/detail'
-
- if 'changes_since' in kwargs:
- kwargs['changes-since'] = kwargs.pop('changes_since')
-
- if kwargs:
- url += '?%s' % urllib.urlencode(kwargs)
-
- resp, body = self.get(url)
- self.expected_success(200, resp.status)
- body = json.loads(body)
- return rest_client.ResponseBody(resp, body)
-
- def check_image(self, image_id):
- """Check image metadata."""
- url = 'images/%s' % image_id
- resp, body = self.head(url)
- self.expected_success(200, resp.status)
- return rest_client.ResponseBody(resp, body)
-
- def show_image(self, image_id):
- """Get image details plus the image itself."""
- url = 'images/%s' % image_id
- resp, body = self.get(url)
- self.expected_success(200, resp.status)
- return rest_client.ResponseBodyData(resp, body)
-
- def is_resource_deleted(self, id):
- try:
- resp = self.check_image(id)
- if resp.response["x-image-meta-status"] == 'deleted':
- return True
- except lib_exc.NotFound:
- return True
- return False
-
- @property
- def resource_type(self):
- """Returns the primary type of resource this client works with."""
- return 'image_meta'
diff --git a/tempest/lib/services/object_storage/container_client.py b/tempest/lib/services/object_storage/container_client.py
index ee87726..bdca0d0 100644
--- a/tempest/lib/services/object_storage/container_client.py
+++ b/tempest/lib/services/object_storage/container_client.py
@@ -43,7 +43,7 @@
url = str(container_name)
resp, body = self.put(url, body=None, headers=headers)
- self.expected_success([201, 202], resp.status)
+ self.expected_success([201, 202, 204], resp.status)
return resp, body
# NOTE: This alias is for the usability because PUT can be used for both
diff --git a/tempest/lib/services/volume/v3/attachments_client.py b/tempest/lib/services/volume/v3/attachments_client.py
index 303341e..ef8be37 100644
--- a/tempest/lib/services/volume/v3/attachments_client.py
+++ b/tempest/lib/services/volume/v3/attachments_client.py
@@ -31,5 +31,6 @@
"""Delete volume attachment."""
url = "attachments/%s" % (attachment_id)
resp, body = self.delete(url)
+ body = json.loads(body)
self.expected_success(200, resp.status)
return rest_client.ResponseBody(resp, body)
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 4d35bbb..0450d94 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -25,7 +25,6 @@
from oslo_utils import netutils
from tempest.common import compute
-from tempest.common import image as common_image
from tempest.common.utils.linux import remote_client
from tempest.common.utils import net_utils
from tempest.common import waiters
@@ -124,15 +123,11 @@
"""This setup the service clients for the tests"""
super(ScenarioTest, cls).setup_clients()
if CONF.service_available.glance:
- # Check if glance v1 is available to determine which client to use.
- if CONF.image_feature_enabled.api_v1:
- cls.image_client = cls.os_primary.image_client
- elif CONF.image_feature_enabled.api_v2:
+ if CONF.image_feature_enabled.api_v2:
cls.image_client = cls.os_primary.image_client_v2
else:
raise lib_exc.InvalidConfiguration(
- 'Either api_v1 or api_v2 must be True in '
- '[image-feature-enabled].')
+ 'api_v2 must be True in [image-feature-enabled].')
cls.setup_compute_client(cls)
cls.setup_network_client(cls)
@@ -371,11 +366,7 @@
if size is None:
size = CONF.volume.volume_size
if imageRef:
- if CONF.image_feature_enabled.api_v1:
- resp = self.image_client.check_image(imageRef)
- image = common_image.get_image_meta_from_headers(resp)
- else:
- image = self.image_client.show_image(imageRef)
+ image = self.image_client.show_image(imageRef)
min_disk = image.get('min_disk')
size = max(size, min_disk)
if name is None:
@@ -796,27 +787,18 @@
'name': name,
'container_format': img_container_format,
'disk_format': img_disk_format or img_container_format,
+ 'visibility': 'private'
}
- if CONF.image_feature_enabled.api_v1:
- params['is_public'] = 'False'
- if img_properties:
- params['properties'] = img_properties
- params = {'headers': common_image.image_meta_to_headers(**params)}
- else:
- params['visibility'] = 'private'
- # Additional properties are flattened out in the v2 API.
- if img_properties:
- params.update(img_properties)
+ # Additional properties are flattened out in the v2 API.
+ if img_properties:
+ params.update(img_properties)
params.update(kwargs)
body = self.image_client.create_image(**params)
image = body['image'] if 'image' in body else body
self.addCleanup(self.image_client.delete_image, image['id'])
self.assertEqual("queued", image['status'])
with open(img_path, 'rb') as image_file:
- if CONF.image_feature_enabled.api_v1:
- self.image_client.update_image(image['id'], data=image_file)
- else:
- self.image_client.store_image_file(image['id'], image_file)
+ self.image_client.store_image_file(image['id'], image_file)
LOG.debug("image:%s", image['id'])
return image['id']
@@ -864,15 +846,9 @@
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
_image_client.delete_image, image_id)
- if CONF.image_feature_enabled.api_v1:
- # In glance v1 the additional properties are stored in the headers
- resp = _image_client.check_image(image_id)
- snapshot_image = common_image.get_image_meta_from_headers(resp)
- image_props = snapshot_image.get('properties', {})
- else:
- # In glance v2 the additional properties are flattened.
- snapshot_image = _image_client.show_image(image_id)
- image_props = snapshot_image
+ # In glance v2 the additional properties are flattened.
+ snapshot_image = _image_client.show_image(image_id)
+ image_props = snapshot_image
bdm = image_props.get('block_device_mapping')
if bdm:
@@ -1129,7 +1105,7 @@
def create_timestamp(self, ip_address, dev_name=None, mount_path='/mnt',
private_key=None, server=None, username=None,
- fs='ext4'):
+ fs='vfat'):
"""Creates timestamp
This wrapper utility does ssh, creates timestamp and returns the
diff --git a/tempest/scenario/test_minimum_basic.py b/tempest/scenario/test_minimum_basic.py
index 5513f4d..6372c6b 100644
--- a/tempest/scenario/test_minimum_basic.py
+++ b/tempest/scenario/test_minimum_basic.py
@@ -38,6 +38,12 @@
* check command outputs
"""
+ @classmethod
+ def skip_checks(cls):
+ super(TestMinimumBasicScenario, cls).skip_checks()
+ if not CONF.service_available.cinder:
+ raise cls.skipException("Cinder is not available")
+
def nova_show(self, server):
got_server = (self.servers_client.show_server(server['id'])
['server'])
diff --git a/tempest/scenario/test_server_volume_attachment.py b/tempest/scenario/test_server_volume_attachment.py
index 1d0d0d0..076b835 100644
--- a/tempest/scenario/test_server_volume_attachment.py
+++ b/tempest/scenario/test_server_volume_attachment.py
@@ -26,6 +26,13 @@
class BaseAttachmentTest(manager.ScenarioTest):
+
+ @classmethod
+ def skip_checks(cls):
+ super(BaseAttachmentTest, cls).skip_checks()
+ if not CONF.service_available.cinder:
+ raise cls.skipException("Cinder is not available")
+
@classmethod
def setup_clients(cls):
super().setup_clients()
diff --git a/tempest/scenario/test_stamp_pattern.py b/tempest/scenario/test_stamp_pattern.py
index 82f0341..92dbffb 100644
--- a/tempest/scenario/test_stamp_pattern.py
+++ b/tempest/scenario/test_stamp_pattern.py
@@ -51,6 +51,8 @@
@classmethod
def skip_checks(cls):
super(TestStampPattern, cls).skip_checks()
+ if not CONF.service_available.cinder:
+ raise cls.skipException("Cinder is not available")
if not CONF.volume_feature_enabled.snapshot:
raise cls.skipException("Cinder volume snapshots are disabled")
diff --git a/tempest/scenario/test_volume_backup_restore.py b/tempest/scenario/test_volume_backup_restore.py
index d0885cf..07ca38a 100644
--- a/tempest/scenario/test_volume_backup_restore.py
+++ b/tempest/scenario/test_volume_backup_restore.py
@@ -41,6 +41,8 @@
@classmethod
def skip_checks(cls):
super(TestVolumeBackupRestore, cls).skip_checks()
+ if not CONF.service_available.cinder:
+ raise cls.skipException("Cinder is not available")
if not CONF.volume_feature_enabled.backup:
raise cls.skipException('Backup is not enable.')
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index 5c5033a..6ebee48 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -31,6 +31,12 @@
# breathing room to get through deletes in the time allotted.
TIMEOUT_SCALING_FACTOR = 2
+ @classmethod
+ def skip_checks(cls):
+ super(TestVolumeBootPattern, cls).skip_checks()
+ if not CONF.service_available.cinder:
+ raise cls.skipException("Cinder is not available")
+
def _delete_server(self, server):
self.servers_client.delete_server(server['id'])
waiters.wait_for_server_termination(self.servers_client, server['id'])
diff --git a/tempest/scenario/test_volume_migrate_attached.py b/tempest/scenario/test_volume_migrate_attached.py
index 57d2a1a..5005346 100644
--- a/tempest/scenario/test_volume_migrate_attached.py
+++ b/tempest/scenario/test_volume_migrate_attached.py
@@ -48,6 +48,8 @@
@classmethod
def skip_checks(cls):
super(TestVolumeMigrateRetypeAttached, cls).skip_checks()
+ if not CONF.service_available.cinder:
+ raise cls.skipException("Cinder is not available")
if not CONF.volume_feature_enabled.multi_backend:
raise cls.skipException("Cinder multi-backend feature disabled")
diff --git a/tempest/tests/cmd/test_verify_tempest_config.py b/tempest/tests/cmd/test_verify_tempest_config.py
index 05ea84e..fa43e58 100644
--- a/tempest/tests/cmd/test_verify_tempest_config.py
+++ b/tempest/tests/cmd/test_verify_tempest_config.py
@@ -178,13 +178,13 @@
def test_verify_glance_version_no_v2_with_v1_1(self):
# This test verifies that wrong config api_v2 = True is detected
class FakeClient(object):
- def get_versions(self):
- return (None, ['v1.1'])
+ def list_versions(self):
+ return {'versions': [{'id': 'v1.1'}]}
fake_os = mock.MagicMock()
fake_module = mock.MagicMock()
- fake_module.ImagesClient = FakeClient
- fake_os.image_v1 = fake_module
+ fake_module.VersionsClient = FakeClient
+ fake_os.image_v2 = fake_module
with mock.patch.object(verify_tempest_config,
'print_and_or_update') as print_mock:
verify_tempest_config.verify_glance_api_versions(fake_os, True)
@@ -194,53 +194,28 @@
def test_verify_glance_version_no_v2_with_v1_0(self):
# This test verifies that wrong config api_v2 = True is detected
class FakeClient(object):
- def get_versions(self):
- return (None, ['v1.0'])
+ def list_versions(self):
+ return {'versions': [{'id': 'v1.0'}]}
fake_os = mock.MagicMock()
fake_module = mock.MagicMock()
- fake_module.ImagesClient = FakeClient
- fake_os.image_v1 = fake_module
+ fake_module.VersionsClient = FakeClient
+ fake_os.image_v2 = fake_module
with mock.patch.object(verify_tempest_config,
'print_and_or_update') as print_mock:
verify_tempest_config.verify_glance_api_versions(fake_os, True)
print_mock.assert_called_with('api_v2', 'image-feature-enabled',
False, True)
- def test_verify_glance_version_no_v1(self):
- # This test verifies that wrong config api_v1 = True is detected
- class FakeClient(object):
- def get_versions(self):
- raise lib_exc.NotFound()
-
- def list_versions(self):
- return {'versions': [{'id': 'v2.0'}]}
-
- fake_os = mock.MagicMock()
- fake_module = mock.MagicMock()
- fake_module.ImagesClient = FakeClient
- fake_module.VersionsClient = FakeClient
- fake_os.image_v1 = fake_module
- fake_os.image_v2 = fake_module
- with mock.patch.object(verify_tempest_config,
- 'print_and_or_update') as print_mock:
- verify_tempest_config.verify_glance_api_versions(fake_os, True)
- print_mock.assert_not_called()
-
def test_verify_glance_version_no_version(self):
- # This test verifies that wrong config api_v1 = True is detected
+ # This test verifies that wrong config api_v2 = True is detected
class FakeClient(object):
- def get_versions(self):
- raise lib_exc.NotFound()
-
def list_versions(self):
raise lib_exc.NotFound()
fake_os = mock.MagicMock()
fake_module = mock.MagicMock()
- fake_module.ImagesClient = FakeClient
fake_module.VersionsClient = FakeClient
- fake_os.image_v1 = fake_module
fake_os.image_v2 = fake_module
with mock.patch.object(verify_tempest_config,
'print_and_or_update') as print_mock:
diff --git a/tempest/tests/lib/services/compute/test_fixedIPs_client.py b/tempest/tests/lib/services/compute/test_fixedIPs_client.py
deleted file mode 100644
index 65bda45..0000000
--- a/tempest/tests/lib/services/compute/test_fixedIPs_client.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright 2015 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.lib.services.compute import fixed_ips_client
-from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services import base
-
-
-class TestFixedIPsClient(base.BaseServiceTest):
- FIXED_IP_INFO = {"fixed_ip": {"address": "10.0.0.1",
- "cidr": "10.11.12.0/24",
- "host": "localhost",
- "hostname": "OpenStack"}}
-
- def setUp(self):
- super(TestFixedIPsClient, self).setUp()
- fake_auth = fake_auth_provider.FakeAuthProvider()
- self.fixedIPsClient = (fixed_ips_client.
- FixedIPsClient
- (fake_auth, 'compute',
- 'regionOne'))
-
- def _test_show_fixed_ip(self, bytes_body=False):
- self.check_service_client_function(
- self.fixedIPsClient.show_fixed_ip,
- 'tempest.lib.common.rest_client.RestClient.get',
- self.FIXED_IP_INFO, bytes_body,
- status=200, fixed_ip='Identifier')
-
- def test_show_fixed_ip_with_str_body(self):
- self._test_show_fixed_ip()
-
- def test_show_fixed_ip_with_bytes_body(self):
- self._test_show_fixed_ip(True)
-
- def _test_reserve_fixed_ip(self, bytes_body=False):
- self.check_service_client_function(
- self.fixedIPsClient.reserve_fixed_ip,
- 'tempest.lib.common.rest_client.RestClient.post',
- {}, bytes_body,
- status=202, fixed_ip='Identifier')
-
- def test_reserve_fixed_ip_with_str_body(self):
- self._test_reserve_fixed_ip()
-
- def test_reserve_fixed_ip_with_bytes_body(self):
- self._test_reserve_fixed_ip(True)
diff --git a/tempest/tests/lib/services/compute/test_floating_ip_pools_client.py b/tempest/tests/lib/services/compute/test_floating_ip_pools_client.py
deleted file mode 100644
index 6278df4..0000000
--- a/tempest/tests/lib/services/compute/test_floating_ip_pools_client.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 2015 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.lib.services.compute import floating_ip_pools_client
-from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services import base
-
-
-class TestFloatingIPPoolsClient(base.BaseServiceTest):
-
- FAKE_FLOATING_IP_POOLS = {
- "floating_ip_pools":
- [
- {"name": '\u3042'},
- {"name": '\u3044'}
- ]
- }
-
- def setUp(self):
- super(TestFloatingIPPoolsClient, self).setUp()
- fake_auth = fake_auth_provider.FakeAuthProvider()
- self.client = floating_ip_pools_client.FloatingIPPoolsClient(
- fake_auth, 'compute', 'regionOne')
-
- def test_list_floating_ip_pools_with_str_body(self):
- self.check_service_client_function(
- self.client.list_floating_ip_pools,
- 'tempest.lib.common.rest_client.RestClient.get',
- self.FAKE_FLOATING_IP_POOLS)
-
- def test_list_floating_ip_pools_with_bytes_body(self):
- self.check_service_client_function(
- self.client.list_floating_ip_pools,
- 'tempest.lib.common.rest_client.RestClient.get',
- self.FAKE_FLOATING_IP_POOLS, to_utf=True)
diff --git a/tempest/tests/lib/services/compute/test_floating_ips_bulk_client.py b/tempest/tests/lib/services/compute/test_floating_ips_bulk_client.py
deleted file mode 100644
index ace76f8..0000000
--- a/tempest/tests/lib/services/compute/test_floating_ips_bulk_client.py
+++ /dev/null
@@ -1,88 +0,0 @@
-# Copyright 2015 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.tests.lib import fake_auth_provider
-
-from tempest.lib.services.compute import floating_ips_bulk_client
-from tempest.tests.lib.services import base
-
-
-class TestFloatingIPsBulkClient(base.BaseServiceTest):
-
- FAKE_FIP_BULK_LIST = {"floating_ip_info": [{
- "address": "10.10.10.1",
- "instance_uuid": None,
- "fixed_ip": None,
- "interface": "eth0",
- "pool": "nova",
- "project_id": None
- },
- {
- "address": "10.10.10.2",
- "instance_uuid": None,
- "fixed_ip": None,
- "interface": "eth0",
- "pool": "nova",
- "project_id": None
- }]}
-
- def setUp(self):
- super(TestFloatingIPsBulkClient, self).setUp()
- fake_auth = fake_auth_provider.FakeAuthProvider()
- self.client = floating_ips_bulk_client.FloatingIPsBulkClient(
- fake_auth, 'compute', 'regionOne')
-
- def _test_list_floating_ips_bulk(self, bytes_body=False):
- self.check_service_client_function(
- self.client.list_floating_ips_bulk,
- 'tempest.lib.common.rest_client.RestClient.get',
- self.FAKE_FIP_BULK_LIST,
- to_utf=bytes_body)
-
- def _test_create_floating_ips_bulk(self, bytes_body=False):
- fake_fip_create_data = {"floating_ips_bulk_create": {
- "ip_range": "192.168.1.0/24", "pool": "nova", "interface": "eth0"}}
- self.check_service_client_function(
- self.client.create_floating_ips_bulk,
- 'tempest.lib.common.rest_client.RestClient.post',
- fake_fip_create_data,
- to_utf=bytes_body,
- ip_range="192.168.1.0/24", pool="nova", interface="eth0")
-
- def _test_delete_floating_ips_bulk(self, bytes_body=False):
- fake_fip_delete_data = {"floating_ips_bulk_delete": "192.168.1.0/24"}
- self.check_service_client_function(
- self.client.delete_floating_ips_bulk,
- 'tempest.lib.common.rest_client.RestClient.put',
- fake_fip_delete_data,
- to_utf=bytes_body,
- ip_range="192.168.1.0/24")
-
- def test_list_floating_ips_bulk_with_str_body(self):
- self._test_list_floating_ips_bulk()
-
- def test_list_floating_ips_bulk_with_bytes_body(self):
- self._test_list_floating_ips_bulk(True)
-
- def test_create_floating_ips_bulk_with_str_body(self):
- self._test_create_floating_ips_bulk()
-
- def test_create_floating_ips_bulk_with_bytes_body(self):
- self._test_create_floating_ips_bulk(True)
-
- def test_delete_floating_ips_bulk_with_str_body(self):
- self._test_delete_floating_ips_bulk()
-
- def test_delete_floating_ips_bulk_with_bytes_body(self):
- self._test_delete_floating_ips_bulk(True)
diff --git a/tempest/tests/lib/services/compute/test_servers_client.py b/tempest/tests/lib/services/compute/test_servers_client.py
index a82b255..8df82f7 100644
--- a/tempest/tests/lib/services/compute/test_servers_client.py
+++ b/tempest/tests/lib/services/compute/test_servers_client.py
@@ -789,21 +789,6 @@
length='fake-length'
)
- def test_list_virtual_interfaces_with_str_body(self):
- self._test_list_virtual_interfaces()
-
- def test_list_virtual_interfaces_with_bytes_body(self):
- self._test_list_virtual_interfaces(True)
-
- def _test_list_virtual_interfaces(self, bytes_body=False):
- self.check_service_client_function(
- self.client.list_virtual_interfaces,
- 'tempest.lib.common.rest_client.RestClient.get',
- {'virtual_interfaces': [self.FAKE_VIRTUAL_INTERFACES]},
- bytes_body,
- server_id=self.server_id
- )
-
def test_rescue_server_with_str_body(self):
self._test_rescue_server()
diff --git a/tempest/tests/lib/services/image/v1/__init__.py b/tempest/tests/lib/services/image/v1/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/tests/lib/services/image/v1/__init__.py
+++ /dev/null
diff --git a/tempest/tests/lib/services/image/v1/test_image_members_client.py b/tempest/tests/lib/services/image/v1/test_image_members_client.py
deleted file mode 100644
index a5a6128..0000000
--- a/tempest/tests/lib/services/image/v1/test_image_members_client.py
+++ /dev/null
@@ -1,84 +0,0 @@
-# Copyright 2016 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.lib.services.image.v1 import image_members_client
-from tempest.tests.lib import fake_auth_provider
-from tempest.tests.lib.services import base
-
-
-class TestImageMembersClient(base.BaseServiceTest):
- FAKE_LIST_IMAGE_MEMBERS = {
- "members": [
- {
- "created_at": "2013-10-07T17:58:03Z",
- "image_id": "dbc999e3-c52f-4200-bedd-3b18fe7f87fe",
- "member_id": "123456789",
- "status": "pending",
- "updated_at": "2013-10-07T17:58:03Z"
- },
- {
- "created_at": "2013-10-07T17:58:55Z",
- "image_id": "dbc999e3-c52f-4200-bedd-3b18fe7f87fe",
- "member_id": "987654321",
- "status": "accepted",
- "updated_at": "2013-10-08T12:08:55Z"
- }
- ]
- }
-
- def setUp(self):
- super(TestImageMembersClient, self).setUp()
- fake_auth = fake_auth_provider.FakeAuthProvider()
- self.client = image_members_client.ImageMembersClient(fake_auth,
- 'image',
- 'regionOne')
-
- def _test_list_image_members(self, bytes_body=False):
- self.check_service_client_function(
- self.client.list_image_members,
- 'tempest.lib.common.rest_client.RestClient.get',
- self.FAKE_LIST_IMAGE_MEMBERS,
- bytes_body,
- image_id="0ae74cc5-5147-4239-9ce2-b0c580f7067e")
-
- def _test_create_image_member(self, bytes_body=False):
- self.check_service_client_function(
- self.client.create_image_member,
- 'tempest.lib.common.rest_client.RestClient.put',
- {},
- bytes_body,
- image_id="0ae74cc5-5147-4239-9ce2-b0c580f7067e",
- member_id="8989447062e04a818baf9e073fd04fa7",
- status=204)
-
- def test_list_image_members_with_str_body(self):
- self._test_list_image_members()
-
- def test_list_image_members_with_bytes_body(self):
- self._test_list_image_members(bytes_body=True)
-
- def test_create_image_member_with_str_body(self):
- self._test_create_image_member()
-
- def test_create_image_member_with_bytes_body(self):
- self._test_create_image_member(bytes_body=True)
-
- def test_delete_image_member(self):
- self.check_service_client_function(
- self.client.delete_image_member,
- 'tempest.lib.common.rest_client.RestClient.delete',
- {},
- image_id="0ae74cc5-5147-4239-9ce2-b0c580f7067e",
- member_id="8989447062e04a818baf9e073fd04fa7",
- status=204)
diff --git a/tempest/tests/lib/services/registry_fixture.py b/tempest/tests/lib/services/registry_fixture.py
index a368705..d722b06 100644
--- a/tempest/tests/lib/services/registry_fixture.py
+++ b/tempest/tests/lib/services/registry_fixture.py
@@ -37,7 +37,7 @@
def __init__(self):
"""Initialise the registry fixture"""
self.services = set(['compute', 'identity.v2', 'identity.v3',
- 'image.v1', 'image.v2', 'network', 'placement',
+ 'image.v2', 'network', 'placement',
'volume.v2', 'volume.v3', 'object-storage'])
def _setUp(self):
diff --git a/tox.ini b/tox.ini
index fa32ba3..de81707 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,10 +1,8 @@
[tox]
envlist = pep8,py39,bashate,pip-check-reqs
minversion = 3.18.0
-ignore_basepython_conflict = True
[tempestenv]
-basepython = python3
sitepackages = False
setenv =
VIRTUAL_ENV={envdir}
@@ -15,7 +13,6 @@
-r{toxinidir}/requirements.txt
[testenv]
-basepython = python3
setenv =
VIRTUAL_ENV={envdir}
OS_LOG_CAPTURE=1
@@ -72,7 +69,6 @@
[testenv:all]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
# 'all' includes slow tests
setenv =
{[tempestenv]setenv}
@@ -93,7 +89,6 @@
# 'all' includes slow tests
setenv =
{[tempestenv]setenv}
-basepython = {[tempestenv]basepython}
deps = {[tempestenv]deps}
commands =
echo "WARNING: The all-plugin env is deprecated and will be removed"
@@ -106,7 +101,6 @@
# 'all' includes slow tests
setenv =
{[tempestenv]setenv}
-basepython = {[tempestenv]basepython}
deps = {[tempestenv]deps}
commands =
find . -type f -name "*.pyc" -delete
@@ -115,7 +109,6 @@
[testenv:full]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
# The regex below is used to select which tests to run and exclude the slow tag:
@@ -129,7 +122,6 @@
[testenv:integrated-full]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
# The regex below is used to select which tests to run. It exclude the extra
@@ -146,7 +138,6 @@
[testenv:extra-tests]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
# The regex below is used to select extra tests mentioned in
@@ -161,7 +152,6 @@
[testenv:full-parallel]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
# But exlcude the extra tests mentioned in tools/tempest-extra-tests-list.txt
@@ -173,7 +163,6 @@
[testenv:api-microversion-tests]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
regex = '(^tempest\.api\.compute)|(^tempest\.api\.volume)'
@@ -186,7 +175,6 @@
[testenv:integrated-network]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
regex1 = '(?!.*\[.*\bslow\b.*\])(^tempest\.api)'
@@ -201,7 +189,6 @@
[testenv:integrated-compute]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
regex1 = '(?!.*\[.*\bslow\b.*\])(^tempest\.api)'
@@ -216,7 +203,6 @@
[testenv:integrated-placement]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
regex1 = '(?!.*\[.*\bslow\b.*\])(^tempest\.api)'
@@ -231,7 +217,6 @@
[testenv:integrated-storage]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
regex1 = '(?!.*\[.*\bslow\b.*\])(^tempest\.api)'
@@ -246,7 +231,6 @@
[testenv:integrated-object-storage]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
regex1 = '(?!.*\[.*\bslow\b.*\])(^tempest\.api)'
@@ -261,7 +245,6 @@
[testenv:full-serial]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
regex = '(?!.*\[.*\bslow\b.*\])(^tempest\.(api|scenario|serial_tests))'
@@ -275,7 +258,6 @@
[testenv:scenario]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
regex = '(^tempest\.scenario)'
@@ -287,7 +269,6 @@
[testenv:smoke]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
regex = '\[.*\bsmoke\b.*\]'
@@ -298,7 +279,6 @@
[testenv:smoke-serial]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
regex = '\[.*\bsmoke\b.*\]'
@@ -312,7 +292,6 @@
[testenv:slow-serial]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
regex = '\[.*\bslow\b.*\]'
@@ -324,7 +303,6 @@
[testenv:slow]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
# The regex below is used to select the slow tagged tests:
@@ -336,7 +314,6 @@
[testenv:multinode]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
# The regex below is used to select the multinode and smoke tagged tests
@@ -348,7 +325,6 @@
[testenv:ipv6-only]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
regex = '\[.*\bsmoke|ipv6|test_network_v6\b.*\]'
@@ -369,7 +345,6 @@
[testenv:venv-tempest]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
commands = {posargs}
@@ -409,7 +384,7 @@
[testenv:pep8]
deps =
- -r{toxinidir}/test-requirements.txt
+ {[testenv]deps}
autopep8
commands =
autopep8 --exit-code --max-line-length=79 --experimental --diff -r tempest setup.py
@@ -513,7 +488,6 @@
[testenv:stestr-master]
envdir = .tox/tempest
sitepackages = {[tempestenv]sitepackages}
-basepython = {[tempestenv]basepython}
setenv = {[tempestenv]setenv}
deps = {[tempestenv]deps}
regex = '\[.*\bsmoke\b.*\]'
diff --git a/zuul.d/integrated-gate.yaml b/zuul.d/integrated-gate.yaml
index 8ac0b42..9181182 100644
--- a/zuul.d/integrated-gate.yaml
+++ b/zuul.d/integrated-gate.yaml
@@ -20,8 +20,6 @@
- job:
name: tempest-ipv6-only
parent: devstack-tempest-ipv6
- # This currently works from stable/pike on.
- branches: ^(?!stable/ocata).*$
description: |
Integration test of IPv6-only deployments. This job runs
smoke and IPv6 relates tests only. Basic idea is to test
@@ -33,10 +31,6 @@
- job:
name: tempest-full
parent: devstack-tempest
- # This currently works from stable/pike on.
- # Before stable/pike, legacy version of tempest-full
- # 'legacy-tempest-dsvm-neutron-full' run.
- branches: ^(?!stable/ocata).*$
description: |
Base integration test with Neutron networking and py27.
This job is supposed to run until stable/train setup only.
@@ -78,7 +72,9 @@
# available in old tempest used till stable/wallaby,
# this job definition is only for stable/xena onwards
# and separate job definition until stable/wallaby
- branches: ^(?!stable/(ocata|pike|queens|rocky|stein|train|ussuri|victoria|wallaby)).*$
+ branches:
+ regex: ^stable/(stein|train|ussuri|victoria|wallaby)$
+ negate: true
description: |
Base integration test with Neutron networking, horizon, swift enable,
and py3.
@@ -88,6 +84,11 @@
required-projects:
- openstack/horizon
vars:
+ # NOTE(gmann): Default concurrency is higher (number of cpu -2) which
+ # end up 6 in upstream CI. Higher concurrency means high parallel
+ # requests to services and can cause more oom issues. To avoid the
+ # oom issue, setting the concurrency to 4 in this job.
+ tempest_concurrency: 4
tox_envlist: integrated-full
devstack_localrc:
USE_PYTHON3: true
@@ -105,7 +106,9 @@
parent: tempest-full-py3
nodeset: devstack-single-node-centos-9-stream
# centos-9-stream is supported from yoga release onwards
- branches: ^(?!stable/(pike|queens|rocky|stein|train|ussuri|victoria|wallaby|xena)).*$
+ branches:
+ regex: ^stable/(stein|train|ussuri|victoria|wallaby|xena)$
+ negate: true
description: |
Base integration test on CentOS 9 stream
vars:
@@ -117,7 +120,6 @@
- job:
name: tempest-integrated-networking
parent: devstack-tempest
- branches: ^(?!stable/ocata).*$
description: |
This job runs integration tests for networking. This is subset of
'tempest-full-py3' job and run only Neutron and Nova related tests.
@@ -137,12 +139,16 @@
- job:
name: tempest-integrated-compute
parent: devstack-tempest
- branches: ^(?!stable/ocata).*$
description: |
This job runs integration tests for compute. This is
subset of 'tempest-full-py3' job and run Nova, Neutron, Cinder (except backup tests)
and Glance related tests. This is meant to be run on Nova gate only.
vars:
+ # NOTE(gmann): Default concurrency is higher (number of cpu -2) which
+ # end up 6 in upstream CI. Higher concurrency means high parallel
+ # requests to services and can cause more oom issues. To avoid the
+ # oom issue, setting the concurrency to 4 in this job.
+ tempest_concurrency: 4
tox_envlist: integrated-compute
tempest_exclude_regex: ""
devstack_localrc:
@@ -161,7 +167,9 @@
parent: tempest-integrated-compute
nodeset: devstack-single-node-centos-9-stream
# centos-9-stream is supported from yoga release onwards
- branches: ^(?!stable/(pike|queens|rocky|stein|train|ussuri|victoria|wallaby|xena)).*$
+ branches:
+ regex: ^stable/(stein|train|ussuri|victoria|wallaby|xena)$
+ negate: true
description: |
This job runs integration tests for compute. This is
subset of 'tempest-full-py3' job and run Nova, Neutron, Cinder (except backup tests)
@@ -175,12 +183,16 @@
- job:
name: tempest-integrated-placement
parent: devstack-tempest
- branches: ^(?!stable/ocata).*$
description: |
This job runs integration tests for placement. This is
subset of 'tempest-full-py3' job and run Nova and Neutron
related tests. This is meant to be run on Placement gate only.
vars:
+ # NOTE(gmann): Default concurrency is higher (number of cpu -2) which
+ # end up 6 in upstream CI. Higher concurrency means high parallel
+ # requests to services and can cause more oom issues. To avoid the
+ # oom issue, setting the concurrency to 4 in this job.
+ tempest_concurrency: 4
tox_envlist: integrated-placement
devstack_localrc:
USE_PYTHON3: true
@@ -196,7 +208,6 @@
- job:
name: tempest-integrated-storage
parent: devstack-tempest
- branches: ^(?!stable/ocata).*$
description: |
This job runs integration tests for image & block storage. This is
subset of 'tempest-full-py3' job and run Cinder, Glance, Swift and Nova
@@ -212,7 +223,6 @@
- job:
name: tempest-integrated-object-storage
parent: devstack-tempest
- branches: ^(?!stable/ocata).*$
description: |
This job runs integration tests for object storage. This is
subset of 'tempest-full-py3' job and run Swift, Cinder and Glance
@@ -244,8 +254,15 @@
parent: tempest-multinode-full-base
nodeset: openstack-two-node-jammy
# This job runs on ubuntu Jammy and after stable/zed.
- branches: ^(?!stable/(pike|queens|rocky|stein|train|ussuri|victoria|wallaby|xena|yoga|zed)).*$
+ branches:
+ regex: ^stable/(stein|train|ussuri|victoria|wallaby|xena|yoga|zed)$
+ negate: true
vars:
+ # NOTE(gmann): Default concurrency is higher (number of cpu -2) which
+ # end up 6 in upstream CI. Higher concurrency means high parallel
+ # requests to services and can cause more oom issues. To avoid the
+ # oom issue, setting the concurrency to 4 in this job.
+ tempest_concurrency: 4
devstack_localrc:
USE_PYTHON3: true
devstack_plugins:
@@ -274,8 +291,6 @@
* legacy-tempest-dsvm-neutron-scenario-multinode-lvm-multibackend
* tempest-scenario-multinode-lvm-multibackend
timeout: 10800
- # This job runs on stable/stein onwards.
- branches: ^(?!stable/(ocata|pike|queens|rocky)).*$
vars:
tox_envlist: slow-serial
devstack_localrc:
@@ -303,7 +318,9 @@
# As the 'slow' tox env which is not available in old tempest used
# till stable/wallaby, this job definition is only for stable/xena
# onwards and separate job definition until stable/wallaby
- branches: ^(?!stable/(ocata|pike|queens|rocky|stein|train|ussuri|victoria|wallaby)).*$
+ branches:
+ regex: ^stable/(stein|train|ussuri|victoria|wallaby)$
+ negate: true
vars:
tox_envlist: slow
devstack_localrc:
@@ -420,27 +437,44 @@
check:
jobs:
- grenade
+ # NOTE(gmann): These template are generic and used on stable branch
+ # as well as master testing. So grenade-skip-level on stable/2023.1
+ # which test stable/yoga to stable/2023.1 upgrade is non-voting.
- grenade-skip-level:
voting: false
branches:
- stable/2023.1
+ # on master (SLURP 2024.1) grenade-skip-level which test stable/2023.1
+ # to stable/2024.1 upgrade is voting.
+ - grenade-skip-level:
+ branches:
+ - master
- tempest-integrated-networking
# Do not run it on ussuri until below issue is fixed
# https://storyboard.openstack.org/#!/story/2010057
# and job is broken up to wallaby branch due to the issue
# described in https://review.opendev.org/872341
- openstacksdk-functional-devstack:
- branches: ^(?!stable/(ussuri|victoria|wallaby)).*$
+ branches:
+ regex: ^stable/(ussuri|victoria|wallaby)$
+ negate: true
gate:
jobs:
- grenade
- tempest-integrated-networking
+ # on master (SLURP 2024.1) grenade-skip-level which test stable/2023.1
+ # to stable/2024.1 upgrade is voting.
+ - grenade-skip-level:
+ branches:
+ - master
# Do not run it on ussuri until below issue is fixed
# https://storyboard.openstack.org/#!/story/2010057
# and job is broken up to wallaby branch due to the issue
# described in https://review.opendev.org/872341
- openstacksdk-functional-devstack:
- branches: ^(?!stable/(ussuri|victoria|wallaby)).*$
+ branches:
+ regex: ^stable/(ussuri|victoria|wallaby)$
+ negate: true
- project-template:
name: integrated-gate-compute
@@ -456,6 +490,9 @@
# only from master(or the branch it was meant to run).
check:
jobs:
+ # NOTE(gmann): These template are generic and used on stable branch
+ # as well as master testing. So grenade-skip-level on stable/2023.1
+ # which test stable/yoga to stable/2023.1 upgrade is non-voting.
- grenade-skip-level:
voting: false
branches:
@@ -478,7 +515,9 @@
# and job is broken up to wallaby branch due to the issue
# described in https://review.opendev.org/872341
- openstacksdk-functional-devstack:
- branches: ^(?!stable/(ussuri|victoria|wallaby)).*$
+ branches:
+ regex: ^stable/(ussuri|victoria|wallaby)$
+ negate: true
gate:
jobs:
- grenade-skip-level-always:
@@ -486,12 +525,16 @@
- master
- tempest-integrated-compute
- openstacksdk-functional-devstack:
- branches: ^(?!stable/(ussuri|victoria|wallaby)).*$
+ branches:
+ regex: ^stable/(ussuri|victoria|wallaby)$
+ negate: true
periodic-weekly:
jobs:
# centos-9-stream is tested from zed release onwards
- tempest-integrated-compute-centos-9-stream:
- branches: ^(?!stable/(pike|queens|rocky|stein|train|ussuri|victoria|wallaby|xena|yoga)).*$
+ branches:
+ regex: ^stable/(stein|train|ussuri|victoria|wallaby|xena|yoga)$
+ negate: true
- project-template:
name: integrated-gate-placement
@@ -503,27 +546,44 @@
check:
jobs:
- grenade
+ # NOTE(gmann): These template are generic and used on stable branch
+ # as well as master testing. So grenade-skip-level on stable/2023.1
+ # which test stable/yoga to stable/2023.1 upgrade is non-voting.
- grenade-skip-level:
voting: false
branches:
- stable/2023.1
+ # on master (SLURP 2024.1) grenade-skip-level which test stable/2023.1
+ # to stable/2024.1 upgrade is voting.
+ - grenade-skip-level:
+ branches:
+ - master
- tempest-integrated-placement
# Do not run it on ussuri until below issue is fixed
# https://storyboard.openstack.org/#!/story/2010057
# and job is broken up to wallaby branch due to the issue
# described in https://review.opendev.org/872341
- openstacksdk-functional-devstack:
- branches: ^(?!stable/(ussuri|victoria|wallaby)).*$
+ branches:
+ regex: ^stable/(ussuri|victoria|wallaby)$
+ negate: true
gate:
jobs:
- grenade
- tempest-integrated-placement
+ # on master (SLURP 2024.1) grenade-skip-level which test stable/2023.1
+ # to stable/2024.1 upgrade is voting.
+ - grenade-skip-level:
+ branches:
+ - master
# Do not run it on ussuri until below issue is fixed
# https://storyboard.openstack.org/#!/story/2010057
# and job is broken up to wallaby branch due to the issue
# described in https://review.opendev.org/872341
- openstacksdk-functional-devstack:
- branches: ^(?!stable/(ussuri|victoria|wallaby)).*$
+ branches:
+ regex: ^stable/(ussuri|victoria|wallaby)$
+ negate: true
- project-template:
name: integrated-gate-storage
@@ -535,27 +595,44 @@
check:
jobs:
- grenade
+ # NOTE(gmann): These template are generic and used on stable branch
+ # as well as master testing. So grenade-skip-level on stable/2023.1
+ # which test stable/yoga to stable/2023.1 upgrade is non-voting.
- grenade-skip-level:
voting: false
branches:
- stable/2023.1
+ # on master (SLURP 2024.1) grenade-skip-level which test stable/2023.1
+ # to stable/2024.1 upgrade is voting.
+ - grenade-skip-level:
+ branches:
+ - master
- tempest-integrated-storage
# Do not run it on ussuri until below issue is fixed
# https://storyboard.openstack.org/#!/story/2010057
# and job is broken up to wallaby branch due to the issue
# described in https://review.opendev.org/872341
- openstacksdk-functional-devstack:
- branches: ^(?!stable/(ussuri|victoria|wallaby)).*$
+ branches:
+ regex: ^stable/(ussuri|victoria|wallaby)$
+ negate: true
gate:
jobs:
- grenade
+ # on master (SLURP 2024.1) grenade-skip-level which test stable/2023.1
+ # to stable/2024.1 upgrade is voting.
+ - grenade-skip-level:
+ branches:
+ - master
- tempest-integrated-storage
# Do not run it on ussuri until below issue is fixed
# https://storyboard.openstack.org/#!/story/2010057
# and job is broken up to wallaby branch due to the issue
# described in https://review.opendev.org/872341
- openstacksdk-functional-devstack:
- branches: ^(?!stable/(ussuri|victoria|wallaby)).*$
+ branches:
+ regex: ^stable/(ussuri|victoria|wallaby)$
+ negate: true
- project-template:
name: integrated-gate-object-storage
@@ -567,20 +644,34 @@
check:
jobs:
- grenade
+ # on master (SLURP 2024.1) grenade-skip-level which test stable/2023.1
+ # to stable/2024.1 upgrade is voting.
+ - grenade-skip-level:
+ branches:
+ - master
- tempest-integrated-object-storage
# Do not run it on ussuri until below issue is fixed
# https://storyboard.openstack.org/#!/story/2010057
# and job is broken up to wallaby branch due to the issue
# described in https://review.opendev.org/872341
- openstacksdk-functional-devstack:
- branches: ^(?!stable/(ussuri|victoria|wallaby)).*$
+ branches:
+ regex: ^stable/(ussuri|victoria|wallaby)$
+ negate: true
gate:
jobs:
- grenade
+ # on master (SLURP 2024.1) grenade-skip-level which test stable/2023.1
+ # to stable/2024.1 upgrade is voting.
+ - grenade-skip-level:
+ branches:
+ - master
- tempest-integrated-object-storage
# Do not run it on ussuri until below issue is fixed
# https://storyboard.openstack.org/#!/story/2010057
# and job is broken up to wallaby branch due to the issue
# described in https://review.opendev.org/872341
- openstacksdk-functional-devstack:
- branches: ^(?!stable/(ussuri|victoria|wallaby)).*$
+ branches:
+ regex: ^stable/(ussuri|victoria|wallaby)$
+ negate: true
diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml
index 9787526..3f32f9f 100644
--- a/zuul.d/project.yaml
+++ b/zuul.d/project.yaml
@@ -11,6 +11,7 @@
- openstack-tox-py38
- openstack-tox-py39
- openstack-tox-py310
+ - openstack-tox-py311
- tempest-full-py3:
# Define list of irrelevant files to use everywhere else
irrelevant-files: &tempest-irrelevant-files
@@ -36,7 +37,7 @@
# if things are working in latest and oldest it will work in between
# stable branches also. If anything is breaking we will be catching
# those in respective stable branch gate.
- - tempest-full-2023-1:
+ - tempest-full-2023-2:
irrelevant-files: *tempest-irrelevant-files
- tempest-full-yoga:
irrelevant-files: *tempest-irrelevant-files
@@ -110,6 +111,8 @@
irrelevant-files: *tempest-irrelevant-files
- grenade:
irrelevant-files: *tempest-irrelevant-files
+ - grenade-skip-level:
+ irrelevant-files: *tempest-irrelevant-files
- neutron-ovs-tempest-dvr:
voting: false
irrelevant-files: *tempest-irrelevant-files
@@ -128,6 +131,7 @@
- openstack-tox-py38
- openstack-tox-py39
- openstack-tox-py310
+ - openstack-tox-py311
- tempest-slow-py3:
irrelevant-files: *tempest-irrelevant-files
- neutron-ovs-grenade-multinode:
@@ -138,6 +142,8 @@
irrelevant-files: *tempest-irrelevant-files
- grenade:
irrelevant-files: *tempest-irrelevant-files
+ - grenade-skip-level:
+ irrelevant-files: *tempest-irrelevant-files
- tempest-ipv6-only:
irrelevant-files: *tempest-irrelevant-files-3
- tempest-multinode-full-py3:
@@ -184,12 +190,15 @@
irrelevant-files: *tempest-irrelevant-files
periodic-stable:
jobs:
+ - tempest-full-2023-2
- tempest-full-2023-1
- tempest-full-zed
- tempest-full-yoga
+ - tempest-slow-2023-2
- tempest-slow-2023-1
- tempest-slow-zed
- tempest-slow-yoga
+ - tempest-full-2023-2-extra-tests
- tempest-full-2023-1-extra-tests
- tempest-full-zed-extra-tests
- tempest-full-yoga-extra-tests
diff --git a/zuul.d/stable-jobs.yaml b/zuul.d/stable-jobs.yaml
index d399556..2fdc2af 100644
--- a/zuul.d/stable-jobs.yaml
+++ b/zuul.d/stable-jobs.yaml
@@ -1,5 +1,11 @@
# NOTE(gmann): This file includes all stable release jobs definition.
- job:
+ name: tempest-full-2023-2
+ parent: tempest-full-py3
+ nodeset: openstack-single-node-jammy
+ override-checkout: stable/2023.2
+
+- job:
name: tempest-full-2023-1
parent: tempest-full-py3
nodeset: openstack-single-node-jammy
@@ -18,6 +24,12 @@
override-checkout: stable/yoga
- job:
+ name: tempest-full-2023-2-extra-tests
+ parent: tempest-extra-tests
+ nodeset: openstack-single-node-jammy
+ override-checkout: stable/2023.2
+
+- job:
name: tempest-full-2023-1-extra-tests
parent: tempest-extra-tests
nodeset: openstack-single-node-jammy
@@ -36,10 +48,16 @@
override-checkout: stable/yoga
- job:
+ name: tempest-slow-2023-2
+ parent: tempest-slow-py3
+ nodeset: openstack-two-node-jammy
+ override-checkout: stable/2023.2
+
+- job:
name: tempest-slow-2023-1
parent: tempest-slow-py3
nodeset: openstack-two-node-jammy
- override-checkout: stable/2023-1
+ override-checkout: stable/2023.1
- job:
name: tempest-full-enforce-scope-new-defaults-zed
@@ -95,9 +113,6 @@
# This job version is with swift disabled on py3
# as swift was not ready on py3 until stable/train.
branches:
- - stable/pike
- - stable/queens
- - stable/rocky
- stable/stein
- stable/train
description: |
@@ -227,72 +242,11 @@
USE_PYTHON3: False
- job:
- name: tempest-multinode-full
- parent: tempest-multinode-full-base
- nodeset: openstack-two-node-xenial
- # This job runs on Xenial and this is for stable/pike, stable/queens
- # and stable/rocky. This job is prepared to make sure all stable branches
- # before stable/stein will keep running on xenial. This job can be
- # removed once stable/rocky is EOL.
- branches:
- - stable/pike
- - stable/queens
- - stable/rocky
- vars:
- devstack_localrc:
- USE_PYTHON3: False
- group-vars:
- subnode:
- devstack_localrc:
- USE_PYTHON3: False
-
-- job:
- name: tempest-slow
- parent: tempest-multinode-full
- description: |
- This multinode integration job will run all the tests tagged as slow.
- It enables the lvm multibackend setup to cover few scenario tests.
- This job will run only slow tests (API or Scenario) serially.
- Former names for this job were:
- * legacy-tempest-dsvm-neutron-scenario-multinode-lvm-multibackend
- * tempest-scenario-multinode-lvm-multibackend
- timeout: 10800
- branches:
- - stable/pike
- - stable/queens
- - stable/rocky
- vars:
- tox_envlist: slow-serial
- devstack_localrc:
- CINDER_ENABLED_BACKENDS: lvm:lvmdriver-1,lvm:lvmdriver-2
- ENABLE_VOLUME_MULTIATTACH: true
- # to avoid https://bugs.launchpad.net/neutron/+bug/1914037
- # as we couldn't backport the fix to rocky and older releases
- IPV6_PUBLIC_RANGE: 2001:db8:0:10::/64
- IPV6_PUBLIC_NETWORK_GATEWAY: 2001:db8:0:10::2
- IPV6_ROUTER_GW_IP: 2001:db8:0:10::1
- devstack_plugins:
- neutron: https://opendev.org/openstack/neutron
- devstack_services:
- neutron-placement: true
- neutron-qos: true
- group-vars:
- # NOTE(mriedem): The ENABLE_VOLUME_MULTIATTACH variable is used on both
- # the controller and subnode prior to Rocky so we have to make sure the
- # variable is set in both locations.
- subnode:
- devstack_localrc:
- ENABLE_VOLUME_MULTIATTACH: true
-
-- job:
name: tempest-slow-py3
parent: tempest-slow
# This job version is with swift disabled on py3
# as swift was not ready on py3 until stable/train.
branches:
- - stable/pike
- - stable/queens
- - stable/rocky
- stable/stein
- stable/train
vars:
@@ -333,9 +287,6 @@
# This job is not used after stable/xena and can be
# removed once stable/xena is EOL.
branches:
- - stable/pike
- - stable/queens
- - stable/rocky
- stable/stein
- stable/train
- stable/ussuri
diff --git a/zuul.d/tempest-specific.yaml b/zuul.d/tempest-specific.yaml
index ca63fcc..10490b4 100644
--- a/zuul.d/tempest-specific.yaml
+++ b/zuul.d/tempest-specific.yaml
@@ -54,7 +54,6 @@
- job:
name: tempest-full-py3-ipv6
parent: devstack-tempest-ipv6
- branches: ^(?!stable/ocata).*$
description: |
Base integration test with Neutron networking, IPv6 and py3.
vars: