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

test: case for mnode

上级 1e8942e6
......@@ -88,7 +88,7 @@ sql_error drop mnode on dnode 4
sql_error drop mnode on dnode 5
sql_error drop mnode on dnode 6
system sh/exec.sh -n dnode2 -s stop
system sh/exec.sh -n dnode2 -s stop -x SIGKILL
$x = 0
step5:
$x = $x + 1
......@@ -97,12 +97,252 @@ step5:
return -1
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 $data(1)[4] != ready then
goto step5
endi
if $data(2)[4] != offline then
goto step5
endi
if $data(3)[4] != ready then
goto step5
endi
if $data(4)[4] != ready then
goto step5
endi
sql_error drop mnode on dnode 2
system sh/exec.sh -n dnode2 -s start
$x = 0
step51:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
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 $data(1)[4] != ready then
goto step51
endi
if $data(2)[4] != ready then
goto step51
endi
if $data(3)[4] != ready then
goto step51
endi
if $data(4)[4] != ready then
goto step51
endi
print =============== step6: stop mnode1
system sh/exec.sh -n dnode1 -s stop -x SIGKILL
sql_error drop mnode on dnode 1
$x = 0
step61:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print ===> $data20 $data21 $data22 $data23 $data24 $data25
$leaderNum = 0
if $data(2)[2] == leader then
$leaderNum = 1
endi
if $data(3)[2] == leader then
$leaderNum = 1
endi
if $leaderNum != 1 then
goto step61
endi
print =============== step7: start mnode1 and wait it online
system sh/exec.sh -n dnode1 -s start
$x = 0
step71:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
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 $data(1)[4] != ready then
goto step71
endi
if $data(2)[4] != ready then
goto step71
endi
if $data(3)[4] != ready then
goto step71
endi
if $data(4)[4] != ready then
goto step71
endi
print =============== step8: stop mnode1 and drop it
system sh/exec.sh -n dnode1 -s stop -x SIGKILL
sql_error drop mnode on dnode 1
$x = 0
step81:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print ===> $data20 $data21 $data22 $data23 $data24 $data25
$leaderNum = 0
if $data(1)[2] == leader then
$leaderNum = 1
endi
if $data(2)[2] == leader then
$leaderNum = 1
endi
if $data(3)[2] == leader then
$leaderNum = 1
endi
if $leaderNum != 1 then
goto step81
endi
if $data(1)[3] != dropping then
goto step81
endi
print =============== step9: start mnode1 and wait it dropped
system sh/exec.sh -n dnode1 -s start
$x = 0
step91:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
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 $data(1)[4] != ready then
goto step91
endi
if $data(2)[4] != ready then
goto step91
endi
if $data(3)[4] != ready then
goto step91
endi
if $data(4)[4] != ready then
goto step91
endi
$x = 0
step92:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print ===> $data20 $data21 $data22 $data23 $data24 $data25
$leaderNum = 0
if $data(1)[2] == leader then
$leaderNum = 1
endi
if $data(2)[2] == leader then
$leaderNum = 1
endi
if $data(3)[2] == leader then
$leaderNum = 1
endi
if $leaderNum != 1 then
goto step92
endi
if $rows != 2 then
goto step92
endi
print =============== stepa: create mnode1 again
sql create mnode on dnode 1
$x = 0
stepa:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print ===> $data20 $data21 $data22 $data23 $data24 $data25
$leaderNum = 0
if $data(2)[2] == leader then
$leaderNum = 1
endi
if $data(3)[2] == leader then
$leaderNum = 1
endi
if $data(3)[2] == leader then
$leaderNum = 1
endi
if $leaderNum == 0 then
goto stepa
endi
if $leaderNum != 1 then
return -1
endi
$x = 0
stepb:
$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
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 stepb
endi
if $data(2)[4] != ready then
goto stepb
endi
if $data(3)[4] != ready then
goto stepb
endi
if $data(4)[4] != ready then
goto stepb
endi
system sh/exec.sh -n dnode1 -s stop
system sh/exec.sh -n dnode2 -s stop
system sh/exec.sh -n dnode3 -s stop
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册