Exemplo n.º 1
0
 def test_free_allocated_device(self):
     device.claim(self.devobj, self.inst)
     device.allocate(self.devobj, self.inst)
     self.assertEqual(len(self.inst.pci_devices), 1)
     device.free(self.devobj, self.inst)
     self.assertEqual(len(self.inst.pci_devices), 0)
     self.assertEqual(self.devobj.status, 'available')
     self.assertIsNone(self.devobj.instance_uuid)
Exemplo n.º 2
0
 def test_free_allocated_device(self):
     device.claim(self.devobj, self.inst)
     device.allocate(self.devobj, self.inst)
     self.assertEqual(len(self.inst.pci_devices), 1)
     device.free(self.devobj, self.inst)
     self.assertEqual(len(self.inst.pci_devices), 0)
     self.assertEqual(self.devobj.status,
                      fields.PciDeviceStatus.AVAILABLE)
     self.assertIsNone(self.devobj.instance_uuid)
Exemplo n.º 3
0
 def _free_device(self, dev, instance=None):
     device.free(dev, instance)
     stale = self.stale.pop(dev['address'], None)
     if stale:
         device.update_device(dev, stale)
     self.stats.add_device(dev)
Exemplo n.º 4
0
 def test_free_claimed_device(self):
     device.claim(self.devobj, self.inst)
     device.free(self.devobj, self.inst)
     self.assertEqual(self.devobj.status, 'available')
     self.assertIsNone(self.devobj.instance_uuid)
Exemplo n.º 5
0
 def _free_device(self, dev, instance=None):
     device.free(dev, instance)
     stale = self.stale.pop(dev["address"], None)
     if stale:
         device.update_device(dev, stale)
     self.stats.add_device(dev)
Exemplo n.º 6
0
 def test_free_claimed_device(self):
     device.claim(self.devobj, self.inst)
     device.free(self.devobj, self.inst)
     self.assertEqual(self.devobj.status,
                      fields.PciDeviceStatus.AVAILABLE)
     self.assertIsNone(self.devobj.instance_uuid)