test: case for stable
This commit is contained in:
parent
eaf3f3ee3f
commit
ad51f50660
|
@ -171,6 +171,12 @@
|
||||||
./test.sh -f tsim/vnode/replica3_vgroup.sim
|
./test.sh -f tsim/vnode/replica3_vgroup.sim
|
||||||
#./test.sh -f tsim/vnode/replica3_many.sim
|
#./test.sh -f tsim/vnode/replica3_many.sim
|
||||||
#./test.sh -f tsim/vnode/replica3_import.sim
|
#./test.sh -f tsim/vnode/replica3_import.sim
|
||||||
|
#./test.sh -f tsim/vnode/stable_balance_replica1.sim
|
||||||
|
./test.sh -f tsim/vnode/stable_dnode2_stop.sim
|
||||||
|
./test.sh -f tsim/vnode/stable_dnode2.sim
|
||||||
|
#./test.sh -f tsim/vnode/stable_dnode3.sim
|
||||||
|
#./test.sh -f tsim/vnode/stable_replica3_dnode6.sim
|
||||||
|
#./test.sh -f tsim/vnode/stable_replica3_vnode3.sim
|
||||||
|
|
||||||
# --- sync
|
# --- sync
|
||||||
./test.sh -f tsim/sync/3Replica1VgElect.sim
|
./test.sh -f tsim/sync/3Replica1VgElect.sim
|
||||||
|
|
|
@ -1,28 +1,40 @@
|
||||||
system sh/stop_dnodes.sh
|
system sh/stop_dnodes.sh
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/deploy.sh -n dnode2 -i 2
|
system sh/deploy.sh -n dnode2 -i 2
|
||||||
system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
system sh/deploy.sh -n dnode3 -i 3
|
||||||
system sh/cfg.sh -n dnode2 -c walLevel -v 1
|
system sh/deploy.sh -n dnode4 -i 4
|
||||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
|
system sh/cfg.sh -n dnode1 -c supportVnodes -v 4
|
||||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
|
system sh/cfg.sh -n dnode2 -c supportVnodes -v 4
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/cfg.sh -n dnode3 -c supportVnodes -v 4
|
||||||
|
system sh/cfg.sh -n dnode4 -c supportVnodes -v 4
|
||||||
|
|
||||||
|
print ========== step1
|
||||||
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname port 7200
|
||||||
system sh/exec.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
createDnode:
|
step1:
|
||||||
$x = $x + 1
|
$x = $x + 1
|
||||||
sleep 1000
|
sleep 1000
|
||||||
if $x == 20 then
|
if $x == 10 then
|
||||||
return -1
|
print ====> dnode not ready!
|
||||||
|
return -1
|
||||||
endi
|
endi
|
||||||
sql show dnodes;
|
sql show dnodes
|
||||||
if $data4_2 == offline then
|
print ===> $data00 $data01 $data02 $data03 $data04 $data05
|
||||||
goto createDnode
|
print ===> $data10 $data11 $data12 $data13 $data14 $data15
|
||||||
endi
|
if $rows != 2 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data(1)[4] != ready then
|
||||||
|
goto step1
|
||||||
|
endi
|
||||||
|
if $data(2)[4] != ready then
|
||||||
|
goto step1
|
||||||
|
endi
|
||||||
|
|
||||||
print ======================== dnode1 start
|
print ======================== dnode1 start
|
||||||
|
|
||||||
|
@ -38,7 +50,7 @@ $i = 0
|
||||||
$db = $dbPrefix . $i
|
$db = $dbPrefix . $i
|
||||||
$mt = $mtPrefix . $i
|
$mt = $mtPrefix . $i
|
||||||
|
|
||||||
sql create database $db
|
sql create database $db vgroups 3
|
||||||
sql use $db
|
sql use $db
|
||||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||||
|
|
||||||
|
@ -97,20 +109,20 @@ if $data00 != $rowNum then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step5
|
print =============== step5
|
||||||
sql select count(tbcol) as b from $tb interval(1m)
|
sql select _wstartts, count(tbcol) as b from $tb interval(1m)
|
||||||
print ===> $data01
|
print ===> $data01
|
||||||
if $data01 != 1 then
|
if $data01 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select count(tbcol) as b from $tb interval(1d)
|
sql select _wstartts, count(tbcol) as b from $tb interval(1d)
|
||||||
print ===> $data01
|
print ===> $data01
|
||||||
if $data01 != $rowNum then
|
if $data01 != $rowNum then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step6
|
print =============== step6
|
||||||
sql select count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
|
sql select _wstartts, count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
|
||||||
print ===> $data01
|
print ===> $data01
|
||||||
if $data01 != 1 then
|
if $data01 != 1 then
|
||||||
return -1
|
return -1
|
||||||
|
@ -152,13 +164,13 @@ if $data00 != 25 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step9
|
print =============== step9
|
||||||
sql select count(tbcol) as b from $mt interval(1m)
|
sql select _wstartts, count(tbcol) as b from $mt interval(1m)
|
||||||
print ===> $data01
|
print ===> $data01
|
||||||
if $data01 != 10 then
|
if $data01 != 10 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select count(tbcol) as b from $mt interval(1d)
|
sql select _wstartts, count(tbcol) as b from $mt interval(1d)
|
||||||
print ===> $data01
|
print ===> $data01
|
||||||
if $data01 != 200 then
|
if $data01 != 200 then
|
||||||
return -1
|
return -1
|
||||||
|
@ -175,20 +187,10 @@ if $rows != $tbNum then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step11
|
|
||||||
sql select count(tbcol) as b from $mt where ts <= 1519833840000 interval(1m) group by tgcol
|
|
||||||
print ===> $data01
|
|
||||||
if $data01 != 1 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $rows != 50 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== clear
|
print =============== clear
|
||||||
sql drop database $db
|
sql drop database $db
|
||||||
sql show databases
|
sql show databases
|
||||||
if $rows != 0 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -196,7 +198,4 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
|
@ -1,27 +1,40 @@
|
||||||
system sh/stop_dnodes.sh
|
system sh/stop_dnodes.sh
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/deploy.sh -n dnode2 -i 2
|
system sh/deploy.sh -n dnode2 -i 2
|
||||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
system sh/deploy.sh -n dnode3 -i 3
|
||||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
system sh/deploy.sh -n dnode4 -i 4
|
||||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
|
system sh/cfg.sh -n dnode1 -c supportVnodes -v 4
|
||||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
|
system sh/cfg.sh -n dnode2 -c supportVnodes -v 4
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/cfg.sh -n dnode3 -c supportVnodes -v 4
|
||||||
|
system sh/cfg.sh -n dnode4 -c supportVnodes -v 4
|
||||||
|
|
||||||
|
print ========== step1
|
||||||
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sql create dnode $hostname2
|
|
||||||
|
sql create dnode $hostname port 7200
|
||||||
system sh/exec.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
createDnode:
|
step1:
|
||||||
$x = $x + 1
|
$x = $x + 1
|
||||||
sleep 1000
|
sleep 1000
|
||||||
if $x == 20 then
|
if $x == 10 then
|
||||||
return -1
|
print ====> dnode not ready!
|
||||||
|
return -1
|
||||||
endi
|
endi
|
||||||
sql show dnodes;
|
sql show dnodes
|
||||||
if $data4_2 == offline then
|
print ===> $data00 $data01 $data02 $data03 $data04 $data05
|
||||||
goto createDnode
|
print ===> $data10 $data11 $data12 $data13 $data14 $data15
|
||||||
endi
|
if $rows != 2 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data(1)[4] != ready then
|
||||||
|
goto step1
|
||||||
|
endi
|
||||||
|
if $data(2)[4] != ready then
|
||||||
|
goto step1
|
||||||
|
endi
|
||||||
|
|
||||||
print ======================== dnode1 start
|
print ======================== dnode1 start
|
||||||
|
|
||||||
|
@ -43,7 +56,7 @@ $i = 0
|
||||||
$db = $dbPrefix . $i
|
$db = $dbPrefix . $i
|
||||||
$mt = $mtPrefix . $i
|
$mt = $mtPrefix . $i
|
||||||
|
|
||||||
sql create database $db
|
sql create database $db vgroups 3
|
||||||
sql use $db
|
sql use $db
|
||||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||||
|
|
||||||
|
@ -72,7 +85,6 @@ endi
|
||||||
sleep 100
|
sleep 100
|
||||||
|
|
||||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep 3000
|
|
||||||
|
|
||||||
print =============== step2
|
print =============== step2
|
||||||
sql select count(*) from $mt -x step2
|
sql select count(*) from $mt -x step2
|
||||||
|
@ -84,7 +96,27 @@ sql select count(tbcol) from $mt -x step21
|
||||||
step21:
|
step21:
|
||||||
|
|
||||||
system sh/exec.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 3000
|
|
||||||
|
$x = 0
|
||||||
|
dnode2:
|
||||||
|
$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
|
||||||
|
print ===> $data10 $data11 $data12 $data13 $data14 $data15
|
||||||
|
if $rows != 2 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data(1)[4] != ready then
|
||||||
|
goto dnode2
|
||||||
|
endi
|
||||||
|
if $data(2)[4] != ready then
|
||||||
|
goto dnode2
|
||||||
|
endi
|
||||||
|
|
||||||
print =============== step3
|
print =============== step3
|
||||||
sql select count(tbcol) as c from $mt where ts <= 1519833840000
|
sql select count(tbcol) as c from $mt where ts <= 1519833840000
|
||||||
|
@ -106,13 +138,13 @@ if $data00 != 25 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step4
|
print =============== step4
|
||||||
sql select count(tbcol) as b from $mt interval(1m)
|
sql select _wstartts, count(tbcol) as b from $mt interval(1m)
|
||||||
print ===> $data01
|
print ===> $data01
|
||||||
if $data01 != 10 then
|
if $data01 != 10 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql select count(tbcol) as b from $mt interval(1d)
|
sql select _wstartts, count(tbcol) as b from $mt interval(1d)
|
||||||
print ===> $data01
|
print ===> $data01
|
||||||
if $data01 != 200 then
|
if $data01 != 200 then
|
||||||
return -1
|
return -1
|
||||||
|
@ -129,28 +161,14 @@ if $rows != $tbNum then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step6
|
|
||||||
sql select count(tbcol) as b from $mt where ts <= 1519833840000 interval(1m) group by tgcol
|
|
||||||
print ===> $data01
|
|
||||||
if $data01 != 1 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $rows != 50 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== clear
|
print =============== clear
|
||||||
sql drop database $db
|
sql drop database $db
|
||||||
sql show databases
|
sql show databases
|
||||||
if $rows != 0 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
|
@ -1,218 +0,0 @@
|
||||||
system sh/stop_dnodes.sh
|
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
|
||||||
system sh/deploy.sh -n dnode2 -i 2
|
|
||||||
system sh/deploy.sh -n dnode3 -i 3
|
|
||||||
system sh/deploy.sh -n dnode4 -i 4
|
|
||||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
|
||||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
|
||||||
system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
|
||||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
|
||||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
|
|
||||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
|
|
||||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
|
|
||||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4
|
|
||||||
system sh/exec.sh -n dnode1 -s start
|
|
||||||
|
|
||||||
sql connect
|
|
||||||
|
|
||||||
sql create dnode $hostname2
|
|
||||||
sql create dnode $hostname3
|
|
||||||
sql create dnode $hostname4
|
|
||||||
system sh/exec.sh -n dnode2 -s start
|
|
||||||
system sh/exec.sh -n dnode3 -s start
|
|
||||||
system sh/exec.sh -n dnode4 -s start
|
|
||||||
|
|
||||||
$x = 0
|
|
||||||
createDnode:
|
|
||||||
$x = $x + 1
|
|
||||||
sleep 1000
|
|
||||||
if $x == 20 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
sql show dnodes;
|
|
||||||
if $data4_2 == offline then
|
|
||||||
goto createDnode
|
|
||||||
endi
|
|
||||||
if $data4_3 == offline then
|
|
||||||
goto createDnode
|
|
||||||
endi
|
|
||||||
if $data4_4 == offline then
|
|
||||||
goto createDnode
|
|
||||||
endi
|
|
||||||
|
|
||||||
print ======================== dnode1 start
|
|
||||||
|
|
||||||
$dbPrefix = r2d4_db
|
|
||||||
$tbPrefix = r2d4_tb
|
|
||||||
$mtPrefix = r2d4_mt
|
|
||||||
$tbNum = 10
|
|
||||||
$rowNum = 20
|
|
||||||
$totalNum = 200
|
|
||||||
|
|
||||||
print =============== step1
|
|
||||||
$i = 0
|
|
||||||
$db = $dbPrefix . $i
|
|
||||||
$mt = $mtPrefix . $i
|
|
||||||
|
|
||||||
sql create database $db replica 2
|
|
||||||
sql use $db
|
|
||||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
|
||||||
|
|
||||||
$i = 0
|
|
||||||
while $i < $tbNum
|
|
||||||
$tb = $tbPrefix . $i
|
|
||||||
sql create table $tb using $mt tags( $i )
|
|
||||||
|
|
||||||
$x = 0
|
|
||||||
while $x < $rowNum
|
|
||||||
$val = $x * 60000
|
|
||||||
$ms = 1519833600000 + $val
|
|
||||||
sql insert into $tb values ($ms , $x )
|
|
||||||
$x = $x + 1
|
|
||||||
endw
|
|
||||||
|
|
||||||
$i = $i + 1
|
|
||||||
endw
|
|
||||||
|
|
||||||
sql show vgroups
|
|
||||||
print vgroups ==> $rows
|
|
||||||
if $rows != 3 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
sleep 100
|
|
||||||
|
|
||||||
print =============== step2
|
|
||||||
$i = 1
|
|
||||||
$tb = $tbPrefix . $i
|
|
||||||
|
|
||||||
sql select count(*) from $tb
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != $rowNum then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
sql select count(tbcol) from $tb
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != $rowNum then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step3
|
|
||||||
sql select count(tbcol) from $tb where ts <= 1519833840000
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != 5 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step4
|
|
||||||
sql select count(tbcol) as b from $tb
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != $rowNum then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step5
|
|
||||||
sql select count(tbcol) as b from $tb interval(1m)
|
|
||||||
print ===> $data01
|
|
||||||
if $data01 != 1 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
sql select count(tbcol) as b from $tb interval(1d)
|
|
||||||
print ===> $data01
|
|
||||||
if $data01 != $rowNum then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step6
|
|
||||||
sql select count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
|
|
||||||
print ===> $data01
|
|
||||||
if $data01 != 1 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $rows != 5 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step7
|
|
||||||
sql select count(*) from $mt
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != $totalNum then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
sql select count(tbcol) from $mt
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != $totalNum then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step8
|
|
||||||
sql select count(tbcol) as c from $mt where ts <= 1519833840000
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != 50 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
sql select count(tbcol) as c from $mt where tgcol < 5
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != 100 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
sql select count(tbcol) as c from $mt where tgcol < 5 and ts <= 1519833840000
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != 25 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step9
|
|
||||||
sql select count(tbcol) as b from $mt interval(1m)
|
|
||||||
print ===> $data01
|
|
||||||
if $data01 != 10 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
sql select count(tbcol) as b from $mt interval(1d)
|
|
||||||
print ===> $data01
|
|
||||||
if $data01 != 200 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step10
|
|
||||||
sql select count(tbcol) as b from $mt group by tgcol
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != $rowNum then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
if $rows != $tbNum then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step11
|
|
||||||
sql select count(tbcol) as b from $mt where ts <= 1519833840000 interval(1m) group by tgcol
|
|
||||||
print ===> $data01
|
|
||||||
if $data01 != 1 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $rows != 50 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
return
|
|
||||||
print =============== clear
|
|
||||||
sql drop database $db
|
|
||||||
sql show databases
|
|
||||||
if $rows != 0 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
|
@ -1,199 +0,0 @@
|
||||||
system sh/stop_dnodes.sh
|
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
|
||||||
system sh/deploy.sh -n dnode2 -i 2
|
|
||||||
system sh/cfg.sh -n dnode1 -c walLevel -v 2
|
|
||||||
system sh/cfg.sh -n dnode2 -c walLevel -v 2
|
|
||||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
|
|
||||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
|
|
||||||
system sh/exec.sh -n dnode1 -s start
|
|
||||||
|
|
||||||
sql connect
|
|
||||||
sql create dnode $hostname2
|
|
||||||
system sh/exec.sh -n dnode2 -s start
|
|
||||||
|
|
||||||
$x = 0
|
|
||||||
createDnode:
|
|
||||||
$x = $x + 1
|
|
||||||
sleep 1000
|
|
||||||
if $x == 20 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
sql show dnodes;
|
|
||||||
if $data4_2 == offline then
|
|
||||||
goto createDnode
|
|
||||||
endi
|
|
||||||
|
|
||||||
print ======================== dnode1 start
|
|
||||||
|
|
||||||
$dbPrefix = r2v3_db
|
|
||||||
$tbPrefix = r2v3_tb
|
|
||||||
$mtPrefix = r2v3_mt
|
|
||||||
$tbNum = 10
|
|
||||||
$rowNum = 20
|
|
||||||
$totalNum = 200
|
|
||||||
|
|
||||||
print =============== step1
|
|
||||||
$i = 0
|
|
||||||
$db = $dbPrefix . $i
|
|
||||||
$mt = $mtPrefix . $i
|
|
||||||
|
|
||||||
sql create database $db replica 2
|
|
||||||
sql use $db
|
|
||||||
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
|
||||||
|
|
||||||
$i = 0
|
|
||||||
while $i < $tbNum
|
|
||||||
$tb = $tbPrefix . $i
|
|
||||||
sql create table $tb using $mt tags( $i )
|
|
||||||
|
|
||||||
$x = 0
|
|
||||||
while $x < $rowNum
|
|
||||||
$val = $x * 60000
|
|
||||||
$ms = 1519833600000 + $val
|
|
||||||
sql insert into $tb values ($ms , $x )
|
|
||||||
$x = $x + 1
|
|
||||||
endw
|
|
||||||
|
|
||||||
$i = $i + 1
|
|
||||||
endw
|
|
||||||
|
|
||||||
sql show vgroups
|
|
||||||
print vgroups ==> $rows
|
|
||||||
if $rows != 3 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step2
|
|
||||||
$i = 1
|
|
||||||
$tb = $tbPrefix . $i
|
|
||||||
|
|
||||||
sql select count(*) from $tb
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != $rowNum then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
sql select count(tbcol) from $tb
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != $rowNum then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step3
|
|
||||||
sql select count(tbcol) from $tb where ts <= 1519833840000
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != 5 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step4
|
|
||||||
sql select count(tbcol) as b from $tb
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != $rowNum then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step5
|
|
||||||
sql select count(tbcol) as b from $tb interval(1m)
|
|
||||||
print ===> $data01
|
|
||||||
if $data01 != 1 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
sql select count(tbcol) as b from $tb interval(1d)
|
|
||||||
print ===> $data01
|
|
||||||
if $data01 != $rowNum then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step6
|
|
||||||
sql select count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
|
|
||||||
print ===> $data01
|
|
||||||
if $data01 != 1 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $rows != 5 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step7
|
|
||||||
sql select count(*) from $mt
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != $totalNum then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
sql select count(tbcol) from $mt
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != $totalNum then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step8
|
|
||||||
sql select count(tbcol) as c from $mt where ts <= 1519833840000
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != 50 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
sql select count(tbcol) as c from $mt where tgcol < 5
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != 100 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
sql select count(tbcol) as c from $mt where tgcol < 5 and ts <= 1519833840000
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != 25 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step9
|
|
||||||
sql select count(tbcol) as b from $mt interval(1m)
|
|
||||||
print ===> $data01
|
|
||||||
if $data01 != 10 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
sql select count(tbcol) as b from $mt interval(1d)
|
|
||||||
print ===> $data01
|
|
||||||
if $data01 != 200 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step10
|
|
||||||
sql select count(tbcol) as b from $mt group by tgcol
|
|
||||||
print ===> $data00
|
|
||||||
if $data00 != $rowNum then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
if $rows != $tbNum then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
print =============== step11
|
|
||||||
sql select count(tbcol) as b from $mt where ts <= 1519833840000 interval(1m) group by tgcol
|
|
||||||
print ===> $data01
|
|
||||||
if $data01 != 1 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $rows != 50 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
return
|
|
||||||
print =============== clear
|
|
||||||
sql drop database $db
|
|
||||||
sql show databases
|
|
||||||
if $rows != 0 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
Loading…
Reference in New Issue