From 68f45ebef71d404e010f4ba39a681d82c00661d7 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 19 Jan 2022 01:39:36 -0800 Subject: [PATCH] add test cases --- tests/script/sim/table/basic1.sim | 26 +++++++- tests/script/tmp/dnodes.sim | 105 ------------------------------ 2 files changed, 25 insertions(+), 106 deletions(-) delete mode 100644 tests/script/tmp/dnodes.sim diff --git a/tests/script/sim/table/basic1.sim b/tests/script/sim/table/basic1.sim index b5393a03dc..c33182dbf9 100644 --- a/tests/script/sim/table/basic1.sim +++ b/tests/script/sim/table/basic1.sim @@ -67,7 +67,31 @@ sql insert into c1 values(now+1s, 1) sql insert into c1 values(now+2s, 2) sql insert into c1 values(now+3s, 3) -return +print =============== query data +sql select * from c1 +if $rows != 3 then + return -1 +endi + +print $data00 $data01 +print $data10 $data11 +print $data20 $data11 + +if $data01 != 1 then + return -1 +endi + +if $data11 != 2 then + return -1 +endi + +if $data21 != 3 then + return -1 +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT +system sh/exec.sh -n dnode1 -s start + print =============== query data sql select * from c1 if $rows != 3 then diff --git a/tests/script/tmp/dnodes.sim b/tests/script/tmp/dnodes.sim deleted file mode 100644 index a3f9a0c173..0000000000 --- a/tests/script/tmp/dnodes.sim +++ /dev/null @@ -1,105 +0,0 @@ -############## config parameter ##################### -$node1 = 192.168.0.201 -$node2 = 192.168.0.202 -$node3 = 192.168.0.203 -$node4 = 192.168.0.204 - -$self = $node1 -$num = 25 - -#deploy = 0, start = 1, stop = 2 -$option = 0 -print =============== option:$option - - -############### stop dnodes ##################### -if $option == 0 then - system sh/stop_dnodes.sh -endi - -############### process firstEp ##################### - -$firstEp = $node1 . :7100 -$firstPort = 7100 -if $self == $node1 then - if $option == 1 then - system sh/exec.sh -n dnode1 -s start - endi - - if $option == 2 then - system sh/exec.sh -n dnode1 -s stop -x SIGINT - endi - - if $option == 0 then - system sh/deploy.sh -n dnode1 -i 1 - system sh/cfg.sh -n dnode1 -c firstEp -v $firstEp - system sh/cfg.sh -n dnode1 -c secondEp -v $firstEp - system sh/cfg.sh -n dnode1 -c fqdn -v $node1 - system sh/cfg.sh -n dnode1 -c serverPort -v $firstPort - system sh/cfg.sh -n dnode1 -c supportVnodes -v 0 - - system sh/exec.sh -n dnode1 -s start - sql connect - - $i = 0 - while $i < $num - $port = $i * 100 - $port = $port + 8100 - $i = $i + 1 - sql create dnode $node1 port $port - endw - - $i = 0 - while $i < $num - $port = $i * 100 - $port = $port + 8100 - $i = $i + 1 - sql create dnode $node2 port $port - endw - - $i = 0 - while $i < $num - $port = $i * 100 - $port = $port + 8100 - $i = $i + 1 - sql create dnode $node3 port $port - endw - - $i = 0 - while $i < $num - $port = $i * 100 - $port = $port + 8100 - $i = $i + 1 - sql create dnode $node4 port $port - endw - endi -endi - -############### process nodes ##################### - -$i = 0 -while $i < $num - $index = $i + 80 - $port = $i * 100 - $port = $port + 8100 - $dnodename = dnode . $index - $i = $i + 1 - - if $option == 1 then - system sh/exec.sh -n $dnodename -s start - endi - - if $option == 2 then - system sh/exec.sh -n $dnodename -s stop -x SIGINT - endi - - if $option == 0 then - system sh/deploy.sh -n $dnodename -i 1 - system sh/cfg.sh -n $dnodename -c firstEp -v $firstEp - system sh/cfg.sh -n $dnodename -c secondEp -v $firstEp - system sh/cfg.sh -n $dnodename -c fqdn -v $self - system sh/cfg.sh -n $dnodename -c serverPort -v $port - - system sh/exec.sh -n $dnodename -s start - endi -endw -- GitLab