예제 #1
0
 def check():
     # check that the VM has a VBD attached to it
     # Get XenAPI record for VBD
     vbds = xenapi_fake.get_all('VBD')
     vbd = xenapi_fake.get_record('VBD', vbds[0])
     vm_ref = vbd['VM']
     self.assertEqual(vm_ref, vm)
예제 #2
0
 def test_spawn_with_network_qos(self):
     self._create_instance()
     for vif_ref in xenapi_fake.get_all('VIF'):
         vif_rec = xenapi_fake.get_record('VIF', vif_ref)
         self.assertEquals(vif_rec['qos_algorithm_type'], 'ratelimit')
         self.assertEquals(vif_rec['qos_algorithm_params']['kbps'],
                           str(3 * 1024))
예제 #3
0
        def ensure_vbd_was_torn_down():
            vbd_labels = []
            for vbd_ref in xenapi_fake.get_all('VBD'):
                vbd_rec = xenapi_fake.get_record('VBD', vbd_ref)
                vbd_labels.append(vbd_rec["vm_name_label"])

            self.assertEquals(vbd_labels, ['1'])
예제 #4
0
        def ensure_vm_was_torn_down():
            vm_labels = []
            for vm_ref in xenapi_fake.get_all('VM'):
                vm_rec = xenapi_fake.get_record('VM', vm_ref)
                if not vm_rec["is_control_domain"]:
                    vm_labels.append(vm_rec["name_label"])

            self.assertEquals(vm_labels, ['1'])
예제 #5
0
 def VDI_introduce(self, _1, uuid, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11):
     valid_vdi = False
     refs = fake.get_all("VDI")
     for ref in refs:
         rec = fake.get_record("VDI", ref)
         if rec["uuid"] == uuid:
             valid_vdi = True
     if not valid_vdi:
         raise fake.Failure([["INVALID_VDI", "session", self._session]])
예제 #6
0
 def VDI_introduce(self, _1, uuid, _2, _3, _4, _5, _6, _7, _8, _9, _10,
                   _11):
     valid_vdi = False
     refs = fake.get_all('VDI')
     for ref in refs:
         rec = fake.get_record('VDI', ref)
         if rec['uuid'] == uuid:
             valid_vdi = True
     if not valid_vdi:
         raise fake.Failure([['INVALID_VDI', 'session', self._session]])
예제 #7
0
 def ensure_vdi_was_torn_down():
     for vdi_ref in xenapi_fake.get_all('VDI'):
         vdi_rec = xenapi_fake.get_record('VDI', vdi_ref)
         name_label = vdi_rec["name_label"]
         self.assert_(not name_label.endswith('snapshot'))
예제 #8
0
def _make_fake_vdi():
    sr_ref = fake.get_all('SR')[0]
    vdi_ref = fake.create_vdi('', False, sr_ref, False)
    vdi_rec = fake.get_record('VDI', vdi_ref)
    return vdi_rec['uuid']
예제 #9
0
def _make_fake_vdi():
    sr_ref = fake.get_all("SR")[0]
    vdi_ref = fake.create_vdi("", False, sr_ref, False)
    vdi_rec = fake.get_record("VDI", vdi_ref)
    return vdi_rec["uuid"]