From fe67fed4f49e113540daa96fc773435eed911f1b Mon Sep 17 00:00:00 2001 From: plum-lihui Date: Thu, 24 Mar 2022 16:32:16 +0800 Subject: [PATCH] [add show cases] --- tests/script/jenkins/basic.txt | 3 + tests/script/tsim/show/basic.sim | 88 +++++++++++++++++++++++++++-- tests/script/tsim/testCaseSuite.sim | 2 + 3 files changed, 87 insertions(+), 6 deletions(-) diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index 735d096aae..ee25b20285 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -23,6 +23,9 @@ ./test.sh -f tsim/query/interval.sim #./test.sh -f tsim/query/interval-offset.sim +# ---- show +./test.sh -f tsim/show/basic.sim + # ---- table ./test.sh -f tsim/table/basic1.sim diff --git a/tests/script/tsim/show/basic.sim b/tests/script/tsim/show/basic.sim index fe19b3038d..cc92686142 100644 --- a/tests/script/tsim/show/basic.sim +++ b/tests/script/tsim/show/basic.sim @@ -33,12 +33,14 @@ sql connect print =============== add dnode2 into cluster sql create dnode $hostname port 7200 + +print =============== create database, stable, table sql create database db vgroups 3 sql use db sql create table stb (ts timestamp, c int) tags (t int) sql create table t0 using stb tags (0) - +print =============== run show xxxx sql show dnodes if $rows != 2 then return -1 @@ -76,16 +78,17 @@ if $rows != 3 then return -1 endi -sql select * from information_schema.dnodes +print =============== run select * from information_schema.xxxx +sql select * from information_schema.`dnodes` if $rows != 2 then return -1 endi -sql select * from information_schema.mnodes +sql select * from information_schema.`mnodes` if $rows != 1 then return -1 endi -#sql select * from information_schema.modules -#sql select * from information_schema.qnodes +#sql select * from information_schema.`modules` +#sql select * from information_schema.`qnodes` sql select * from information_schema.user_databases if $rows != 2 then return -1 @@ -106,7 +109,7 @@ sql select * from information_schema.user_users if $rows != 1 then return -1 endi -sql select * from information_schema.vgroups +sql select * from information_schema.`vgroups` if $rows != 3 then return -1 endi @@ -135,5 +138,78 @@ if $data04 != ready then endi print ==== again run show / select of above +print =============== run show xxxx +sql show dnodes +if $rows != 2 then + return -1 +endi + +sql show mnodes +if $rows != 1 then + return -1 +endi +#sql show modules +#sql show qnodes +sql show databases +if $rows != 2 then + return -1 +endi +#sql show functions + +#sql show indexes +sql show stables +if $rows != 1 then + return -1 +endi +#sql show streams, +sql show tables +if $rows != 1 then + return -1 +endi +#sql show user_table_distributed +sql show users +if $rows != 1 then + return -1 +endi +sql show vgroups +if $rows != 3 then + return -1 +endi + +print =============== run select * from information_schema.xxxx +sql select * from information_schema.`dnodes` +if $rows != 2 then + return -1 +endi +sql select * from information_schema.`mnodes` +if $rows != 1 then + return -1 +endi +#sql select * from information_schema.`modules` +#sql select * from information_schema.`qnodes` +sql select * from information_schema.user_databases +if $rows != 2 then + return -1 +endi +#sql select * from information_schema.user_functions +#sql select * from information_schema.user_indexes +sql select * from information_schema.user_stables +if $rows != 1 then + return -1 +endi +#sql select * from information_schema.user_streams +sql select * from information_schema.user_tables +if $rows != 1 then + return -1 +endi +#sql select * from information_schema.user_table_distributed +sql select * from information_schema.user_users +if $rows != 1 then + return -1 +endi +sql select * from information_schema.`vgroups` +if $rows != 3 then + return -1 +endi #system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/testCaseSuite.sim b/tests/script/tsim/testCaseSuite.sim index 978dfec840..4b700d2ca4 100644 --- a/tests/script/tsim/testCaseSuite.sim +++ b/tests/script/tsim/testCaseSuite.sim @@ -16,6 +16,8 @@ run tsim/insert/null.sim run tsim/query/interval.sim #run tsim/query/interval-offset.sim # TD-14266 +run tsim/show/basic.sim + run tsim/table/basic1.sim run tsim/tmq/basic.sim