test_consistencygroups should wait for consistencygroup status to be available before creating volume.

Bug #1897532 reported by Sam Wan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cinder-tempest-plugin
Fix Released
Low
Sam Wan

Bug Description

test_consistencygroups should wait for consistencygroup status to be available before creating volume.

The current case logic in test_consistencygroups is wrong, it creates volume of cg without waiting for the cg to be available first.
Take test_consistencygroup_create_delete as an example:
======
 69 def test_consistencygroup_create_delete(self):
 70 # Create volume type
 71 name = data_utils.rand_name("volume-type")
 72 volume_type = self.os_admin.volume_types_v2_client.create_volume_type(
 73 name=name)['volume_type']
 74
 75 # Create CG
 76 cg_name = data_utils.rand_name('CG')
 77 create_consistencygroup = (
 78 self.consistencygroups_adm_client.create_consistencygroup)
 79 cg = create_consistencygroup(volume_type['id'],
 80 name=cg_name)['consistencygroup']
 81 vol_name = data_utils.rand_name("volume")
 82 params = {'name': vol_name,
 83 'volume_type': volume_type['id'],
 84 'consistencygroup_id': cg['id'],
 85 'size': CONF.volume.volume_size}
 86
 87 # Create volume
 88 volume = self.admin_volume_client.create_volume(**params)['volume']
 89
 90 waiters.wait_for_volume_resource_status(self.admin_volume_client,
 91 volume['id'], 'available')
 92 self.consistencygroups_adm_client.wait_for_consistencygroup_status(
 93 cg['id'], 'available')
 94 self.assertEqual(cg_name, cg['name'])
 95
======

line#79 send the request to create a consistency group, however it does not wait for the cg to be available.
line#88 create a volume of the cg. at this time, the cg might still not be available yet.
we should move line#92-94 to line#81, otherwise the test may fail with 'CG not found.'

Here's an example log: http://publiclogs.emc.com/03/729603/7/check/DellEMC_Unity_iSCSI/c063e84/DellEMC_Unity_iSCSI/727/logs/screen-c-vol.txt.gz
1. The CG fc5a72a0-09ab-464b-997f-04fdae0e6759 creation started at 05:59:25.915224
2. The volume creation with group_id fc5a72a0-09ab-464b-997f-04fdae0e6759 specified started at 05:59:26.453746.
3. The volume created successfully at 05:59:29.789641.
4. The CG is still not found at 05:59:30.646441
5. The CG creation completed successfully at 05:59:31.086518

So the logic is wrong.

Sam Wan (sam-wan)
Changed in cinder-tempest-plugin:
assignee: nobody → Sam Wan (sam-wan)
Changed in cinder-tempest-plugin:
status: New → Triaged
importance: Undecided → Low
Changed in cinder-tempest-plugin:
milestone: none → 1.3.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder-tempest-plugin 1.4.0

This issue was fixed in the openstack/cinder-tempest-plugin 1.4.0 release.

Revision history for this message
Luigi Toscano (ltoscano) wrote :

Addressed by https://review.opendev.org/c/openstack/cinder-tempest-plugin/+/754660 (the gerrit/launchpad integration was not working for a while).

Changed in cinder-tempest-plugin:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.