test: case for alter db

This commit is contained in:
Shengliang Guan 2022-06-28 09:43:30 +08:00
parent ddf0ff111d
commit a7a5dac1fd
3 changed files with 14 additions and 16 deletions

View File

@ -11,7 +11,7 @@
./test.sh -f tsim/db/create_all_options.sim
./test.sh -f tsim/db/alter_option.sim
./test.sh -f tsim/db/alter_replica_13.sim
#./test.sh -f tsim/db/alter_replica_31.sim
./test.sh -f tsim/db/alter_replica_31.sim
./test.sh -f tsim/db/basic1.sim
./test.sh -f tsim/db/basic2.sim
./test.sh -f tsim/db/basic3.sim
@ -22,7 +22,7 @@
# ---- dnode
./test.sh -f tsim/dnode/balance_replica1.sim
#./test.sh -f tsim/dnode/balance_replica3.sim
./test.sh -f tsim/dnode/balance_replica3.sim
./test.sh -f tsim/dnode/create_dnode.sim
./test.sh -f tsim/dnode/drop_dnode_has_mnode.sim
./test.sh -f tsim/dnode/drop_dnode_has_qnode_snode.sim

View File

@ -89,13 +89,13 @@ step2:
endi
sql show db.vgroups
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08
if $data(2)[3] != 4 then
if $data(2)[3] != 2 then
return -1
endi
if $data(2)[5] != 3 then
return -1
endi
if $data(2)[7] != 2 then
if $data(2)[7] != 4 then
return -1
endi
if $data(2)[4] == leader then
@ -118,7 +118,7 @@ sql insert into db.ctb values(now, 1, "2")
sql show db.vgroups
print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08
sleep 1000
sleep 100
sql select * from db.ctb
print ===> $data00 $data01 $data02 $data03 $data04 $data05
@ -126,10 +126,9 @@ if $rows != 1 then
return -1
endi
sleep 3000
print ============= step3: alter database
sql alter database db replica 1
$hasleader = 0
$x = 0
step3:
@ -144,18 +143,20 @@ print ===> rows: $rows
if $rows != 1 then
goto step3
endi
if $data(2)[3] != 4 then
goto step3
if $data(2)[4] == leader then
$hasleader = 1
endi
if $data(2)[5] != NULL then
goto step3
if $data(2)[6] == leader then
$hasleader = 1
endi
if $data(2)[7] != NULL then
if $data(2)[8] == leader then
$hasleader = 1
endi
if $hasleader != 1 then
goto step3
endi
print ============= step5: stop dnode 2
return
sql select * from db.stb
if $rows != 1 then
return -1

View File

@ -347,10 +347,7 @@ if $leaderExist != 1 then
goto step65
endi
print =============== step7: select data
sql show d1.tables
print rows $rows
if $rows != 6 then