Exemple #1
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")
Exemple #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")
Exemple #3
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")
Exemple #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")
Exemple #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')
Exemple #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')
Exemple #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()
Exemple #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()
Exemple #9
0
def _have_postgresql(user, passwd, database):
    present = os.environ.get('RACK_TEST_POSTGRESQL_PRESENT')
    if present is None:
        return oslodbutils.is_backend_avail('postgresql+psycopg2', database,
                                            user, passwd)
    return present.lower() in ('', 'true')
Exemple #10
0
def _have_mysql(user, passwd, database):
    present = os.environ.get('RACK_TEST_MYSQL_PRESENT')
    if present is None:
        return oslodbutils.is_backend_avail('mysql+mysqldb', database, user,
                                            passwd)
    return present.lower() in ('', 'true')
Exemple #11
0
def _have_postgresql(user, passwd, database):
    present = os.environ.get('RACK_TEST_POSTGRESQL_PRESENT')
    if present is None:
        return oslodbutils.is_backend_avail('postgresql+psycopg2', database,
                                            user, passwd)
    return present.lower() in ('', 'true')
Exemple #12
0
def _have_mysql(user, passwd, database):
    present = os.environ.get('RACK_TEST_MYSQL_PRESENT')
    if present is None:
        return oslodbutils.is_backend_avail('mysql+mysqldb', database,
                                            user, passwd)
    return present.lower() in ('', 'true')