提交 2182f43b 编写于 作者: haoranc's avatar haoranc

[TD-10789]<test>: add line_protocol into testcase of taosdemoSml

上级 3b0702bc
...@@ -83,6 +83,60 @@ ...@@ -83,6 +83,60 @@
"tags_file": "", "tags_file": "",
"columns": [{"type": "INT"}, {"type": "DOUBLE", "count":1}, {"type": "BINARY", "len": 16, "count":1}, {"type": "BINARY", "len": 32, "count":1}], "columns": [{"type": "INT"}, {"type": "DOUBLE", "count":1}, {"type": "BINARY", "len": 16, "count":1}, {"type": "BINARY", "len": 32, "count":1}],
"tags": [{"type": "TINYINT", "count":2}, {"type": "BINARY", "len": 16, "count":1}] "tags": [{"type": "TINYINT", "count":2}, {"type": "BINARY", "len": 16, "count":1}]
},
{
"name": "stb2",
"child_table_exists":"no",
"childtable_count": 10,
"childtable_prefix": "stb00_",
"auto_create_table": "no",
"batch_create_tbl_num": 1,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "telnet" ,
"insert_rows": 100,
"childtable_limit": 0,
"childtable_offset":0,
"multi_thread_write_one_tbl": "no",
"interlace_rows": 0,
"insert_interval":0,
"max_sql_len": 1024000,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "2020-10-01 00:00:00.000",
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "DOUBLE"}],
"tags": [{"type": "TINYINT", "count":2}, {"type": "BINARY", "len": 16, "count":1}]
},
{
"name": "stb3",
"child_table_exists":"no",
"childtable_count": 10,
"childtable_prefix": "stb00_",
"auto_create_table": "no",
"batch_create_tbl_num": 1,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "json" ,
"insert_rows": 100,
"childtable_limit": -1,
"childtable_offset":0,
"multi_thread_write_one_tbl": "no",
"interlace_rows": 0,
"insert_interval":0,
"max_sql_len": 1024000,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 1,
"start_timestamp": "2020-10-01 00:00:00.000",
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "INT"}],
"tags": [{"type": "TINYINT", "count":2}, {"type": "BINARY", "len": 16, "count":1}]
}] }]
}] }]
} }
...@@ -49,6 +49,7 @@ class TDTestCase: ...@@ -49,6 +49,7 @@ class TDTestCase:
binPath = buildPath+ "/build/bin/" binPath = buildPath+ "/build/bin/"
# insert: create one or mutiple tables per sql and insert multiple rows per sql # insert: create one or mutiple tables per sql and insert multiple rows per sql
# line_protocol——telnet and json
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-1s1tnt1r-sml.json -y " % binPath) os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-1s1tnt1r-sml.json -y " % binPath)
tdSql.execute("use db") tdSql.execute("use db")
tdSql.query("select count (tbname) from stb0") tdSql.query("select count (tbname) from stb0")
...@@ -116,30 +117,6 @@ class TDTestCase: ...@@ -116,30 +117,6 @@ class TDTestCase:
tdSql.checkData(0, 0, 8) tdSql.checkData(0, 0, 8)
tdSql.query("select count (tbname) from stb4") tdSql.query("select count (tbname) from stb4")
tdSql.checkData(0, 0, 8) tdSql.checkData(0, 0, 8)
# os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-offset-sml.json -y" % binPath)
# tdSql.execute("use db")
# tdSql.query("select count(*) from stb0")
# tdSql.checkData(0, 0, 50)
# tdSql.query("select count(*) from stb1")
# tdSql.checkData(0, 0, 240)
# tdSql.query("select count(*) from stb2")
# tdSql.checkData(0, 0, 220)
# tdSql.query("select count(*) from stb3")
# tdSql.checkData(0, 0, 180)
# tdSql.query("select count(*) from stb4")
# tdSql.checkData(0, 0, 160)xxxxxxxxx
# os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-newtable-sml.json -y" % binPath)
# tdSql.execute("use db")
# tdSql.query("select count(*) from stb0")
# tdSql.checkData(0, 0, 150)
# tdSql.query("select count(*) from stb1")
# tdSql.checkData(0, 0, 360)
# tdSql.query("select count(*) from stb2")
# tdSql.checkData(0, 0, 360)
# tdSql.query("select count(*) from stb3")
# tdSql.checkData(0, 0, 340)
# tdSql.query("select count(*) from stb4")
# tdSql.checkData(0, 0, 400)
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-renewdb-sml.json -y" % binPath) os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-renewdb-sml.json -y" % binPath)
tdSql.execute("use db") tdSql.execute("use db")
tdSql.query("select count(*) from stb0") tdSql.query("select count(*) from stb0")
...@@ -208,18 +185,17 @@ class TDTestCase: ...@@ -208,18 +185,17 @@ class TDTestCase:
tdSql.checkData(0, 0, "2019-10-01 00:00:00") tdSql.checkData(0, 0, "2019-10-01 00:00:00")
tdSql.query("select last(ts) from blf.p_0_topics_6 ") tdSql.query("select last(ts) from blf.p_0_topics_6 ")
tdSql.checkData(0, 0, "2020-09-29 23:59:00") tdSql.checkData(0, 0, "2020-09-29 23:59:00")
# os.system("%staosdemo -f tools/taosdemoAllTest/sml/insertMaxNumPerReq-sml.json -y " % binPath) os.system("%staosdemo -f tools/taosdemoAllTest/sml/insertMaxNumPerReq-sml.json -y " % binPath)
# tdSql.execute("use db") tdSql.execute("use db")
# tdSql.query("select count(*) from stb0") tdSql.query("select count(*) from stb0")
# tdSql.checkData(0, 0, 5000000) tdSql.checkData(0, 0, 5000000)
# tdSql.query("select count(*) from stb1") tdSql.query("select count(*) from stb1")
# tdSql.checkData(0, 0, 5000000) tdSql.checkData(0, 0, 5000000)
# insert: timestamp and step # insert: timestamp and step
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-timestep-sml.json -y " % binPath) os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-timestep-sml.json -y " % binPath)
tdSql.execute("use db") tdSql.execute("use db")
tdSql.query("show stables")
tdSql.query("select count (tbname) from stb0") tdSql.query("select count (tbname) from stb0")
tdSql.checkData(0, 0, 10) tdSql.checkData(0, 0, 10)
tdSql.query("select count (tbname) from stb1") tdSql.query("select count (tbname) from stb1")
...@@ -266,42 +242,6 @@ class TDTestCase: ...@@ -266,42 +242,6 @@ class TDTestCase:
tdSql.checkData(0, 0, 15000) tdSql.checkData(0, 0, 15000)
# # insert: auto_create
# tdSql.execute('drop database if exists db')
# tdSql.execute('create database db')
# tdSql.execute('use db')
# os.system("%staosdemo -y -f tools/taosdemoAllTest/sml/insert-drop-exist-auto-N00-sml.json " % binPath) # drop = no, child_table_exists, auto_create_table varies
# tdSql.execute('use db')
# tdSql.query('show tables like \'NN123%\'') #child_table_exists = no, auto_create_table varies = 123
# tdSql.checkRows(20)
# tdSql.query('show tables like \'NNN%\'') #child_table_exists = no, auto_create_table varies = no
# tdSql.checkRows(20)
# tdSql.query('show tables like \'NNY%\'') #child_table_exists = no, auto_create_table varies = yes
# tdSql.checkRows(20)
# tdSql.query('show tables like \'NYN%\'') #child_table_exists = yes, auto_create_table varies = no
# tdSql.checkRows(0)
# tdSql.query('show tables like \'NY123%\'') #child_table_exists = yes, auto_create_table varies = 123
# tdSql.checkRows(0)
# tdSql.query('show tables like \'NYY%\'') #child_table_exists = yes, auto_create_table varies = yes
# tdSql.checkRows(0)
# tdSql.execute('drop database if exists db')
# os.system("%staosdemo -y -f tools/taosdemoAllTest/sml/insert-drop-exist-auto-Y00-sml.json " % binPath) # drop = yes, child_table_exists, auto_create_table varies
# tdSql.execute('use db')
# tdSql.query('show tables like \'YN123%\'') #child_table_exists = no, auto_create_table varies = 123
# tdSql.checkRows(20)
# tdSql.query('show tables like \'YNN%\'') #child_table_exists = no, auto_create_table varies = no
# tdSql.checkRows(20)
# tdSql.query('show tables like \'YNY%\'') #child_table_exists = no, auto_create_table varies = yes
# tdSql.checkRows(20)
# tdSql.query('show tables like \'YYN%\'') #child_table_exists = yes, auto_create_table varies = no
# tdSql.checkRows(20)
# tdSql.query('show tables like \'YY123%\'') #child_table_exists = yes, auto_create_table varies = 123
# tdSql.checkRows(20)
# tdSql.query('show tables like \'YYY%\'') #child_table_exists = yes, auto_create_table varies = yes
# tdSql.checkRows(20)
testcaseFilename = os.path.split(__file__)[-1] testcaseFilename = os.path.split(__file__)[-1]
os.system("rm -rf ./insert_res.txt") os.system("rm -rf ./insert_res.txt")
os.system("rm -rf tools/taosdemoAllTest/%s.sql" % testcaseFilename ) os.system("rm -rf tools/taosdemoAllTest/%s.sql" % testcaseFilename )
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册