Esempio n. 1
0
def _execute_query(host, user_name, password, query):
    print("Starting to query database, host: %s, user: %s, password: %s, "
          "query: %s" % (host, user_name, password, query))

    with create_mysql_connection(host, user_name, password) as db:
        result = db.execute(query)
        return result
Esempio n. 2
0
 def assert_fails(self, ip, user_name, password):
     try:
         with mysql.create_mysql_connection(ip, user_name, password):
             pass
         fail("Should have failed to connect: mysql --host %s -u %s -p%s" %
              (ip, user_name, password))
     except mysql.MySqlPermissionsFailure:
         return  # Good, this is what we wanted.
     except mysql.MySqlConnectionFailure as mcf:
         fail("Expected to see permissions failure. Instead got message:"
              "%s" % mcf.message)
Esempio n. 3
0
 def assert_fails(self, ip, user_name, password):
     from trove.tests.util import mysql
     try:
         with mysql.create_mysql_connection(ip, user_name, password):
             pass
         fail("Should have failed to connect: mysql --host %s -u %s -p%s"
              % (ip, user_name, password))
     except mysql.MySqlPermissionsFailure:
         return  # Good, this is what we wanted.
     except mysql.MySqlConnectionFailure as mcf:
         fail("Expected to see permissions failure. Instead got message:"
              "%s" % mcf.message)
Esempio n. 4
0
def _execute_query(host, user_name, password, query):
    print(host, user_name, password, query)
    with create_mysql_connection(host, user_name, password) as db:
        result = db.execute(query)
        return result
    assert_true(False, "something went wrong in the sql connection")
Esempio n. 5
0
def _execute_query(host, user_name, password, query):
    print(host, user_name, password, query)
    with create_mysql_connection(host, user_name, password) as db:
        result = db.execute(query)
        return result
    assert_true(False, "something went wrong in the sql connection")
Esempio n. 6
0
    def create(self, ip, user_name, password):
        print("Connecting mysql, host: %s, user: %s, password: %s" %
              (ip, user_name, password))

        return mysql.create_mysql_connection(ip, user_name, password)
Esempio n. 7
0
 def create(self, ip, user_name, password):
     from trove.tests.util import mysql
     return mysql.create_mysql_connection(ip, user_name, password)
Esempio n. 8
0
 def create(self, ip, user_name, password):
     from trove.tests.util import mysql
     return mysql.create_mysql_connection(ip, user_name, password)