Code review comment for lp:~salvatore-orlando/nova/bug723301

Revision history for this message
Soren Hansen (soren) wrote :

> === modified file 'nova/tests/test_xenapi.py'
> --- nova/tests/test_xenapi.py 2011-03-28 21:00:17 +0000
> +++ nova/tests/test_xenapi.py 2011-03-31 09:25:51 +0000
> @@ -327,6 +327,19 @@
> self.assertEquals(self.vm['HVM_boot_params'], {})
> self.assertEquals(self.vm['HVM_boot_policy'], '')
>
> + def _check_no_unbound_vdi(self):
> + url = FLAGS.xenapi_connection_url
> + username = FLAGS.xenapi_connection_username
> + password = FLAGS.xenapi_connection_password
> + session = xenapi_conn.XenAPISession(url, username, password)
> + vdi_refs = session.call_xenapi('VDI.get_all')
> + for vdi_ref in vdi_refs:
> + vdi_rec = session.call_xenapi('VDI.get_record', vdi_ref)
> + if 'VBDs' in vdi_rec:
> + self.assertEquals(vdi_rec['VBDs'], {})
> + else:
> + self.fail('Found unexpected unbound VDI:%s' % vdi_rec['uuid'])

I'm having trouble followin the data model.
If vdi_rec has a 'VBDs' key, it has to be empty. If there's no 'VBDs' key, that
means unexpected unbound VDI's are found? Is that accurate?

review: Needs Information

« Back to merge proposal