diff options
author | Takashi Kajinami <tkajinam@redhat.com> | 2021-07-25 02:13:11 +0900 |
---|---|---|
committer | rabi <ramishra@redhat.com> | 2021-08-26 09:22:09 +0530 |
commit | c881da8b87a04bbd61eabaf68e6c0fc167e898fa (patch) | |
tree | 127d99526f0006a76f9853fdba9f0a1df0d2812d | |
parent | 0833daa3f77dd2267a6068eeafcf9d9af8da1a17 (diff) | |
download | heat-c881da8b87a04bbd61eabaf68e6c0fc167e898fa.tar.gz |
Use Block Storage API v3 instead of API v2
Block Storage API v2 was deprecated during Pike cycle and is being
removed during Xena cycle, and current v3 API should be used instead.
Unused volume_client and network_client in integration test code are
also removed by this change.
Note:
granade tests is made non-voting temporally until the same issue is
fixed in stable/victoria.
Depends-on: https://review.opendev.org/802150/
Change-Id: I6a2b5afa13480791971bbd8bba1f43b9f2db8294
(cherry picked from commit 1828df32fa946d49d8449ff1d8a26c05b3990a65)
Move testing to Fedora 33
Now that the gate is unblocked, we can also test F33 for gating purposes
here.
Change-Id: Ie1c9075623d85b27aaf1ac67a3063e219726bc6f
(cherry picked from commit 6a9c35d89804057b56e1b0b995265ce3eb68129d)
-rw-r--r-- | .zuul.yaml | 3 | ||||
-rw-r--r-- | devstack/lib/heat | 4 | ||||
-rw-r--r-- | doc/source/getting_started/on_devstack.rst | 4 | ||||
-rw-r--r-- | heat/tests/clients/test_cinder_client.py | 8 | ||||
-rw-r--r-- | heat/tests/openstack/cinder/test_volume.py | 2 | ||||
-rw-r--r-- | heat/tests/openstack/cinder/test_volume_type.py | 6 | ||||
-rw-r--r-- | heat/tests/openstack/cinder/test_volume_utils.py | 5 | ||||
-rwxr-xr-x | heat_integrationtests/cleanup_test_env.sh | 2 | ||||
-rw-r--r-- | heat_integrationtests/common/clients.py | 21 | ||||
-rw-r--r-- | heat_integrationtests/common/test.py | 10 | ||||
-rwxr-xr-x | heat_integrationtests/prepare_test_env.sh | 2 |
11 files changed, 14 insertions, 53 deletions
diff --git a/.zuul.yaml b/.zuul.yaml index e86eaf414..65c488e10 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -75,7 +75,7 @@ minimal_image_ref: ${DEFAULT_IMAGE_NAME:-cirros-0.3.6-x86_64-disk} instance_type: m1.heat_int minimal_instance_type: m1.heat_micro - image_ref: Fedora-Cloud-Base-32-1.6.x86_64 + image_ref: Fedora-Cloud-Base-33-1.2.x86_64 hidden_stack_tag: hidden heat_config_notify_script: /opt/stack/heat-agents/heat-config/bin/heat-config-notify boot_config_env: /opt/stack/heat-templates/hot/software-config/boot-config/test_image_env.yaml @@ -136,6 +136,7 @@ - job: name: grenade-heat parent: grenade + voting: false required-projects: - opendev.org/openstack/heat - opendev.org/openstack/heat-tempest-plugin diff --git a/devstack/lib/heat b/devstack/lib/heat index d3dcd6197..ee04a1fdd 100644 --- a/devstack/lib/heat +++ b/devstack/lib/heat @@ -478,9 +478,9 @@ function configure_tempest_for_heat { if [[ -e /etc/ci/mirror_info.sh ]]; then source /etc/ci/mirror_info.sh fi - export HEAT_TEST_FEDORA_IMAGE=${NODEPOOL_FEDORA_MIRROR:-https://download.fedoraproject.org/pub/fedora/linux}/releases/32/Cloud/x86_64/images/Fedora-Cloud-Base-32-1.6.x86_64.qcow2 + export HEAT_TEST_FEDORA_IMAGE=${NODEPOOL_FEDORA_MIRROR:-https://download.fedoraproject.org/pub/fedora/linux}/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.qcow2 TOKEN=$(openstack token issue -c id -f value) - local image_exists=$( openstack image list | grep "Fedora-Cloud-Base-32-1.6.x86_64" ) + local image_exists=$( openstack image list | grep "Fedora-Cloud-Base-33-1.2.x86_64" ) if [[ -z $image_exists ]]; then if is_service_enabled g-api; then upload_image $HEAT_TEST_FEDORA_IMAGE $TOKEN diff --git a/doc/source/getting_started/on_devstack.rst b/doc/source/getting_started/on_devstack.rst index 81716c4d5..29581390d 100644 --- a/doc/source/getting_started/on_devstack.rst +++ b/doc/source/getting_started/on_devstack.rst @@ -51,8 +51,8 @@ a VM image that heat can launch. To do that add the following to `[[local|localrc]]` section of `local.conf`:: IMAGE_URL_SITE="https://download.fedoraproject.org" - IMAGE_URL_PATH="/pub/fedora/linux/releases/32/Cloud/x86_64/images/" - IMAGE_URL_FILE="Fedora-Cloud-Base-32-1.6.x86_64.qcow2" + IMAGE_URL_PATH="/pub/fedora/linux/releases/33/Cloud/x86_64/images/" + IMAGE_URL_FILE="Fedora-Cloud-Base-33-1.2.x86_64.qcow2" IMAGE_URLS+=","$IMAGE_URL_SITE$IMAGE_URL_PATH$IMAGE_URL_FILE URLs for any cloud image may be specified, but fedora images from F20 contain diff --git a/heat/tests/clients/test_cinder_client.py b/heat/tests/clients/test_cinder_client.py index 69b13c612..f1810e899 100644 --- a/heat/tests/clients/test_cinder_client.py +++ b/heat/tests/clients/test_cinder_client.py @@ -163,14 +163,6 @@ class CinderClientAPIVersionTest(common.HeatTestCase): client = ctx.clients.client('cinder') self.assertEqual('3.0', client.version) - def test_cinder_api_v2(self): - ctx = utils.dummy_context() - self.patchobject(ctx.keystone_session, 'get_endpoint', - side_effect=[ks_exceptions.EndpointNotFound, - None]) - client = ctx.clients.client('cinder') - self.assertEqual('2.0', client.version) - def test_cinder_api_not_supported(self): ctx = utils.dummy_context() self.patchobject(ctx.keystone_session, 'get_endpoint', diff --git a/heat/tests/openstack/cinder/test_volume.py b/heat/tests/openstack/cinder/test_volume.py index 87cc4e160..36ae420f7 100644 --- a/heat/tests/openstack/cinder/test_volume.py +++ b/heat/tests/openstack/cinder/test_volume.py @@ -1252,7 +1252,7 @@ class CinderVolumeTest(vt_base.VolumeTestCase): vol.to_dict.return_value = vol_resp rsrc.client().volumes = mock.MagicMock() rsrc.client().volumes.get = mock.MagicMock(return_value=vol) - rsrc.client().volume_api_version = 2 + rsrc.client().volume_api_version = 3 rsrc.data = mock.MagicMock(return_value={'volume_type': 'lvmdriver-1'}) reality = rsrc.get_live_state(rsrc.properties) diff --git a/heat/tests/openstack/cinder/test_volume_type.py b/heat/tests/openstack/cinder/test_volume_type.py index de094fb24..b521c5cca 100644 --- a/heat/tests/openstack/cinder/test_volume_type.py +++ b/heat/tests/openstack/cinder/test_volume_type.py @@ -92,7 +92,7 @@ class CinderVolumeTypeTest(common.HeatTestCase): self._test_handle_create(is_public=False) def test_volume_type_with_projects(self): - self.cinderclient.volume_api_version = 2 + self.cinderclient.volume_api_version = 3 self._test_handle_create(projects=['id1', 'id2']) def _test_update(self, update_args, is_update_metadata=False): @@ -178,7 +178,7 @@ class CinderVolumeTypeTest(common.HeatTestCase): props['projects'] = ['id1'] self.my_volume_type.t = self.my_volume_type.t.freeze(properties=props) self.my_volume_type.reparse() - self.cinderclient.volume_api_version = 2 + self.cinderclient.volume_api_version = 3 self.stub_KeystoneProjectConstraint() ex = self.assertRaises(exception.StackValidationFailed, self.my_volume_type.validate) @@ -193,7 +193,7 @@ class CinderVolumeTypeTest(common.HeatTestCase): props['projects'] = ['id1'] self.my_volume_type.t = self.my_volume_type.t.freeze(properties=props) self.my_volume_type.reparse() - self.cinderclient.volume_api_version = 2 + self.cinderclient.volume_api_version = 3 self.stub_KeystoneProjectConstraint() self.assertIsNone(self.my_volume_type.validate()) diff --git a/heat/tests/openstack/cinder/test_volume_utils.py b/heat/tests/openstack/cinder/test_volume_utils.py index 549d98058..306f5c9c4 100644 --- a/heat/tests/openstack/cinder/test_volume_utils.py +++ b/heat/tests/openstack/cinder/test_volume_utils.py @@ -10,10 +10,9 @@ # 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 unittest import mock -from cinderclient.v2 import client as cinderclient +from cinderclient.v3 import client as cinderclient from heat.engine.clients.os import cinder from heat.engine.clients.os import nova @@ -31,7 +30,7 @@ class VolumeTestCase(common.HeatTestCase): super(VolumeTestCase, self).setUp() self.fc = fakes_nova.FakeClient() self.cinder_fc = cinderclient.Client('username', 'password') - self.cinder_fc.volume_api_version = 2 + self.cinder_fc.volume_api_version = 3 self.patchobject(cinder.CinderClientPlugin, '_create', return_value=self.cinder_fc) self.patchobject(nova.NovaClientPlugin, 'client', diff --git a/heat_integrationtests/cleanup_test_env.sh b/heat_integrationtests/cleanup_test_env.sh index 30196a230..12791c9fd 100755 --- a/heat_integrationtests/cleanup_test_env.sh +++ b/heat_integrationtests/cleanup_test_env.sh @@ -30,4 +30,4 @@ openstack flavor delete m1.heat_int openstack flavor delete m1.heat_micro # delete the image created -openstack image delete Fedora-Cloud-Base-32-1.6.x86_64 +openstack image delete Fedora-Cloud-Base-33-1.2.x86_64 diff --git a/heat_integrationtests/common/clients.py b/heat_integrationtests/common/clients.py index d2cc92977..c70b81682 100644 --- a/heat_integrationtests/common/clients.py +++ b/heat_integrationtests/common/clients.py @@ -12,12 +12,10 @@ import os -from cinderclient import client as cinder_client from heat.common.i18n import _ from heatclient import client as heat_client from keystoneauth1.identity.generic import password from keystoneauth1 import session -from neutronclient.v2_0 import client as neutron_client from novaclient import client as nova_client from swiftclient import client as swift_client @@ -60,7 +58,6 @@ class ClientManager(object): calling various OpenStack APIs. """ - CINDERCLIENT_VERSION = '2' HEATCLIENT_VERSION = '1' NOVA_API_VERSION = '2.1' @@ -81,8 +78,6 @@ class ClientManager(object): self.identity_client = self._get_identity_client() self.orchestration_client = self._get_orchestration_client() self.compute_client = self._get_compute_client() - self.network_client = self._get_network_client() - self.volume_client = self._get_volume_client() self.object_client = self._get_object_client() def _username(self): @@ -154,22 +149,6 @@ class ClientManager(object): os_cache=False, http_log_debug=True) - def _get_network_client(self): - - return neutron_client.Client( - session=self.identity_client.session, - service_type='network', - region_name=self.conf.region, - endpoint_type='publicURL') - - def _get_volume_client(self): - return cinder_client.Client( - self.CINDERCLIENT_VERSION, - session=self.identity_client.session, - endpoint_type='publicURL', - region_name=self.conf.region, - http_log_debug=True) - def _get_object_client(self): args = { 'auth_version': self.auth_version, diff --git a/heat_integrationtests/common/test.py b/heat_integrationtests/common/test.py index 6c330a23d..99314896e 100644 --- a/heat_integrationtests/common/test.py +++ b/heat_integrationtests/common/test.py @@ -103,8 +103,6 @@ class HeatIntegrationTest(testscenarios.WithScenarios, self.identity_client = self.manager.identity_client self.orchestration_client = self.manager.orchestration_client self.compute_client = self.manager.compute_client - self.network_client = self.manager.network_client - self.volume_client = self.manager.volume_client self.object_client = self.manager.object_client self.client = self.orchestration_client @@ -168,14 +166,6 @@ class HeatIntegrationTest(testscenarios.WithScenarios, def _stack_rand_name(cls): return rand_name(cls.__name__) - def _get_network(self, net_name=None): - if net_name is None: - net_name = self.conf.fixed_network_name - networks = self.network_client.list_networks() - for net in networks['networks']: - if net['name'] == net_name: - return net - def is_service_available(self, service_type): try: self.identity_client.get_endpoint_url( diff --git a/heat_integrationtests/prepare_test_env.sh b/heat_integrationtests/prepare_test_env.sh index 31d682a71..45b86e493 100755 --- a/heat_integrationtests/prepare_test_env.sh +++ b/heat_integrationtests/prepare_test_env.sh @@ -46,7 +46,7 @@ function _config_iniset { iniset $conf_file heat_plugin instance_type m1.heat_int iniset $conf_file heat_plugin minimal_instance_type m1.heat_micro - iniset $conf_file heat_plugin image_ref Fedora-Cloud-Base-32-1.6.x86_64 + iniset $conf_file heat_plugin image_ref Fedora-Cloud-Base-33-1.2.x86_64 iniset $conf_file heat_plugin minimal_image_ref $default_image_name iniset $conf_file heat_plugin hidden_stack_tag hidden |