Пример #1
0
 def test_mysql_connect_fail(self):
     """Test that we can trigger a mysql connection failure and we fail
     gracefully to ensure we don't break people without mysql
     """
     if oslodbutils.is_backend_avail('mysql+mysqldb', self.DATABASE,
                                     "openstack_cifail", self.PASSWD):
         self.fail("Shouldn't have connected")
Пример #2
0
 def test_postgresql_connect_fail(self):
     """Test that we can trigger a postgres connection failure and we fail
     gracefully to ensure we don't break people without postgres
     """
     if oslodbutils.is_backend_avail('postgresql+psycopg2', self.DATABASE,
                                     "openstack_cifail", self.PASSWD):
         self.fail("Shouldn't have connected")
Пример #3
0
 def test_postgresql_connect_fail(self):
     """Test that we can trigger a postgres connection failure and we fail
     gracefully to ensure we don't break people without postgres
     """
     if oslodbutils.is_backend_avail('postgresql+psycopg2', self.DATABASE,
                                     "openstack_cifail", self.PASSWD):
         self.fail("Shouldn't have connected")
Пример #4
0
 def test_mysql_connect_fail(self):
     """Test that we can trigger a mysql connection failure and we fail
     gracefully to ensure we don't break people without mysql
     """
     if oslodbutils.is_backend_avail('mysql+mysqldb', self.DATABASE,
                                     "openstack_cifail", self.PASSWD):
         self.fail("Shouldn't have connected")
Пример #5
0
def _have_postgresql(user, passwd, database):
    present = os.environ.get('TEST_POSTGRESQL_PRESENT')
    if present is None:
        return utils.is_backend_avail(backend='postgres',
                                      user=user,
                                      passwd=passwd,
                                      database=database)
    return present.lower() in ('', 'true')
Пример #6
0
def _have_postgresql(user, passwd, database):
    present = os.environ.get('TEST_POSTGRESQL_PRESENT')
    if present is None:
        return utils.is_backend_avail(backend='postgres',
                                      user=user,
                                      passwd=passwd,
                                      database=database)
    return present.lower() in ('', 'true')
Пример #7
0
    def setUp(self):
        credentials = {
            'backend': self.FIXTURE.DRIVER,
            'user': self.FIXTURE.USERNAME,
            'passwd': self.FIXTURE.PASSWORD,
            'database': self.FIXTURE.DBNAME}

        if self.FIXTURE.DRIVER and not utils.is_backend_avail(**credentials):
            msg = '%s backend is not available.' % self.FIXTURE.DRIVER
            return self.skip(msg)

        super(OpportunisticTestCase, self).setUp()
Пример #8
0
    def setUp(self):
        credentials = {
            'backend': self.FIXTURE.DRIVER,
            'user': self.FIXTURE.USERNAME,
            'passwd': self.FIXTURE.PASSWORD,
            'database': self.FIXTURE.DBNAME
        }

        if self.FIXTURE.DRIVER and not utils.is_backend_avail(**credentials):
            msg = '%s backend is not available.' % self.FIXTURE.DRIVER
            return self.skip(msg)

        super(OpportunisticTestCase, self).setUp()
Пример #9
0
    def setUp(self):
        credentials = {
            "backend": self.FIXTURE.DRIVER,
            "user": self.FIXTURE.USERNAME,
            "passwd": self.FIXTURE.PASSWORD,
            "database": self.FIXTURE.DBNAME,
        }

        if self.FIXTURE.DRIVER and not utils.is_backend_avail(**credentials):
            msg = "%s backend is not available." % self.FIXTURE.DRIVER
            return self.skip(msg)

        super(OpportunisticTestCase, self).setUp()
Пример #10
0
def _have_postgresql(user, passwd, database):
    present = os.environ.get('NOVA_TEST_POSTGRESQL_PRESENT')
    if present is None:
        return oslodbutils.is_backend_avail('postgresql+psycopg2', database,
                                            user, passwd)
    return present.lower() in ('', 'true')
Пример #11
0
def _have_mysql(user, passwd, database):
    present = os.environ.get('NOVA_TEST_MYSQL_PRESENT')
    if present is None:
        return oslodbutils.is_backend_avail('mysql+mysqldb', database, user,
                                            passwd)
    return present.lower() in ('', 'true')
Пример #12
0
def _have_postgresql(user, passwd, database):
    present = os.environ.get('NOVA_TEST_POSTGRESQL_PRESENT')
    if present is None:
        return oslodbutils.is_backend_avail('postgresql+psycopg2', database,
                                            user, passwd)
    return present.lower() in ('', 'true')
Пример #13
0
def _have_mysql(user, passwd, database):
    present = os.environ.get('NOVA_TEST_MYSQL_PRESENT')
    if present is None:
        return oslodbutils.is_backend_avail('mysql+mysqldb', database,
                                            user, passwd)
    return present.lower() in ('', 'true')