Пример #1
0
 def setUp(self):
     super(TestNewtonCheck, self).setUp()
     self.useFixture(nova_fixtures.DatabaseAtVersion(329))
     self.context = context.get_admin_context()
     self.migration = importlib.import_module(
         'nova.db.sqlalchemy.migrate_repo.versions.'
         '330_enforce_mitaka_online_migrations')
     self.engine = db_api.get_engine()
Пример #2
0
 def setUp(self):
     super(TestNewtonCellsCheck, self).setUp()
     self.useFixture(nova_fixtures.DatabaseAtVersion(28, 'api'))
     self.context = context.get_admin_context()
     self.migration = importlib.import_module(
         'nova.db.sqlalchemy.api_migrations.migrate_repo.versions.'
         '030_require_cell_setup')
     self.engine = db_api.get_api_engine()
Пример #3
0
 def setUp(self):
     super(TestServicesUUIDCheck, self).setUp()
     self.useFixture(nova_fixtures.DatabaseAtVersion(398))
     self.context = context.get_admin_context()
     self.migration = importlib.import_module(
         'nova.db.sqlalchemy.migrate_repo.versions.'
         '400_enforce_service_uuid')
     self.engine = db_api.get_engine()
Пример #4
0
    def test_fixture_schema_version(self):
        self.useFixture(conf_fixture.ConfFixture())

        # In/after 317 aggregates did have uuid
        self.useFixture(fixtures.DatabaseAtVersion(318))
        engine = session.get_engine()
        engine.connect()
        meta = sqlalchemy.MetaData(engine)
        aggregate = sqlalchemy.Table('aggregates', meta, autoload=True)
        self.assertTrue(hasattr(aggregate.c, 'uuid'))

        # Before 317, aggregates had no uuid
        self.useFixture(fixtures.DatabaseAtVersion(316))
        engine = session.get_engine()
        engine.connect()
        meta = sqlalchemy.MetaData(engine)
        aggregate = sqlalchemy.Table('aggregates', meta, autoload=True)
        self.assertFalse(hasattr(aggregate.c, 'uuid'))
        engine.dispose()
Пример #5
0
 def setUp(self):
     super(TestNewtonCheck, self).setUp()
     # TODO(jgauld): Newton test depends on version 329.
     #               Temporarily set to 335 to bypass this check.
     #               Proper fix TBD.
     self.useFixture(nova_fixtures.DatabaseAtVersion(335))
     self.context = context.get_admin_context()
     self.migration = importlib.import_module(
         'nova.db.sqlalchemy.migrate_repo.versions.'
         '330_enforce_mitaka_online_migrations')
     self.engine = db_api.get_engine()
Пример #6
0
 def test_fixture_after_database_fixture(self):
     self.useFixture(conf_fixture.ConfFixture())
     self.useFixture(fixtures.Database())
     self.useFixture(fixtures.DatabaseAtVersion(318))