def test_deleted_not_migrated(self):
        cn_values = dict(vcpus=1,
                         memory_mb=512,
                         local_gb=10,
                         vcpus_used=0,
                         memory_mb_used=256,
                         local_gb_used=5,
                         hypervisor_type='HyperDanVM',
                         hypervisor_version='34',
                         cpu_info='foo')
        cn = db_api.compute_node_create(self.context, cn_values)
        agg_values = dict(name='foo')
        agg = db_api.aggregate_create(self.context, agg_values)
        pd = db_api.pci_device_update(
            self.context, 1, 'foo:bar', {
                'parent_addr': None,
                'compute_node_id': 1,
                'address': 'foo:bar',
                'vendor_id': '123',
                'product_id': '456',
                'dev_type': 'foo',
                'label': 'foobar',
                'status': 'whatisthis?'
            })
        db_api.compute_node_delete(self.context, cn['id'])
        db_api.aggregate_delete(self.context, agg['id'])
        db_api.pci_device_destroy(self.context, pd['compute_node_id'],
                                  pd['address'])

        # blocker should not block on soft-deleted records
        self.migration.upgrade(self.engine)
示例#2
0
    def test_deleted_not_migrated(self):
        cn_values = dict(vcpus=1, memory_mb=512, local_gb=10,
                         vcpus_used=0, memory_mb_used=256,
                         local_gb_used=5, hypervisor_type='HyperDanVM',
                         hypervisor_version='34', cpu_info='foo')
        cn = db_api.compute_node_create(self.context, cn_values)
        agg_values = dict(name='foo')
        agg = db_api.aggregate_create(self.context, agg_values)
        pd = db_api.pci_device_update(self.context, 1, 'foo:bar',
                                 {'parent_addr': None,
                                  'compute_node_id': 1,
                                  'address': 'foo:bar',
                                  'vendor_id': '123',
                                  'product_id': '456',
                                  'dev_type': 'foo',
                                  'label': 'foobar',
                                  'status': 'whatisthis?'})
        db_api.compute_node_delete(self.context, cn['id'])
        db_api.aggregate_delete(self.context, agg['id'])
        db_api.pci_device_destroy(self.context, pd['compute_node_id'],
                                  pd['address'])

        # blocker should not block on soft-deleted records
        self.migration.upgrade(self.engine)
示例#3
0
 def test_upgrade_with_deleted_aggregates(self):
     agg = db_api.aggregate_create(self.context, self.aggregate_values)
     db_api.aggregate_delete(self.context, agg['id'])
     self.migration.upgrade(self.engine)
示例#4
0
 def test_upgrade_dirty_aggregates(self):
     db_api.aggregate_create(self.context, self.aggregate_values)
     self.assertRaises(exception.ValidationError, self.migration.upgrade,
                       self.engine)
示例#5
0
 def test_aggregate_not_migrated(self):
     agg = db_api.aggregate_create(self.context, {"name": "foobar"})
     db_api.aggregate_update(self.context, agg.id, {'uuid': None})
     self.assertRaises(exception.ValidationError, self.migration.upgrade,
                       self.engine)
示例#6
0
 def test_upgrade_with_deleted_aggregates(self):
     agg = db_api.aggregate_create(self.context, self.aggregate_values)
     db_api.aggregate_delete(self.context, agg['id'])
     self.migration.upgrade(self.engine)
示例#7
0
 def test_upgrade_dirty_aggregates(self):
     db_api.aggregate_create(self.context, self.aggregate_values)
     self.assertRaises(exception.ValidationError,
                       self.migration.upgrade, self.engine)
示例#8
0
 def test_aggregate_not_migrated(self):
     agg = db_api.aggregate_create(self.context, {"name": "foobar"})
     db_api.aggregate_update(self.context, agg.id, {'uuid': None})
     self.assertRaises(exception.ValidationError,
                       self.migration.upgrade, self.engine)