add test cases
This commit is contained in:
parent
c3e222bfe2
commit
68f45ebef7
|
@ -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+2s, 2)
|
||||||
sql insert into c1 values(now+3s, 3)
|
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
|
print =============== query data
|
||||||
sql select * from c1
|
sql select * from c1
|
||||||
if $rows != 3 then
|
if $rows != 3 then
|
||||||
|
|
|
@ -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
|
|
Loading…
Reference in New Issue