提交 1a8917cb 编写于 作者: C cpwu

fix case

上级 3a734758
...@@ -262,6 +262,9 @@ class TDTestCase: ...@@ -262,6 +262,9 @@ class TDTestCase:
def __change_user_priv(self, user: User, pre_priv, invoke=False): def __change_user_priv(self, user: User, pre_priv, invoke=False):
if user.priv == pre_priv and invoke : if user.priv == pre_priv and invoke :
return return
if user.name == "root":
return
if pre_priv.upper() == PRIVILEGES_ALL: if pre_priv.upper() == PRIVILEGES_ALL:
pre_weight = -5 if invoke else 5 pre_weight = -5 if invoke else 5
elif pre_priv.upper() == PRIVILEGES_READ: elif pre_priv.upper() == PRIVILEGES_READ:
...@@ -299,7 +302,7 @@ class TDTestCase: ...@@ -299,7 +302,7 @@ class TDTestCase:
tdSql.query(sql) tdSql.query(sql)
self.__change_user_priv(user=user, pre_priv=priv) self.__change_user_priv(user=user, pre_priv=priv)
user.db_set.add(dbname) user.db_set.add(dbname)
time.sleep(2) time.sleep(1)
def revoke_user(self, user: User = None, priv=PRIVILEGES_ALL, dbname=None): def revoke_user(self, user: User = None, priv=PRIVILEGES_ALL, dbname=None):
sql = self.__revoke_user_privileges(privilege=priv, dbname=dbname, user_name=user.name) sql = self.__revoke_user_privileges(privilege=priv, dbname=dbname, user_name=user.name)
...@@ -307,11 +310,9 @@ class TDTestCase: ...@@ -307,11 +310,9 @@ class TDTestCase:
if user is None or priv not in (PRIVILEGES_ALL, PRIVILEGES_READ, PRIVILEGES_WRITE): if user is None or priv not in (PRIVILEGES_ALL, PRIVILEGES_READ, PRIVILEGES_WRITE):
tdSql.error(sql) tdSql.error(sql)
tdSql.query(sql) tdSql.query(sql)
if user.name == "root":
return
self.__change_user_priv(user=user, pre_priv=priv, invoke=True) self.__change_user_priv(user=user, pre_priv=priv, invoke=True)
user.db_set.remove(dbname) user.db_set.remove(dbname)
time.sleep(2) time.sleep(1)
def test_priv_change_current(self): def test_priv_change_current(self):
tdLog.printNoPrefix("==========step 1.0: if do not grant, can not read/write") tdLog.printNoPrefix("==========step 1.0: if do not grant, can not read/write")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册