def test_destroy_pci_device(self): v1, v2 = self._create_fake_pci_devs() results = dbapi.get_all_pci_device_by_node(self.compute_node['uuid']) self._assertEqualListsOfObjects(results, [v1, v2], self.ignored_keys) dbapi.destroy_pci_device(v1['compute_node_uuid'], v1['address']) results = dbapi.get_all_pci_device_by_node(self.compute_node['uuid']) self._assertEqualListsOfObjects(results, [v2], self.ignored_keys)
def test_get_all_pci_device_by_node_empty(self): v1, v2 = self._get_fake_pci_devs() results = dbapi.get_all_pci_device_by_node(9) self.assertEqual(len(results), 0)
def list_by_compute_node(cls, context, node_id): db_dev_list = dbapi.get_all_pci_device_by_node(node_id) return PciDevice._from_db_object_list(db_dev_list, cls, context)
def test_get_all_pci_device_by_node(self): v1, v2 = self._create_fake_pci_devs() results = dbapi.get_all_pci_device_by_node(uuidsentinel.compute_node) self._assertEqualListsOfObjects(results, [v1, v2], self.ignored_keys)
def list_by_compute_node(cls, context, node_id): db_dev_list = dbapi.get_all_pci_device_by_node(node_id) return PciDevice._from_db_object_list(db_dev_list, cls, context)