[openstack-dev] [Cinder] test_preattach_status_volume test failure

John Griffith john.griffith at solidfire.com
Fri Mar 8 16:09:41 UTC 2013


On Fri, Mar 8, 2013 at 1:07 AM, Michael J Fork <mjfork at us.ibm.com> wrote:

>  After updating the Cinder oslo rpc libraries to the latest (see
> https://review.openstack.org/#/c/23822/), Cinder
> test_preattach_status_volume fails with the following:
>
> ======================================================================
> FAIL: Ensure volume goes into pre-attaching state
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/mnt/home/openstack/dev/cinder/cinder/tests/test_volume.py", line
> 308, in test_preattach_status_volume
>     self.assertEqual(vol['status'], "available")
>
> and the test
>
>     def test_preattach_status_volume(self):
>         """Ensure volume goes into pre-attaching state"""
>         instance_uuid = '12345678-1234-5678-1234-567812345678'
>         mountpoint = "/dev/sdf"
>         volume = db.volume_create(self.context, {'size': 1,
>                                                  'status': 'available'})
>         volume_id = volume['id']
>
>         volume_api = cinder.volume.api.API()
>         volume_api.attach(self.context, volume, instance_uuid, mountpoint)
>
>         vol = db.volume_get(self.context, volume_id)
>         self.assertEqual(vol['status'], "available")
>         self.assertEqual(vol['attach_status'], None)
>         self.assertEqual(vol['instance_uuid'], None)
>
> I would expect volume_api.attach call to set the state to "in-use" (as the
> error shows it was) vs still being "available". Is this a legitimate bug
> that needs fixed or is the error caused by something in the oslo update?
>
> Thanks.
>
> Michael
>
> -------------------------------------------------
> Michael Fork
> Architect, OpenStack Development
> IBM Systems & Technology Group
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
> There's a bug in here (although I suspect it's a bug in the unit test
code), just haven't figured out how the oslo change exposed it.  The status
should be "in-use" as you pointed out, if you run the test individually or
even just test_volume:VolumeTestCase, it passes.  So there's something
wonky in the test setup somewhere.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130308/feeb4b9a/attachment.html>


More information about the OpenStack-dev mailing list