Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7df0fba5
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7df0fba5
编写于
4月 28, 2022
作者:
P
plum-lihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[test: add test cases for taosshell]
上级
34675b2c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
83 addition
and
3 deletion
+83
-3
tests/system-test/0-others/taosShell.py
tests/system-test/0-others/taosShell.py
+83
-3
未找到文件。
tests/system-test/0-others/taosShell.py
浏览文件 @
7df0fba5
...
...
@@ -57,12 +57,12 @@ def taos_command (buildPath, key, value, expectString, cfgDir, sqlString='', key
else
:
return
"TAOS_FAIL"
else
:
if
key
==
'A'
or
key1
==
'A'
or
key
==
'C'
or
key1
==
'C'
:
if
key
==
'A'
or
key1
==
'A'
or
key
==
'C'
or
key1
==
'C'
or
key
==
'V'
or
key1
==
'V'
:
return
"TAOS_OK"
,
retResult
else
:
return
"TAOS_OK"
else
:
if
key
==
'A'
or
key1
==
'A'
or
key
==
'C'
or
key1
==
'C'
:
if
key
==
'A'
or
key1
==
'A'
or
key
==
'C'
or
key1
==
'C'
or
key
==
'V'
or
key1
==
'V'
:
return
"TAOS_OK"
,
retResult
else
:
return
"TAOS_FAIL"
...
...
@@ -311,7 +311,7 @@ class TDTestCase:
tdSql
.
query
(
'drop database %s'
%
newDbName
)
tdLog
.
printNoPrefix
(
"================================ parameter: -C"
)
newDbName
=
"dbcc"
#
newDbName="dbcc"
retCode
,
retVal
=
taos_command
(
buildPath
,
"C"
,
keyDict
[
'C'
],
"buildinfo"
,
keyDict
[
'c'
],
''
,
''
,
''
)
if
retCode
!=
"TAOS_OK"
:
tdLog
.
exit
(
"taos -C fail"
)
...
...
@@ -336,6 +336,86 @@ class TDTestCase:
if
(
totalCfgItem
[
"numOfCores"
][
2
]
!=
count
)
and
(
totalCfgItem
[
"numOfCores"
][
0
]
!=
'default'
):
tdLog
.
exit
(
"taos -C return numOfCores error!"
)
version
=
totalCfgItem
[
"version"
][
2
]
tdLog
.
printNoPrefix
(
"================================ parameter: -V"
)
#newDbName="dbvv"
retCode
,
retVal
=
taos_command
(
buildPath
,
"V"
,
keyDict
[
'V'
],
""
,
keyDict
[
'c'
],
''
,
''
,
''
)
if
retCode
!=
"TAOS_OK"
:
tdLog
.
exit
(
"taos -V fail"
)
version
=
'version: '
+
version
retVal
=
retVal
.
replace
(
"
\n
"
,
""
)
retVal
=
retVal
.
replace
(
"
\r
"
,
""
)
if
retVal
!=
version
:
print
(
"return version: [%s]"
%
retVal
)
print
(
"dict version: [%s]"
%
version
)
tdLog
.
exit
(
"taos -V version not match"
)
tdLog
.
printNoPrefix
(
"================================ parameter: -d"
)
newDbName
=
"dbd"
sqlString
=
'create database '
+
newDbName
+
';'
retCode
=
taos_command
(
buildPath
,
"d"
,
keyDict
[
'd'
],
"taos>"
,
keyDict
[
'c'
],
sqlString
,
''
,
''
)
if
retCode
!=
"TAOS_OK"
:
tdLog
.
exit
(
"taos -d %s fail"
%
(
keyDict
[
'd'
]))
else
:
tdSql
.
query
(
"show databases"
)
for
i
in
range
(
tdSql
.
queryRows
):
if
tdSql
.
getData
(
i
,
0
)
==
newDbName
:
break
else
:
tdLog
.
exit
(
"create db fail after taos -d %s fail"
%
(
keyDict
[
'd'
]))
tdSql
.
query
(
'drop database %s'
%
newDbName
)
retCode
=
taos_command
(
buildPath
,
"d"
,
'dbno'
,
"taos>"
,
keyDict
[
'c'
],
sqlString
,
''
,
''
)
if
retCode
!=
"TAOS_FAIL"
:
tdLog
.
exit
(
"taos -d dbno fail"
)
tdLog
.
printNoPrefix
(
"================================ parameter: -w"
)
newDbName
=
"dbw"
keyDict
[
's'
]
=
"
\"
create database "
+
newDbName
+
"
\"
"
retCode
=
taos_command
(
buildPath
,
"s"
,
keyDict
[
's'
],
"Query OK"
,
keyDict
[
'c'
],
''
,
''
,
''
)
if
retCode
!=
"TAOS_OK"
:
tdLog
.
exit
(
"taos -w fail"
)
keyDict
[
's'
]
=
"
\"
create table "
+
newDbName
+
".ntb (ts timestamp, c binary(128))
\"
"
retCode
=
taos_command
(
buildPath
,
"s"
,
keyDict
[
's'
],
"Query OK"
,
keyDict
[
'c'
],
''
,
''
,
''
)
if
retCode
!=
"TAOS_OK"
:
tdLog
.
exit
(
"taos -w create table fail"
)
keyDict
[
's'
]
=
"
\"
insert into "
+
newDbName
+
".ntb values('2021-04-01 08:00:00.001', 'abcd0123456789')('2021-04-01 08:00:00.002', 'abcd012345678901234567890123456789')
\"
"
retCode
=
taos_command
(
buildPath
,
"s"
,
keyDict
[
's'
],
"Query OK"
,
keyDict
[
'c'
],
''
,
''
,
''
)
if
retCode
!=
"TAOS_OK"
:
tdLog
.
exit
(
"taos -w insert data fail"
)
keyDict
[
's'
]
=
"
\"
insert into "
+
newDbName
+
".ntb values('2021-04-01 08:00:00.003', 'aaaaaaaaaaaaaaaaaaaa')('2021-04-01 08:00:01.004', 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb')
\"
"
retCode
=
taos_command
(
buildPath
,
"s"
,
keyDict
[
's'
],
"Query OK"
,
keyDict
[
'c'
],
''
,
''
,
''
)
if
retCode
!=
"TAOS_OK"
:
tdLog
.
exit
(
"taos -w insert data fail"
)
keyDict
[
's'
]
=
"
\"
insert into "
+
newDbName
+
".ntb values('2021-04-01 08:00:00.005', 'cccccccccccccccccccc')('2021-04-01 08:00:01.006', 'dddddddddddddddddddddddddddddddddddddddd')
\"
"
retCode
=
taos_command
(
buildPath
,
"s"
,
keyDict
[
's'
],
"Query OK"
,
keyDict
[
'c'
],
''
,
''
,
''
)
if
retCode
!=
"TAOS_OK"
:
tdLog
.
exit
(
"taos -w insert data fail"
)
keyDict
[
's'
]
=
"
\"
select * from "
+
newDbName
+
".ntb
\"
"
retCode
=
taos_command
(
buildPath
,
"s"
,
keyDict
[
's'
],
"aaaaaaaaaaaaaaaaaaaa"
,
keyDict
[
'c'
],
''
,
''
,
''
)
if
retCode
!=
"TAOS_OK"
:
tdLog
.
exit
(
"taos -w insert data fail"
)
keyDict
[
's'
]
=
"
\"
select * from "
+
newDbName
+
".ntb
\"
"
retCode
=
taos_command
(
buildPath
,
"s"
,
keyDict
[
's'
],
"dddddddddddddddddddddddddddddddddddddddd"
,
keyDict
[
'c'
],
''
,
''
,
''
)
if
retCode
!=
"TAOS_FAIL"
:
tdLog
.
exit
(
"taos -w insert data fail"
)
keyDict
[
's'
]
=
"
\"
select * from "
+
newDbName
+
".ntb
\"
"
retCode
=
taos_command
(
buildPath
,
"s"
,
keyDict
[
's'
],
"dddddddddddddddddddddddddddddddddddddddd"
,
keyDict
[
'c'
],
''
,
'w'
,
'60'
)
if
retCode
!=
"TAOS_OK"
:
tdLog
.
exit
(
"taos -w insert data fail"
)
tdSql
.
query
(
'drop database %s'
%
newDbName
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录