test: adjust test case for createdb

This commit is contained in:
kailixu 2024-06-04 16:50:49 +08:00
parent 2f222514dc
commit d7b63b9a83
3 changed files with 4 additions and 0 deletions

View File

@ -6,6 +6,8 @@ sql connect
print ========================root user create user print ========================root user create user
sql create user u1 pass "taosdata" sql create user u1 pass "taosdata"
sql create user u2 pass "taosdata" sql create user u2 pass "taosdata"
sql alter user u1 createdb 1
sql alter user u2 createdb 1
sql create database test sql create database test
sql select * from information_schema.ins_user_privileges where user_name == "root" sql select * from information_schema.ins_user_privileges where user_name == "root"
if $rows != 1 then if $rows != 1 then

View File

@ -133,6 +133,7 @@ class TDTestCase:
tdSql.prepare() tdSql.prepare()
# time.sleep(2) # time.sleep(2)
tdSql.query("create user testpy pass 'testpy'") tdSql.query("create user testpy pass 'testpy'")
tdSql.query("alter user testpy createdb 1")
#hostname = socket.gethostname() #hostname = socket.gethostname()
#tdLog.info ("hostname: %s" % hostname) #tdLog.info ("hostname: %s" % hostname)

View File

@ -80,6 +80,7 @@ class TDTestCase:
def create_user(self, username, password): def create_user(self, username, password):
tdSql.execute(f"create user {username} pass '{password}';") tdSql.execute(f"create user {username} pass '{password}';")
tdSql.execute(f"alter user {username} createdb 1;")
tdLog.debug("Create user {} with password {} successfully".format(username, password)) tdLog.debug("Create user {} with password {} successfully".format(username, password))
def check_permissions(self, username, db_name, permission_dict, view_name=None): def check_permissions(self, username, db_name, permission_dict, view_name=None):