From 0f008389c51f538563006a0f82082c7a33a02fa7 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 1 Aug 2022 11:56:58 +0800 Subject: [PATCH] test: adjust case --- tests/script/tsim/db/basic3.sim | 90 +++++++++++++-------------------- 1 file changed, 36 insertions(+), 54 deletions(-) diff --git a/tests/script/tsim/db/basic3.sim b/tests/script/tsim/db/basic3.sim index 1170406a5c..17faee993c 100644 --- a/tests/script/tsim/db/basic3.sim +++ b/tests/script/tsim/db/basic3.sim @@ -1,69 +1,51 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c debugflag -v 131 -system sh/exec.sh -n dnode1 -s start -v +system sh/exec.sh -n dnode1 -s start sql connect -print =============== step1: create drop show dnodes -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - print ---> dnode not ready! - return -1 - endi -sql show dnodes -print ---> $data00 $data01 $data02 $data03 $data04 $data05 -if $rows != 1 then +print =============== create database d1 +sql create database d1 +sql create table d1.t1 (ts timestamp, i int); +sql create table d1.t2 (ts timestamp, i int); +sql create table d1.t3 (ts timestamp, i int); +sql create table d1.t4 (ts timestamp, i int); + +sql show databases +if $rows != 3 then return -1 endi -if $data(1)[4] != ready then - goto step1 -endi - -$tbPrefix = tb -$tbNum = 5 -$rowNum = 10 -print =============== step2: prepare data -sql create database db vgroups 2 -sql use db -sql create table if not exists stb (ts timestamp, tbcol int, tbcol2 float, tbcol3 double, tbcol4 binary(30), tbcol5 binary(30)) tags (tgcol int unsigned) +if $data20 != d1 then + return -1 +endi -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using stb tags( $i ) - $x = 0 - while $x < $rowNum - $cc = $x * 60000 - $ms = 1601481600000 + $cc - sql insert into $tb values ($ms , $x , $x , $x , "abcd1234=-+*" , "123456 0" ) - $x = $x + 1 - endw +if $data22 != 2 then + return -1 +endi - $cc = $x * 60000 - $ms = 1601481600000 + $cc - sql insert into $tb values ($ms , NULL , NULL , NULL , NULL , NULL ) - $i = $i + 1 -endw +#if $data03 != 4 then +# return -1 +#endi -print =============== step3: tb -sql select tbcol5 - tbcol tbcol from tb1 -sql select tbcol2 - tbcol tbcol from tb1 +sql show d1.tables +if $rows != 4 then + return -1 +endi -_OVER: -system sh/exec.sh -n dnode1 -s stop -x SIGINT -print =============== check -$null= +print =============== create database d2 +sql create database d2 +sql create table d2.t1 (ts timestamp, i int); +sql create table d2.t2 (ts timestamp, i int); +sql create table d2.t3 (ts timestamp, i int); -system_content sh/checkValgrind.sh -n dnode1 -print cmd return result ----> [ $system_content ] -if $system_content > 0 then +sql show databases +if $rows != 4 then return -1 -endi +endi -if $system_content == $null then +sql show d2.tables +if $rows != 3 then return -1 -endi +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file -- GitLab