提交 50729272 编写于 作者: S Shengliang Guan

test: case for stable

上级 ad51f506
......@@ -171,12 +171,12 @@
./test.sh -f tsim/vnode/replica3_vgroup.sim
#./test.sh -f tsim/vnode/replica3_many.sim
#./test.sh -f tsim/vnode/replica3_import.sim
#./test.sh -f tsim/vnode/stable_balance_replica1.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
./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
./test.sh -f tsim/sync/3Replica1VgElect.sim
......
......@@ -124,6 +124,8 @@ if $data(5)[3] != 3 then
return -1
endi
#sql reset query cache
print =============== step4: select data
sql show d1.tables
if $rows != 1 then
......
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 statusInterval -v 1
system sh/cfg.sh -n dnode2 -c statusInterval -v 1
system sh/cfg.sh -n dnode1 -c balanceInterval -v 10
system sh/cfg.sh -n dnode2 -c balanceInterval -v 10
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 mnodeEqualVnodeNum -v 0
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 0
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode1 -c supportVnodes -v 4
system sh/cfg.sh -n dnode2 -c supportVnodes -v 4
system sh/cfg.sh -n dnode3 -c supportVnodes -v 4
system sh/cfg.sh -n dnode4 -c supportVnodes -v 4
$dbPrefix = br1_db
$tbPrefix = br1_tb
......@@ -29,7 +25,7 @@ $db = $dbPrefix
$mt = $mtPrefix
$st = $stPrefix . $i
sql create database $db
sql create database $db vgroups 4
sql use $db
sql create table $mt (ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int)
......@@ -54,51 +50,47 @@ endw
sleep 100
print =============== step2
$x = 0
show1:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show dnodes -x show1
$dnode1Vnodes = $data2_1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data2_2
print dnode2 $dnode2Vnodes
if $dnode1Vnodes != 4 then
goto show1
endi
if $dnode2Vnodes != null then
goto show1
sql show dnodes
print dnode1 openVnodes $data(1)[2]
if $data(1)[2] != 4 then
return -1
endi
print =============== step3 start dnode2
sql create dnode $hostname2
sql create dnode $hostname port 7200
system sh/exec.sh -n dnode2 -s start
sleep 8000
$x = 0
show2:
step3:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
sleep 1000
if $x == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes -x show2
$dnode1Vnodes = $data2_1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data2_2
print dnode2 $dnode2Vnodes
if $dnode1Vnodes != 2 then
goto show2
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 $dnode2Vnodes != 2 then
goto show2
if $data(1)[4] != ready then
goto step3
endi
if $data(2)[4] != ready then
goto step3
endi
sql balance vgroup
sql show dnodes
print dnode1 openVnodes $data(1)[2]
print dnode2 openVnodes $data(2)[2]
if $data(1)[2] != 2 then
return -1
endi
if $data(2)[2] != 2 then
return -1
endi
print =============== step4
$i = 1
......
......@@ -2,39 +2,46 @@ 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/cfg.sh -n dnode1 -c walLevel -v 1
system sh/cfg.sh -n dnode2 -c walLevel -v 1
system sh/cfg.sh -n dnode3 -c walLevel -v 1
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/exec.sh -n dnode1 -s start
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode1 -c supportVnodes -v 4
system sh/cfg.sh -n dnode2 -c supportVnodes -v 4
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 create dnode $hostname2
sql create dnode $hostname3
sql create dnode $hostname port 7200
sql create dnode $hostname port 7300
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
$x = 0
createDnode:
step1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
if $x == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes;
if $data4_2 == offline then
goto createDnode
endi
if $data4_3 == offline then
goto createDnode
endi
sql show dnodes
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
if $rows != 3 then
return -1
endi
if $data(1)[4] != ready then
goto step1
endi
if $data(2)[4] != ready then
goto step1
endi
if $data(3)[4] != ready then
goto step1
endi
print ======================== dnode1 start
$dbPrefix = d3_db
$tbPrefix = d3_tb
$mtPrefix = d3_mt
......@@ -47,7 +54,7 @@ $i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql create database $db vgroups 3
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
......@@ -73,26 +80,6 @@ if $rows != 3 then
return -1
endi
sql show dnodes
$dnode1Vnodes = $data2_1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data2_2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data2_3
print dnode3 $dnode3Vnodes
if $dnode1Vnodes != 1 then
return -1
endi
if $dnode2Vnodes != 1 then
return -1
endi
if $dnode3Vnodes != 1 then
return -1
endi
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
......@@ -124,20 +111,20 @@ if $data00 != $rowNum then
endi
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
if $data01 != 1 then
return -1
endi
sql select count(tbcol) as b from $tb interval(1d)
sql select _wstartts, 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)
sql select _wstartts, count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
print ===> $data01
if $data01 != 1 then
return -1
......@@ -179,13 +166,13 @@ if $data00 != 25 then
endi
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
if $data01 != 10 then
return -1
endi
sql select count(tbcol) as b from $mt interval(1d)
sql select _wstartts, count(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 200 then
return -1
......@@ -202,20 +189,10 @@ 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
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi
......@@ -223,7 +200,3 @@ 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
\ No newline at end of file
......@@ -5,29 +5,22 @@ system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode5 -i 5
system sh/deploy.sh -n dnode6 -i 6
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 dnode5 -c walLevel -v 2
system sh/cfg.sh -n dnode6 -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/cfg.sh -n dnode5 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode6 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode1 -c supportVnodes -v 4
system sh/cfg.sh -n dnode2 -c supportVnodes -v 4
system sh/cfg.sh -n dnode3 -c supportVnodes -v 4
system sh/cfg.sh -n dnode4 -c supportVnodes -v 4
system sh/cfg.sh -n dnode5 -c supportVnodes -v 4
system sh/cfg.sh -n dnode6 -c supportVnodes -v 4
print ========== step1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
sql create dnode $hostname3
sql create dnode $hostname4
sql create dnode $hostname5
sql create dnode $hostname6
sql create dnode $hostname port 7200
sql create dnode $hostname port 7300
sql create dnode $hostname port 7400
sql create dnode $hostname port 7500
sql create dnode $hostname port 7600
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
system sh/exec.sh -n dnode4 -s start
......@@ -35,31 +28,41 @@ system sh/exec.sh -n dnode5 -s start
system sh/exec.sh -n dnode6 -s start
$x = 0
createDnode:
step10:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
if $x == 10 then
print ====> dnode not ready!
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
if $data4_5 == offline then
goto createDnode
endi
if $data4_6 == offline then
goto createDnode
endi
sql show dnodes
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print ===> $data20 $data21 $data22 $data23 $data24 $data25
print ===> $data30 $data31 $data32 $data33 $data34 $data35
if $rows != 6 then
return -1
endi
if $data(1)[4] != ready then
goto step10
endi
if $data(2)[4] != ready then
goto step10
endi
if $data(3)[4] != ready then
goto step10
endi
if $data(4)[4] != ready then
goto step10
endi
if $data(5)[4] != ready then
goto step10
endi
if $data(6)[4] != ready then
goto step10
endi
print ======================== dnode1 start
$dbPrefix = r3d6_db
$tbPrefix = r3d6_tb
$mtPrefix = r3d6_mt
......@@ -78,7 +81,7 @@ $i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db replica 3
sql create database $db replica 3 vgroups 3
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
......@@ -137,20 +140,20 @@ if $data00 != $rowNum then
endi
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
if $data01 != 1 then
return -1
endi
sql select count(tbcol) as b from $tb interval(1d)
sql select _wstartts, 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)
sql select _wstartts, count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
print ===> $data01
if $data01 != 1 then
return -1
......@@ -192,13 +195,13 @@ if $data00 != 25 then
endi
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
#if $data01 != 10 then
# return -1
#endi
sql select count(tbcol) as b from $mt interval(1d)
sql select _wstartts, count(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 200 then
return -1
......@@ -215,23 +218,6 @@ 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/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/deploy.sh -n dnode5 -i 5
system sh/deploy.sh -n dnode6 -i 6
system sh/cfg.sh -n dnode1 -c supportVnodes -v 4
system sh/cfg.sh -n dnode2 -c supportVnodes -v 4
system sh/cfg.sh -n dnode3 -c supportVnodes -v 4
system sh/cfg.sh -n dnode4 -c supportVnodes -v 4
system sh/cfg.sh -n dnode5 -c supportVnodes -v 4
system sh/cfg.sh -n dnode6 -c supportVnodes -v 4
print ========== step1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
sql create dnode $hostname3
sql create dnode $hostname4
sql create dnode $hostname port 7200
sql create dnode $hostname port 7300
sql create dnode $hostname port 7400
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:
step10:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
if $x == 10 then
print ====> dnode not ready!
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
sql show dnodes
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print ===> $data20 $data21 $data22 $data23 $data24 $data25
print ===> $data30 $data31 $data32 $data33 $data34 $data35
if $rows != 4 then
return -1
endi
if $data(1)[4] != ready then
goto step10
endi
if $data(2)[4] != ready then
goto step10
endi
if $data(3)[4] != ready then
goto step10
endi
if $data(4)[4] != ready then
goto step10
endi
print ======================== dnode1 start
$dbPrefix = r3v3_db
$tbPrefix = r3v3_tb
$mtPrefix = r3v3_mt
......@@ -54,7 +65,7 @@ $i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db replica 3
sql create database $db replica 3 vgroups 3
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
......@@ -113,20 +124,20 @@ if $data00 != $rowNum then
endi
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
if $data01 != 1 then
return -1
endi
sql select count(tbcol) as b from $tb interval(1d)
sql select _wstartts, 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)
sql select _wstartts, count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
print ===> $data01
if $data01 != 1 then
return -1
......@@ -169,13 +180,13 @@ if $data00 != 25 then
endi
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
if $data01 != 10 then
return -1
endi
sql select count(tbcol) as b from $mt interval(1d)
sql select _wstartts, count(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 200 then
return -1
......@@ -192,23 +203,6 @@ 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
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册