From f50306de890e4902bfc7126ba5709a5a6ce2b76d Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sat, 4 Jul 2020 07:17:48 +0000 Subject: [PATCH] scripts --- tests/pytest/util/dnodes.py | 2 ++ tests/script/general/db/delete.sim | 6 ++++-- tests/script/general/db/tables.sim | 16 ++++------------ tests/script/general/db/vnodes.sim | 5 +++-- tests/script/general/http/restful_full.sim | 2 +- tests/script/general/parser/create_db.sim | 8 ++++---- tests/script/general/parser/limit_tb.sim | 5 +++++ tests/script/tmp/prepare.sim | 8 +++++++- 8 files changed, 30 insertions(+), 22 deletions(-) diff --git a/tests/pytest/util/dnodes.py b/tests/pytest/util/dnodes.py index 370af1ba13..52215aa053 100644 --- a/tests/pytest/util/dnodes.py +++ b/tests/pytest/util/dnodes.py @@ -72,6 +72,8 @@ class TDSimClient: self.cfg("charset", "UTF-8") self.cfg("asyncLog", "0") self.cfg("anyIp", "0") + self.cfg("maxVgroupsPerDb", "4") + self.cfg("maxTablesPerVnode", "1000") self.cfg("sdbDebugFlag", "135") self.cfg("rpcDebugFlag", "135") self.cfg("tmrDebugFlag", "131") diff --git a/tests/script/general/db/delete.sim b/tests/script/general/db/delete.sim index 6d0090a78d..477962a32d 100644 --- a/tests/script/general/db/delete.sim +++ b/tests/script/general/db/delete.sim @@ -2,6 +2,8 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c wallevel -v 2 system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10 +system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 10 +system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 1000 print ========= start dnodes system sh/exec.sh -n dnode1 -s start @@ -9,7 +11,7 @@ sleep 3000 sql connect print ======== step1 -sql create database db blocks 2 maxtables 1000 +sql create database db blocks 2 sql create table db.mt (ts timestamp, tbcol int) TAGS(tgcol int) $tbPrefix = db.t @@ -21,7 +23,7 @@ while $i < 2000 endw sql show db.vgroups -if $rows != 2 then +if $rows != 10 then return -1 endi diff --git a/tests/script/general/db/tables.sim b/tests/script/general/db/tables.sim index bf714dbf56..d700bf8068 100644 --- a/tests/script/general/db/tables.sim +++ b/tests/script/general/db/tables.sim @@ -2,15 +2,15 @@ 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/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2000 +system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 4 +system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4 system sh/exec.sh -n dnode1 -s start sleep 3000 sql connect print =============== step2 -sql create database db maxtables 4 +sql create database db sql show databases print $rows $data07 @@ -18,10 +18,6 @@ if $rows != 1 then return -1 endi -if $data07 != 4 then - return -1 -endi - print =============== step3 sql use db sql create table t1 (ts timestamp, i int) @@ -78,7 +74,7 @@ sql reset query cache sleep 4000 print =============== step7 -sql create database db maxtables 4 +sql create database db sql show databases print $rows $data07 @@ -86,10 +82,6 @@ if $rows != 1 then return -1 endi -if $data07 != 4 then - return -1 -endi - print =============== step8 sql use db sql create table t1 (ts timestamp, i int) diff --git a/tests/script/general/db/vnodes.sim b/tests/script/general/db/vnodes.sim index 54d8aa77c3..769eec3241 100644 --- a/tests/script/general/db/vnodes.sim +++ b/tests/script/general/db/vnodes.sim @@ -6,7 +6,8 @@ $totalRows = $totalVnodes * $maxTables system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v $maxTables +system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v $maxTables +system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v $totalVnodes system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v $totalVnodes system sh/cfg.sh -n dnode1 -c maxVnodeConnections -v 100000 system sh/cfg.sh -n dnode1 -c maxMeterConnections -v 100000 @@ -17,7 +18,7 @@ print ========== prepare data system sh/exec.sh -n dnode1 -s start sleep 3000 sql connect -sql create database db blocks 2 cache 1 maxTables $maxTables +sql create database db blocks 2 cache 1 sql use db print ========== step1 diff --git a/tests/script/general/http/restful_full.sim b/tests/script/general/http/restful_full.sim index 60ffa4cb28..7edf394845 100644 --- a/tests/script/general/http/restful_full.sim +++ b/tests/script/general/http/restful_full.sim @@ -81,7 +81,7 @@ print =============== step2 - no db #11 system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 127.0.0.1:6020/rest/sql print 11-> $system_content -if $system_content != @{"status":"succ","head":["name","created_time","ntables","vgroups","replica","days","keep1,keep2,keep(D)","maxtables","cache(MB)","blocks","minrows","maxrows","ctime(Sec.)","wallevel","comp","precision","status"],"data":[],"rows":0}@ then +if $system_content != @{"status":"succ","head":["name","created_time","ntables","vgroups","replica","days","keep1,keep2,keep(D)","cache(MB)","blocks","minrows","maxrows","wallevel","comp","precision","status"],"data":[],"rows":0}@ then return -1 endi diff --git a/tests/script/general/parser/create_db.sim b/tests/script/general/parser/create_db.sim index 2fbe03c093..be8587f2ae 100644 --- a/tests/script/general/parser/create_db.sim +++ b/tests/script/general/parser/create_db.sim @@ -128,12 +128,12 @@ endi if $data06 != 365,365,365 then return -1 endi -print data08 = $data08 -if $data08 != $cache then - print expect $cache, actual:$data08 +print data07 = $data07 +if $data07 != $cache then + print expect $cache, actual:$data07 return -1 endi -if $data09 != 4 then +if $data08 != 4 then return -1 endi diff --git a/tests/script/general/parser/limit_tb.sim b/tests/script/general/parser/limit_tb.sim index 9e62d652e2..970c7b75c5 100644 --- a/tests/script/general/parser/limit_tb.sim +++ b/tests/script/general/parser/limit_tb.sim @@ -356,6 +356,11 @@ if $rows != 0 then return -1 endi sql select top(c1, 5) from $tb where ts >= $ts0 and ts <= $tsu order by ts desc limit 3 offset 1 +print select top(c1, 5) from $tb where ts >= $ts0 and ts <= $tsu order by ts desc limit 3 offset 1 +print $data00 $data01 +print $data10 $data11 +print $data20 $data21 + if $rows != 3 then return -1 endi diff --git a/tests/script/tmp/prepare.sim b/tests/script/tmp/prepare.sim index 2480c20709..85146bd4c3 100644 --- a/tests/script/tmp/prepare.sim +++ b/tests/script/tmp/prepare.sim @@ -25,6 +25,12 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 20 system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 20 system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 20 +system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 20 +system sh/cfg.sh -n dnode2 -c maxVgroupsPerDb -v 20 +system sh/cfg.sh -n dnode3 -c maxVgroupsPerDb -v 20 +system sh/cfg.sh -n dnode4 -c maxVgroupsPerDb -v 20 + system sh/cfg.sh -n dnode1 -c http -v 1 system sh/cfg.sh -n dnode2 -c http -v 1 -system sh/cfg.sh -n dnode3 -c http -v 1 \ No newline at end of file +system sh/cfg.sh -n dnode3 -c http -v 1 +system sh/cfg.sh -n dnode4 -c http -v 1 \ No newline at end of file -- GitLab