diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index aff5bedaf8..a1b90fdd1e 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -291,6 +291,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TS-3581.py ,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TS-3311.py ,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TS-3821.py +,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TS-5130.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/balance_vgroups_r1.py -N 6 ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/taosShell.py diff --git a/tests/system-test/99-TDcase/TS-5130.py b/tests/system-test/99-TDcase/TS-5130.py new file mode 100644 index 0000000000..a5a9d373a1 --- /dev/null +++ b/tests/system-test/99-TDcase/TS-5130.py @@ -0,0 +1,51 @@ +from util.log import * +from util.cases import * +from util.sql import * +from util.common import * +import taos + + + +class TDTestCase: + def init(self, conn, logSQl, replicaVal=1): + self.replicaVar = int(replicaVal) + tdLog.debug(f"start to excute {__file__}") + self.conn = conn + tdSql.init(conn.cursor(), False) + self.passwd = {'root':'taosdata', + 'test':'test'} + def prepare_user(self): + tdSql.execute(f"create user test pass 'test' sysinfo 1") + + def test_connect_user(self, uname): + try: + for db in ['information_schema', 'performance_schema']: + new_conn = taos.connect(host = self.conn._host, config = self.conn._config, + database =db, user=uname, password=self.passwd[uname]) + cursor = new_conn.cursor() + cursor.execute(f'show databases') + result = cursor.fetchall() + dbname = [i for i in result] + assert result == [('information_schema',), ('performance_schema',)] + tdLog.success(f"Test User {uname} for {db} .......[OK]") + new_conn.close() + + except: + tdLog.debug(f"{__file__} Failed!") + exit(-1) + + def run(self): + self.prepare_user() + self.test_connect_user('root') + self.test_connect_user('test') + + def stop(self): + tdSql.close() + tdLog.success(f"{__file__} successful executed") + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) + + + +