未验证 提交 2ef37dea 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #1888 from taosdata/feature/changshuaiqiang/testcase

add test case
......@@ -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
###################################################################
# 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())
......@@ -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
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
......@@ -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
......
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册