Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e46fc099
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e46fc099
编写于
7月 11, 2023
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add test case
上级
6efa688c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
6 deletion
+15
-6
tests/system-test/0-others/show.py
tests/system-test/0-others/show.py
+15
-6
未找到文件。
tests/system-test/0-others/show.py
浏览文件 @
e46fc099
...
...
@@ -83,12 +83,20 @@ class TDTestCase:
tag_sql
+=
f
"
{
k
}
{
v
}
, "
create_stb_sql
=
f
'create stable
{
stbname
}
(
{
column_sql
[:
-
2
]
}
) tags (
{
tag_sql
[:
-
2
]
}
)'
return
create_stb_sql
def
set_create_database_sql
(
self
,
sql_dict
):
create_sql
=
'create'
for
key
,
value
in
sql_dict
.
items
():
create_sql
+=
f
'
{
key
}
{
value
}
'
return
create_sql
def
show_create_sysdb_sql
(
self
):
sysdb_list
=
{
'information_schema'
,
'performance_schema'
}
for
db
in
sysdb_list
:
tdSql
.
query
(
f
'show create database
{
db
}
'
)
tdSql
.
checkEqual
(
f
'
{
db
}
'
,
tdSql
.
queryResult
[
0
][
0
])
tdSql
.
checkEqual
(
f
'CREATE DATABASE `
{
db
}
`'
,
tdSql
.
queryResult
[
0
][
1
])
def
show_create_sql
(
self
):
create_db_sql
=
self
.
set_create_database_sql
(
self
.
db_param
)
print
(
create_db_sql
)
...
...
@@ -108,7 +116,7 @@ class TDTestCase:
tdSql
.
query
(
'show vnodes 1'
)
tdSql
.
checkRows
(
self
.
vgroups
)
tdSql
.
execute
(
f
'use
{
self
.
dbname
}
'
)
column_dict
=
{
'`ts`'
:
'timestamp'
,
'`col1`'
:
'tinyint'
,
...
...
@@ -124,7 +132,7 @@ class TDTestCase:
'`col11`'
:
'bool'
,
'`col12`'
:
'varchar(20)'
,
'`col13`'
:
'nchar(20)'
}
tag_dict
=
{
'`t1`'
:
'tinyint'
,
...
...
@@ -141,7 +149,7 @@ class TDTestCase:
'`t12`'
:
'varchar(20)'
,
'`t13`'
:
'nchar(20)'
,
'`t14`'
:
'timestamp'
}
create_table_sql
=
self
.
set_stb_sql
(
self
.
stbname
,
column_dict
,
tag_dict
)
tdSql
.
execute
(
create_table_sql
)
...
...
@@ -152,7 +160,7 @@ class TDTestCase:
tag_sql
=
'('
for
tag_keys
in
tag_dict
.
keys
():
tag_sql
+=
f
'
{
tag_keys
}
, '
tags
=
f
'
{
tag_sql
[:
-
2
]
}
)'
tags
=
f
'
{
tag_sql
[:
-
2
]
}
)'
sql
=
f
'create table
{
self
.
tbname
}
using
{
self
.
stbname
}
{
tags
}
tags (1, 1, 1, 1, 1, 1, 1, 1, 1.000000e+00, 1.000000e+00, true, "abc", "abc123", 0)'
tdSql
.
query
(
f
'show create table
{
self
.
tbname
}
'
)
query_result
=
tdSql
.
queryResult
...
...
@@ -175,7 +183,7 @@ class TDTestCase:
taosd_info
=
os
.
popen
(
'taosd -V'
).
read
()
taosd_gitinfo
=
re
.
findall
(
"^gitinfo.*"
,
taosd_info
,
re
.
M
)
tdSql
.
checkEqual
(
taosd_gitinfo_sql
,
taosd_gitinfo
[
0
])
def
show_base
(
self
):
for
sql
in
[
'dnodes'
,
'mnodes'
,
'cluster'
]:
tdSql
.
query
(
f
'show
{
sql
}
'
)
...
...
@@ -193,6 +201,7 @@ class TDTestCase:
self
.
ins_check
()
self
.
perf_check
()
self
.
show_create_sql
()
self
.
show_create_sysdb_sql
()
def
stop
(
self
):
tdSql
.
close
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录