diff --git a/tests/pytest/fulltest.sh b/tests/pytest/fulltest.sh index 6aec67f9ce..e37dc6748a 100755 --- a/tests/pytest/fulltest.sh +++ b/tests/pytest/fulltest.sh @@ -84,4 +84,7 @@ python3 ./test.py $1 -f import_merge/importTRestart.py # user python3 ./test.py $1 -f user/user_create.py -python3 ./test.py $1 -f user/pass_len.py \ No newline at end of file +python3 ./test.py $1 -f user/pass_len.py + +# table +#python3 ./test.py $1 -f table/del_stable.py \ No newline at end of file diff --git a/tests/pytest/table/del_stable.py b/tests/pytest/table/del_stable.py new file mode 100644 index 0000000000..c81d598638 --- /dev/null +++ b/tests/pytest/table/del_stable.py @@ -0,0 +1,50 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +import sys +import taos +from util.log import tdLog +from util.cases import tdCases +from util.sql import tdSql + + +class TDTestCase: + def init(self, conn): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor()) + + def run(self): + tdSql.prepare() + + tdSql.execute("drop database if exists db") + print("==============step1") + tdSql.execute("create database db") + tdSql.execute("create table db.st (ts timestamp, i int) tags(j int)") + tdSql.execute("create table db.tb using st tags(1)") + tdSql.execute("insert into db.tb values(now, 1)") + + print("==============step2") + try: + tdSql.execute("drop table db.st") + except Exception as e: + tdLog.exit(e) + tdSql.execute("select * from db.st") + tdSql.checkRows(1) + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) diff --git a/tests/script/basicSuite.sim b/tests/script/basicSuite.sim index a99edfd93d..d0bb58ec20 100644 --- a/tests/script/basicSuite.sim +++ b/tests/script/basicSuite.sim @@ -18,3 +18,5 @@ run general/table/vgroup.sim run general/user/basic1.sim run general/user/pass_alter.sim run general/vector/single.sim +run general/connection/connection.sim +run general/user/authority.sim diff --git a/tests/script/general/connection/connection.sim b/tests/script/general/connection/connection.sim new file mode 100644 index 0000000000..71db20b285 --- /dev/null +++ b/tests/script/general/connection/connection.sim @@ -0,0 +1,21 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c wallevel -v 0 +system sh/exec.sh -n dnode1 -s start +sleep 3000 +sql connect + +print ============= step1 +sql close +print close1 +sql connect + +print ============= step2 +sql close +sql connect + +print ============= step3 +sql close +sql connect write + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/delete_reuse2.sim b/tests/script/general/db/delete_reuse2.sim index d8b2763042..d2fcaad838 100644 --- a/tests/script/general/db/delete_reuse2.sim +++ b/tests/script/general/db/delete_reuse2.sim @@ -30,6 +30,7 @@ sleep 2000 system sh/exec.sh -n dnode1 -s start sleep 3000 sql connect +sql reset query cache print ======== step1 sql create database d1 replica 1 diff --git a/tests/script/general/user/authority.sim b/tests/script/general/user/authority.sim new file mode 100644 index 0000000000..06f0467626 --- /dev/null +++ b/tests/script/general/user/authority.sim @@ -0,0 +1,72 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sql connect +sleep 3000 + +print ============= step1 +sql create user read pass 'taosdata' +sql create user write pass 'taosdata' +sql show users +if $rows != 5 then + return -1 +endi + +print ============= step2 +sql close +sql connect read +sleep 2000 + +sql create database dread +sql show databases +if $rows != 1 then + return -1 +endi + +print ============= step3 +sql close +sql connect write +sleep 2000 + +sql create database dwrite +sql show databases +if $rows != 1 then + return -1 +endi + +print ============ step4 +sql close +sql connect +sleep 2000 + +sql show databases +if $row != 2 then + return -1 +endi + +print ============ step5 +sql close +sql connect read +sleep 2000 + +sql drop database dread +sql drop database dwrite -x step51 + +step51: + +sql close +sql connect +sql show databases +if $rows != 1 then + return -1 +endi + +sql close +sql connect +sleep 2000 +sql drop database d1 +sql drop database d2 +sql drop database d3 +sql drop database d4 + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file