> === 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?
« Back to merge proposal
> === modified file 'nova/tests/ test_xenapi. py' test_xenapi. py 2011-03-28 21:00:17 +0000 test_xenapi. py 2011-03-31 09:25:51 +0000 ls(self. vm['HVM_ boot_params' ], {}) ls(self. vm['HVM_ boot_policy' ], '') no_unbound_ vdi(self) : connection_ url connection_ username connection_ password conn.XenAPISess ion(url, username, password) call_xenapi( 'VDI.get_ all') call_xenapi( 'VDI.get_ record' , vdi_ref) ls(vdi_ rec['VBDs' ], {})
> --- nova/tests/
> +++ nova/tests/
> @@ -327,6 +327,19 @@
> self.assertEqua
> self.assertEqua
>
> + def _check_
> + url = FLAGS.xenapi_
> + username = FLAGS.xenapi_
> + password = FLAGS.xenapi_
> + session = xenapi_
> + vdi_refs = session.
> + for vdi_ref in vdi_refs:
> + vdi_rec = session.
> + if 'VBDs' in vdi_rec:
> + self.assertEqua
> + 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?