compute: Skip AttachVolumeShelveTestJSON when cross_az_attach unavailable

Both tests within this class create an instance and volume within the
same availability zone before shelving the instance. By default this
fully offloads the instance removing it from the availability zone.

If [cinder]/cross_az_attach is set to False within nova.conf this then
results in failures to attach volumes to the instance as they no longer
share the same availability zone.

To avoid this we now skip AttachVolumeShelveTestJSON based on the value
of [compute-feature-enabled]/compute_volume_common_az in tempest.conf
introduced by 979e494da2. This should be set if
cinder]/cross_az_attach is False within nova.conf ensuring that the resources
will be created in the same AZ.

Closes-Bug: #1889687
Change-Id: Ic51f6c7671bae2b241ada6d0c75fd9ea410eb73b
This commit is contained in:
Lee Yarwood 2020-07-30 20:21:52 +01:00 committed by Martin Kopec
parent d31d961110
commit 8581ea2cdc
1 changed files with 4 additions and 0 deletions

View File

@ -200,6 +200,10 @@ class AttachVolumeShelveTestJSON(BaseAttachVolumeTest):
super(AttachVolumeShelveTestJSON, cls).skip_checks()
if not CONF.compute_feature_enabled.shelve:
raise cls.skipException('Shelve is not available.')
if CONF.compute.compute_volume_common_az:
# assuming cross_az_attach is set to false in nova.conf
# per the compute_volume_common_az option description
raise cls.skipException('Cross AZ attach not available.')
def _count_volumes(self, server, validation_resources):
# Count number of volumes on an instance