diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index de148390a6ce1e82e6ac3a72f9a0710858649991..bffed86d7529ee6f2f93856a10a3a77c3a2e8b74 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -350,7 +350,6 @@ ./test.sh -f tsim/sync/3Replica5VgElect.sim ./test.sh -f tsim/sync/oneReplica1VgElect.sim ./test.sh -f tsim/sync/oneReplica5VgElect.sim -# ./test.sh -f tsim/sync/3Replica5VgElect3mnode.sim # --- catalog ./test.sh -f tsim/catalog/alterInCurrent.sim @@ -433,12 +432,6 @@ # ---- wal ./test.sh -f tsim/wal/kill.sim -# ---- issue -#./test.sh -f tsim/issue/TD-2677.sim -#./test.sh -f tsim/issue/TD-2680.sim -#./test.sh -f tsim/issue/TD-2713.sim -#./test.sh -f tsim/issue/TD-3300.sim - # ---- tag ./test.sh -f tsim/tag/3.sim ./test.sh -f tsim/tag/4.sim @@ -451,18 +444,18 @@ ./test.sh -f tsim/tag/bool_binary.sim ./test.sh -f tsim/tag/bool_int.sim ./test.sh -f tsim/tag/bool.sim -#./test.sh -f tsim/tag/change.sim -#./test.sh -f tsim/tag/column.sim -#./test.sh -f tsim/tag/commit.sim -#./test.sh -f tsim/tag/create.sim -#./test.sh -f tsim/tag/delete.sim +# ./test.sh -f tsim/tag/change.sim +# ./test.sh -f tsim/tag/column.sim +# ./test.sh -f tsim/tag/commit.sim +# ./test.sh -f tsim/tag/create.sim +# ./test.sh -f tsim/tag/delete.sim # jira ./test.sh -f tsim/tag/double.sim -#./test.sh -f tsim/tag/filter.sim +# ./test.sh -f tsim/tag/filter.sim # jira ./test.sh -f tsim/tag/float.sim ./test.sh -f tsim/tag/int_binary.sim ./test.sh -f tsim/tag/int_float.sim ./test.sh -f tsim/tag/int.sim -#./test.sh -f tsim/tag/set.sim +# ./test.sh -f tsim/tag/set.sim ./test.sh -f tsim/tag/smallint.sim ./test.sh -f tsim/tag/tinyint.sim diff --git a/tests/script/tsim/issue/TD-2677.sim b/tests/script/tsim/issue/TD-2677.sim deleted file mode 100644 index 8d2058a3851e456dd85f8d6a295ce45b7a6fd3bd..0000000000000000000000000000000000000000 --- a/tests/script/tsim/issue/TD-2677.sim +++ /dev/null @@ -1,111 +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/cfg.sh -n dnode1 -c numOfMnodes -v 3 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 - -print ============== deploy - -system sh/exec.sh -n dnode1 -s start -sql connect - -sql create dnode $hostname2 -sql create dnode $hostname3 -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start - -print =============== step1 -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 - -if $data4_1 != ready then - goto step1 -endi -if $data4_2 != ready then - goto step1 -endi -if $data4_3 != ready then - goto step1 -endi - -sql show mnodes -$mnode1Role = $data2_1 -print mnode1Role $mnode1Role -$mnode2Role = $data2_2 -print mnode2Role $mnode2Role -$mnode3Role = $data2_3 -print mnode3Role $mnode3Role - -if $mnode1Role != master then - goto step1 -endi -if $mnode2Role != slave then - goto step1 -endi -if $mnode3Role != slave then - goto step1 -endi - -$x = 1 -show2: - -print =============== step1 -sql create database d1 replica 2 quorum 2 -sql create table d1.t1 (ts timestamp, i int) -sql_error create table d1.t1 (ts timestamp, i int) -sql insert into d1.t1 values(now, 1) -sql select * from d1.t1; -if $rows != 1 then - return -1 -endi - -print =============== step2 -sql create database d2 replica 3 quorum 2 -sql create table d2.t1 (ts timestamp, i int) -sql_error create table d2.t1 (ts timestamp, i int) -sql insert into d2.t1 values(now, 1) -sql select * from d2.t1; -if $rows != 1 then - return -1 -endi - -print =============== step3 -sql create database d4 replica 1 quorum 1 -sql_error create database d5 replica 1 quorum 2 -sql_error create database d6 replica 1 quorum 3 -sql_error create database d7 replica 1 quorum 4 -sql_error create database d8 replica 1 quorum 0 -sql create database d9 replica 2 quorum 1 -sql create database d10 replica 2 quorum 2 -sql_error create database d11 replica 2 quorum 3 -sql_error create database d12 replica 2 quorum 4 -sql_error create database d12 replica 2 quorum 0 -sql create database d13 replica 3 quorum 1 -sql create database d14 replica 3 quorum 2 -sql_error create database d15 replica 3 quorum 3 -sql_error create database d16 replica 3 quorum 4 -sql_error create database d17 replica 3 quorum 0 - - -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 diff --git a/tests/script/tsim/issue/TD-2680.sim b/tests/script/tsim/issue/TD-2680.sim deleted file mode 100644 index 631332160fe1ede876ef2b966dfb1963ac7351ca..0000000000000000000000000000000000000000 --- a/tests/script/tsim/issue/TD-2680.sim +++ /dev/null @@ -1,202 +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 numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -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 balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0 -system sh/exec_tarbitrator.sh -s start - -print ============== step1 -system sh/exec.sh -n dnode1 -s start -sql connect -sql create dnode $hostname2 -sql create dnode $hostname3 -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start - -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 - -if $data4_1 != ready then - goto step1 -endi -if $data4_2 != ready then - goto step1 -endi -if $data4_3 != ready then - goto step1 -endi - -sql show mnodes -print mnode1 $data2_1 -print mnode1 $data2_2 -print mnode1 $data2_3 -if $data2_1 != master then - goto step1 -endi - -print ============== step2 -sql show dnodes -if $rows != 4 then - return -1 -endi - -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 -print $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 -print $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 -print $data30 $data31 $data32 $data33 $data34 $data35 $data36 $data37 - -if $data30 != 0 then - return -1 -endi - -if $data32 != 0 then - return -1 -endi - -if $data33 != 0 then - return -1 -endi - -if $data34 != ready then - return -1 -endi - -if $data35 != arb then - return -1 -endi - -if $data37 != - then - return -1 -endi - -print ============== step4 -system sh/exec_tarbitrator.sh -s stop - -$x = 0 -step4: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show dnodes -if $rows != 4 then - return -1 -endi - -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 -print $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 -print $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 -print $data30 $data31 $data32 $data33 $data34 $data35 $data36 $data37 - -if $data30 != 0 then - return -1 -endi - -if $data32 != 0 then - return -1 -endi - -if $data33 != 0 then - return -1 -endi - -if $data34 != offline then - goto step4 -endi - -if $data35 != arb then - return -1 -endi - -if $data37 != - then - return -1 -endi - -print ============== step5 -system sh/exec_tarbitrator.sh -s start - -$x = 0 -step5: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show dnodes -if $rows != 4 then - return -1 -endi - -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 -print $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data17 -print $data20 $data21 $data22 $data23 $data24 $data25 $data26 $data27 -print $data30 $data31 $data32 $data33 $data34 $data35 $data36 $data37 - -if $data30 != 0 then - return -1 -endi - -if $data32 != 0 then - return -1 -endi - -if $data33 != 0 then - return -1 -endi - -if $data34 != ready then - goto step5 -endi - -if $data35 != arb then - return -1 -endi - -if $data37 != - 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 diff --git a/tests/script/tsim/issue/TD-2713.sim b/tests/script/tsim/issue/TD-2713.sim deleted file mode 100644 index b66c55b9b95f67eb2478791e8ee45ffd503b12be..0000000000000000000000000000000000000000 --- a/tests/script/tsim/issue/TD-2713.sim +++ /dev/null @@ -1,145 +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 numOfMnodes -v 3 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 3 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 - -system sh/cfg.sh -n dnode1 -c slaveQuery -v 1 -system sh/cfg.sh -n dnode2 -c slaveQuery -v 1 -system sh/cfg.sh -n dnode3 -c slaveQuery -v 1 -system sh/cfg.sh -n dnode4 -c slaveQuery -v 1 - -print ========= step1 -system sh/exec.sh -n dnode1 -s start -sql connect -sql create dnode $hostname2 -sql create dnode $hostname3 -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start - -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 - -if $data4_1 != ready then - goto step1 -endi -if $data4_2 != ready then - goto step1 -endi -if $data4_3 != ready then - goto step1 -endi - -sql show mnodes -print mnode1 $data2_1 -print mnode1 $data2_2 -print mnode1 $data2_3 -if $data2_1 != master then - goto step1 -endi -if $data2_2 != slave then - goto step1 -endi -if $data2_3 != slave then - goto step1 -endi - -print ========= step2 -sql create database d1 replica 3 -sql create table d1.t1 (ts timestamp, i int) -sql insert into d1.t1 values(now, 1) - -$x = 0 -step2: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show d1.vgroups -print online vgroups: $data03 -if $data03 != 3 then - goto step2 -endi -sleep 1000 - -print ========= step3 -$i = 0 -while $i < 100 - $i = $i + 1 - sql select * from d1.t1 - print d1.t1 rows: $rows - if $rows != 1 then - return -1 - endi -endw - -print ========= step4 -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 rm -rf ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/* -system rm -rf ../../../sim/dnode3/data/vnode/vnode2/version.json - -system sh/exec.sh -n dnode1 -s start -x SIGINT -system sh/exec.sh -n dnode2 -s start -x SIGINT -system sh/exec.sh -n dnode3 -s start -x SIGINT - -$x = 0 -step4: - $x = $x + 1 - sleep 1000 - if $x == 30 then - return -1 - endi - -sql show d1.vgroups -print online vgroups: $data03 -if $data03 != 3 then - goto step4 -endi -sleep 1000 - -print ========= step5 -$i = 0 -while $i < 100 - $i = $i + 1 - sql select * from d1.t1 - if $rows != 1 then - return -1 - endi - print d1.t1 rows: $rows -endw - -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 diff --git a/tests/script/tsim/issue/TD-3300.sim b/tests/script/tsim/issue/TD-3300.sim deleted file mode 100644 index 0745ceb8490567b508397b3e99d4748dc41c8971..0000000000000000000000000000000000000000 --- a/tests/script/tsim/issue/TD-3300.sim +++ /dev/null @@ -1,556 +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 numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 -system sh/cfg.sh -n dnode4 -c role -v 2 - -system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator -system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator - -print ============== step0: start tarbitrator -system sh/exec_tarbitrator.sh -s start - -print ============== step1: start dnode1, only deploy mnode -system sh/exec.sh -n dnode1 -s start -sql connect - -print ============== step2: start dnode2/dnode3 -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 - -$x = 0 -step2: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 - -if $data4_1 != ready then - goto step2 -endi -if $data4_2 != ready then - goto step2 -endi -if $data4_3 != ready then - goto step2 -endi - -sleep 1000 - -print ============== step3 -sql create database db replica 2 -sql use db - -sql create table stb (ts timestamp, c1 int, c2 int) tags(t1 int) -sql create table t1 using stb tags(1) -sql insert into t1 values(1577980800000, 1, 5) -sql insert into t1 values(1577980800001, 2, 4) -sql insert into t1 values(1577980800002, 3, 3) -sql insert into t1 values(1577980800003, 4, 2) -sql insert into t1 values(1577980800004, 5, 1) - -sql show db.vgroups -if $data04 != 3 then - return -1 -endi -if $data06 != 2 then - return -1 -endi -if $data05 != master then - return -1 -endi -if $data07 != slave then - return -1 -endi - -sql select * from t1 -if $rows != 5 then - return -1 -endi - -system sh/exec.sh -n dnode2 -s stop -x SIGKILL -system sh/exec.sh -n dnode3 -s stop -x SIGKILL - -print ============== step4 -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start - -$x = 0 -step4: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 - -if $data4_1 != ready then - goto step4 -endi -if $data4_2 != ready then - goto step4 -endi -if $data4_3 != ready then - goto step4 -endi - -sql show db.vgroups -if $data04 != 3 then - goto step4 -endi -if $data06 != 2 then - goto step4 -endi -if $data05 != master then - goto step4 -endi -if $data07 != slave then - goto step4 -endi - -sql create table t2 using stb tags(1) -sql insert into t2 values(1577980800000, 1, 5) -sql insert into t2 values(1577980800001, 2, 4) -sql insert into t2 values(1577980800002, 3, 3) -sql insert into t2 values(1577980800003, 4, 2) -sql insert into t2 values(1577980800004, 5, 1) - -sql select * from t2 -if $rows != 5 then - return -1 -endi - -print ============== step5 -system sh/exec.sh -n dnode3 -s stop -x SIGKILL - -$x = 0 -step5: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 - -if $data4_1 != ready then - goto step5 -endi -if $data4_2 != ready then - goto step5 -endi -if $data4_3 != offline then - goto step5 -endi - -sql select * from t1 -if $rows != 5 then - return -1 -endi -sql select * from t2 -if $rows != 5 then - return -1 -endi - -sql show db.vgroups -if $data04 != 3 then - goto step5 -endi -if $data06 != 2 then - goto step5 -endi -if $data05 != offline then - goto step5 -endi -if $data07 != master then - goto step5 -endi - -print ============== step6 -sql create table t3 using stb tags(1) -sql insert into t3 values(1577980800000, 1, 5) -sql insert into t3 values(1577980800001, 2, 4) -sql insert into t3 values(1577980800002, 3, 3) -sql insert into t3 values(1577980800003, 4, 2) -sql insert into t3 values(1577980800004, 5, 1) -sql insert into t3 values(1577980800010, 11, 5) -sql insert into t3 values(1577980800011, 12, 4) -sql insert into t3 values(1577980800012, 13, 3) -sql insert into t3 values(1577980800013, 14, 2) -sql insert into t3 values(1577980800014, 15, 1) - -sql select * from t1 -if $rows != 5 then - return -1 -endi -sql select * from t2 -if $rows != 5 then - return -1 -endi -sql select * from t3 -if $rows != 10 then - return -1 -endi - -system sh/exec.sh -n dnode3 -s start - -$x = 0 -step6: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 - -if $data4_1 != ready then - goto step6 -endi -if $data4_2 != ready then - goto step6 -endi -if $data4_3 != ready then - goto step6 -endi - -sql show db.vgroups -if $data04 != 3 then - goto step6 -endi -if $data06 != 2 then - goto step6 -endi -if $data05 != slave then - goto step6 -endi -if $data07 != master then - goto step6 -endi - -sql select * from t1 -if $rows != 5 then - return -1 -endi -sql select * from t2 -if $rows != 5 then - return -1 -endi -sql select * from t3 -if $rows != 10 then - return -1 -endi - -print ============== step7 -sql create table t4 using stb tags(1) -sql insert into t4 values(1577980800000, 1, 5) -sql insert into t4 values(1577980800001, 2, 4) -sql insert into t4 values(1577980800002, 3, 3) -sql insert into t4 values(1577980800003, 4, 2) -sql insert into t4 values(1577980800004, 5, 1) -sql insert into t4 values(1577980800010, 11, 5) -sql insert into t4 values(1577980800011, 12, 4) -sql insert into t4 values(1577980800012, 13, 3) -sql insert into t4 values(1577980800013, 14, 2) -sql insert into t4 values(1577980800014, 15, 1) -sql insert into t4 values(1577980800020, 21, 5) -sql insert into t4 values(1577980800021, 22, 4) -sql insert into t4 values(1577980800022, 23, 3) -sql insert into t4 values(1577980800023, 24, 2) -sql insert into t4 values(1577980800024, 25, 1) - -sql select * from t1 -if $rows != 5 then - return -1 -endi -sql select * from t2 -if $rows != 5 then - return -1 -endi -sql select * from t3 -if $rows != 10 then - return -1 -endi -sql select * from t4 -if $rows != 15 then - return -1 -endi - -system sh/exec.sh -n dnode2 -s stop -x SIGKILL -$x = 0 -step7: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 - -if $data4_1 != ready then - goto step7 -endi -if $data4_2 != offline then - goto step7 -endi -if $data4_3 != ready then - goto step7 -endi - -sql show db.vgroups -if $data04 != 3 then - goto step7 -endi -if $data06 != 2 then - goto step7 -endi -if $data05 != master then - goto step7 -endi -if $data07 != offline then - goto step7 -endi - -sql select * from t1 -if $rows != 5 then - return -1 -endi -sql select * from t2 -if $rows != 5 then - return -1 -endi -sql select * from t3 -if $rows != 10 then - return -1 -endi -sql select * from t4 -if $rows != 15 then - return -1 -endi - -print ============== step8 -sql create table t5 using stb tags(1) -sql insert into t5 values(1577980800000, 1, 5) -sql insert into t5 values(1577980800001, 2, 4) -sql insert into t5 values(1577980800002, 3, 3) -sql insert into t5 values(1577980800003, 4, 2) -sql insert into t5 values(1577980800004, 5, 1) -sql insert into t5 values(1577980800010, 11, 5) - -sql select * from t1 -if $rows != 5 then - return -1 -endi -sql select * from t2 -if $rows != 5 then - return -1 -endi -sql select * from t3 -if $rows != 10 then - return -1 -endi -sql select * from t4 -if $rows != 15 then - return -1 -endi -sql select * from t5 -if $rows != 6 then - return -1 -endi - -system sh/exec.sh -n dnode2 -s start -$x = 0 -step8: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 - -if $data4_1 != ready then - goto step8 -endi -if $data4_2 != ready then - goto step8 -endi -if $data4_3 != ready then - goto step8 -endi - -sql show db.vgroups -if $data04 != 3 then - goto step8 -endi -if $data06 != 2 then - goto step8 -endi -if $data05 != master then - goto step8 -endi -if $data07 != slave then - goto step8 -endi - -sql select * from t1 -if $rows != 5 then - return -1 -endi -sql select * from t2 -if $rows != 5 then - return -1 -endi -sql select * from t3 -if $rows != 10 then - return -1 -endi -sql select * from t4 -if $rows != 15 then - return -1 -endi -sql select * from t5 -if $rows != 6 then - return -1 -endi - -print ============== step9 -sql create table t6 using stb tags(1) -sql insert into t6 values(1577980800000, 1, 5) -sql insert into t6 values(1577980800001, 2, 4) -sql insert into t6 values(1577980800002, 3, 3) -sql insert into t6 values(1577980800003, 4, 2) -sql insert into t6 values(1577980800004, 5, 1) -sql insert into t6 values(1577980800010, 11, 5) -sql insert into t6 values(1577980800011, 12, 4) - -sql select * from t1 -if $rows != 5 then - return -1 -endi -sql select * from t2 -if $rows != 5 then - return -1 -endi -sql select * from t3 -if $rows != 10 then - return -1 -endi -sql select * from t4 -if $rows != 15 then - return -1 -endi -sql select * from t5 -if $rows != 6 then - return -1 -endi -sql select * from t6 -if $rows != 7 then - return -1 -endi - -system sh/exec.sh -n dnode3 -s stop -x SIGKILL -$x = 0 -step9: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 - -if $data4_1 != ready then - goto step9 -endi -if $data4_2 != ready then - goto step9 -endi -if $data4_3 != offline then - goto step9 -endi - -print ============== 2 -sql show db.vgroups - -if $data04 != 3 then - goto step7 -endi -if $data06 != 2 then - goto step7 -endi -if $data05 != offline then - goto step7 -endi -if $data07 != master then - goto step7 -endi - -print ============== 3 -sql select * from t1 -if $rows != 5 then - return -1 -endi -sql select * from t2 -if $rows != 5 then - return -1 -endi -sql select * from t3 -if $rows != 10 then - return -1 -endi -sql select * from t4 -if $rows != 15 then - return -1 -endi -sql select * from t5 -if $rows != 6 then - return -1 -endi -sql select * from t6 -if $rows != 7 then - return -1 -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 diff --git a/tests/script/tsim/sync/3Replica1VgElect.sim b/tests/script/tsim/sync/3Replica1VgElect.sim index 6649b9c335aa11cd16b03b4356b04ab8579f6e6d..a451b1cba2989f5d513f5bbe2eefb37b008ca28d 100644 --- a/tests/script/tsim/sync/3Replica1VgElect.sim +++ b/tests/script/tsim/sync/3Replica1VgElect.sim @@ -11,55 +11,38 @@ system sh/exec.sh -n dnode2 -s start system sh/exec.sh -n dnode3 -s start system sh/exec.sh -n dnode4 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][0] != 1 then - return -1 -endi -if $data[0][4] != ready then - goto check_dnode_ready -endi - sql connect sql create dnode $hostname port 7200 sql create dnode $hostname port 7300 sql create dnode $hostname port 7400 -$loop_cnt = 0 -check_dnode_ready_1: -$loop_cnt = $loop_cnt + 1 -sleep 200 -if $loop_cnt == 10 then - print ====> dnodes not ready! - return -1 -endi +$x = 0 +step1: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][4] != ready then - goto check_dnode_ready_1 +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 check_dnode_ready_1 +if $data(1)[4] != ready then + goto step1 endi -if $data[2][4] != ready then - goto check_dnode_ready_1 +if $data(2)[4] != ready then + goto step1 endi -if $data[3][4] != ready then - goto check_dnode_ready_1 +if $data(3)[4] != ready then + goto step1 +endi +if $data(4)[4] != ready then + goto step1 endi $replica = 3 diff --git a/tests/script/tsim/sync/3Replica5VgElect.sim b/tests/script/tsim/sync/3Replica5VgElect.sim index d96ad1655d995e63a4e13316e1cec4a586a5992a..aec5666e6c9ec97a8c82fd081e082fa8e1d7f0ec 100644 --- a/tests/script/tsim/sync/3Replica5VgElect.sim +++ b/tests/script/tsim/sync/3Replica5VgElect.sim @@ -11,55 +11,38 @@ system sh/exec.sh -n dnode2 -s start system sh/exec.sh -n dnode3 -s start system sh/exec.sh -n dnode4 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][0] != 1 then - return -1 -endi -if $data[0][4] != ready then - goto check_dnode_ready -endi - sql connect sql create dnode $hostname port 7200 sql create dnode $hostname port 7300 sql create dnode $hostname port 7400 -$loop_cnt = 0 -check_dnode_ready_1: -$loop_cnt = $loop_cnt + 1 -sleep 200 -if $loop_cnt == 10 then - print ====> dnodes not ready! - return -1 -endi +$x = 0 +step1: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][4] != ready then - goto check_dnode_ready_1 +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 check_dnode_ready_1 +if $data(1)[4] != ready then + goto step1 endi -if $data[2][4] != ready then - goto check_dnode_ready_1 +if $data(2)[4] != ready then + goto step1 endi -if $data[3][4] != ready then - goto check_dnode_ready_1 +if $data(3)[4] != ready then + goto step1 +endi +if $data(4)[4] != ready then + goto step1 endi $replica = 3 diff --git a/tests/script/tsim/sync/3Replica5VgElect3mnode.sim b/tests/script/tsim/sync/3Replica5VgElect3mnode.sim index 8df2c2007da9fdb9e940d9a26995fe49dc4da22b..8a69d5ca07f8627d4dcf3bdccba387ec8cac6226 100644 --- a/tests/script/tsim/sync/3Replica5VgElect3mnode.sim +++ b/tests/script/tsim/sync/3Replica5VgElect3mnode.sim @@ -3,66 +3,44 @@ 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 supportVnodes -v 0 - system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode2 -s start system sh/exec.sh -n dnode3 -s start system sh/exec.sh -n dnode4 -s start -### create clusters using four dnodes; - - -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> 1-dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][0] != 1 then - return -1 -endi -if $data[0][4] != ready then - goto check_dnode_ready -endi - sql connect sql create dnode $hostname port 7200 sql create dnode $hostname port 7300 sql create dnode $hostname port 7400 -$loop_cnt = 0 -check_dnode_ready_1: -$loop_cnt = $loop_cnt + 1 -sleep 200 -if $loop_cnt == 10 then - print ====> dnodes not ready! - return -1 -endi +$x = 0 +step1: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][4] != ready then - goto check_dnode_ready_1 +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 check_dnode_ready_1 +if $data(1)[4] != ready then + goto step1 endi -if $data[2][4] != ready then - goto check_dnode_ready_1 +if $data(2)[4] != ready then + goto step1 endi -if $data[3][4] != ready then - goto check_dnode_ready_1 +if $data(3)[4] != ready then + goto step1 +endi +if $data(4)[4] != ready then + goto step1 endi $replica = 3 diff --git a/tests/script/tsim/sync/3Replica5VgElect3mnodedrop.sim b/tests/script/tsim/sync/3Replica5VgElect3mnodedrop.sim index ae02a23c9b47d57239dc89ab71337c27f39e572e..d84679add1b63f034c51c4f52ad645fcf2140834 100644 --- a/tests/script/tsim/sync/3Replica5VgElect3mnodedrop.sim +++ b/tests/script/tsim/sync/3Replica5VgElect3mnodedrop.sim @@ -11,57 +11,38 @@ system sh/exec.sh -n dnode2 -s start system sh/exec.sh -n dnode3 -s start system sh/exec.sh -n dnode4 -s start -print ===> create clusters using four dnodes; - -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> 1-dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][0] != 1 then - return -1 -endi -if $data[0][4] != ready then - goto check_dnode_ready -endi - sql connect sql create dnode $hostname port 7200 sql create dnode $hostname port 7300 sql create dnode $hostname port 7400 -$loop_cnt = 0 -check_dnode_ready_1: -$loop_cnt = $loop_cnt + 1 -sleep 200 -if $loop_cnt == 10 then - print ====> dnodes not ready! - return -1 -endi +$x = 0 +step1: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][4] != ready then - goto check_dnode_ready_1 +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 step1 endi -if $data[1][4] != ready then - goto check_dnode_ready_1 +if $data(2)[4] != ready then + goto step1 endi -if $data[2][4] != ready then - goto check_dnode_ready_1 +if $data(3)[4] != ready then + goto step1 endi -if $data[3][4] != ready then - goto check_dnode_ready_1 +if $data(4)[4] != ready then + goto step1 endi $replica = 3 diff --git a/tests/script/tsim/sync/electTest.sim b/tests/script/tsim/sync/electTest.sim index 5433434014183cfeeb9c9e20e80603504a982a2a..750ab9d63a1d20d05951aa5b9b8b6c06368d1b57 100644 --- a/tests/script/tsim/sync/electTest.sim +++ b/tests/script/tsim/sync/electTest.sim @@ -11,55 +11,38 @@ system sh/exec.sh -n dnode2 -s start system sh/exec.sh -n dnode3 -s start system sh/exec.sh -n dnode4 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][0] != 1 then - return -1 -endi -if $data[0][4] != ready then - goto check_dnode_ready -endi - sql connect sql create dnode $hostname port 7200 sql create dnode $hostname port 7300 sql create dnode $hostname port 7400 -$loop_cnt = 0 -check_dnode_ready_1: -$loop_cnt = $loop_cnt + 1 -sleep 200 -if $loop_cnt == 10 then - print ====> dnodes not ready! - return -1 -endi +$x = 0 +step1: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][4] != ready then - goto check_dnode_ready_1 +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 step1 endi -if $data[1][4] != ready then - goto check_dnode_ready_1 +if $data(2)[4] != ready then + goto step1 endi -if $data[2][4] != ready then - goto check_dnode_ready_1 +if $data(3)[4] != ready then + goto step1 endi -if $data[3][4] != ready then - goto check_dnode_ready_1 +if $data(4)[4] != ready then + goto step1 endi $replica = 3 diff --git a/tests/script/tsim/sync/oneReplica1VgElect.sim b/tests/script/tsim/sync/oneReplica1VgElect.sim index cf8912e654c04314e96a5fb4a718a3569ddea5f5..829cf029b4de358d027fc8150658d9b84429b019 100644 --- a/tests/script/tsim/sync/oneReplica1VgElect.sim +++ b/tests/script/tsim/sync/oneReplica1VgElect.sim @@ -11,55 +11,38 @@ system sh/exec.sh -n dnode2 -s start system sh/exec.sh -n dnode3 -s start system sh/exec.sh -n dnode4 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][0] != 1 then - return -1 -endi -if $data[0][4] != ready then - goto check_dnode_ready -endi - sql connect sql create dnode $hostname port 7200 sql create dnode $hostname port 7300 sql create dnode $hostname port 7400 -$loop_cnt = 0 -check_dnode_ready_1: -$loop_cnt = $loop_cnt + 1 -sleep 200 -if $loop_cnt == 10 then - print ====> dnodes not ready! - return -1 -endi +$x = 0 +step1: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][4] != ready then - goto check_dnode_ready_1 +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 step1 endi -if $data[1][4] != ready then - goto check_dnode_ready_1 +if $data(2)[4] != ready then + goto step1 endi -if $data[2][4] != ready then - goto check_dnode_ready_1 +if $data(3)[4] != ready then + goto step1 endi -if $data[3][4] != ready then - goto check_dnode_ready_1 +if $data(4)[4] != ready then + goto step1 endi $vgroups = 1 diff --git a/tests/script/tsim/sync/oneReplica1VgElectWithInsert.sim b/tests/script/tsim/sync/oneReplica1VgElectWithInsert.sim index b816226cfff3bc230f5629d432139690a86ca29e..aff458c02a289309dff563d2bc32d1d6f05b852b 100644 --- a/tests/script/tsim/sync/oneReplica1VgElectWithInsert.sim +++ b/tests/script/tsim/sync/oneReplica1VgElectWithInsert.sim @@ -11,55 +11,38 @@ system sh/exec.sh -n dnode2 -s start system sh/exec.sh -n dnode3 -s start system sh/exec.sh -n dnode4 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][0] != 1 then - return -1 -endi -if $data[0][4] != ready then - goto check_dnode_ready -endi - sql connect sql create dnode $hostname port 7200 sql create dnode $hostname port 7300 sql create dnode $hostname port 7400 -$loop_cnt = 0 -check_dnode_ready_1: -$loop_cnt = $loop_cnt + 1 -sleep 200 -if $loop_cnt == 10 then - print ====> dnodes not ready! - return -1 -endi +$x = 0 +step1: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][4] != ready then - goto check_dnode_ready_1 +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 step1 endi -if $data[1][4] != ready then - goto check_dnode_ready_1 +if $data(2)[4] != ready then + goto step1 endi -if $data[2][4] != ready then - goto check_dnode_ready_1 +if $data(3)[4] != ready then + goto step1 endi -if $data[3][4] != ready then - goto check_dnode_ready_1 +if $data(4)[4] != ready then + goto step1 endi $vgroups = 1 diff --git a/tests/script/tsim/sync/oneReplica5VgElect.sim b/tests/script/tsim/sync/oneReplica5VgElect.sim index 71c26e17c76b08514657b32ecca8b340ce7cbc24..2cf9b7f1f5af8cad0af519604e835fea80b97679 100644 --- a/tests/script/tsim/sync/oneReplica5VgElect.sim +++ b/tests/script/tsim/sync/oneReplica5VgElect.sim @@ -11,55 +11,38 @@ system sh/exec.sh -n dnode2 -s start system sh/exec.sh -n dnode3 -s start system sh/exec.sh -n dnode4 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][0] != 1 then - return -1 -endi -if $data[0][4] != ready then - goto check_dnode_ready -endi - sql connect sql create dnode $hostname port 7200 sql create dnode $hostname port 7300 sql create dnode $hostname port 7400 -$loop_cnt = 0 -check_dnode_ready_1: -$loop_cnt = $loop_cnt + 1 -sleep 200 -if $loop_cnt == 10 then - print ====> dnodes not ready! - return -1 -endi +$x = 0 +step1: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][4] != ready then - goto check_dnode_ready_1 +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 check_dnode_ready_1 +if $data(1)[4] != ready then + goto step1 endi -if $data[2][4] != ready then - goto check_dnode_ready_1 +if $data(2)[4] != ready then + goto step1 endi -if $data[3][4] != ready then - goto check_dnode_ready_1 +if $data(3)[4] != ready then + goto step1 +endi +if $data(4)[4] != ready then + goto step1 endi $replica = 1 diff --git a/tests/script/tsim/sync/threeReplica1VgElect.sim b/tests/script/tsim/sync/threeReplica1VgElect.sim index c3e9c13793466ecdd57890d7e48a71f5b04ca190..bf2cb0557008fc424be48f694fb0cc4ef940d089 100644 --- a/tests/script/tsim/sync/threeReplica1VgElect.sim +++ b/tests/script/tsim/sync/threeReplica1VgElect.sim @@ -11,55 +11,38 @@ system sh/exec.sh -n dnode2 -s start system sh/exec.sh -n dnode3 -s start system sh/exec.sh -n dnode4 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then +sql connect +sql create dnode $hostname port 7200 +sql create dnode $hostname port 7300 +sql create dnode $hostname port 7400 + +$x = 0 +step1: + $x = $x + 1 + sleep 1000 + if $x == 10 then print ====> dnode not ready! return -1 endi sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][0] != 1 then +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[0][4] != ready then - goto check_dnode_ready -endi - -#sql connect -sql create dnode $hostname port 7200 -sql create dnode $hostname port 7300 -sql create dnode $hostname port 7400 - -$loop_cnt = 0 -check_dnode_ready_1: -$loop_cnt = $loop_cnt + 1 -sleep 200 -if $loop_cnt == 10 then - print ====> dnodes not ready! - return -1 -endi -sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][4] != ready then - goto check_dnode_ready_1 +if $data(1)[4] != ready then + goto step1 endi -if $data[1][4] != ready then - goto check_dnode_ready_1 +if $data(2)[4] != ready then + goto step1 endi -if $data[2][4] != ready then - goto check_dnode_ready_1 +if $data(3)[4] != ready then + goto step1 endi -if $data[3][4] != ready then - goto check_dnode_ready_1 +if $data(4)[4] != ready then + goto step1 endi $vgroups = 1 diff --git a/tests/script/tsim/sync/threeReplica1VgElectWihtInsert.sim b/tests/script/tsim/sync/threeReplica1VgElectWihtInsert.sim index 3c21dff1b65a9737d96f9e0d9ae1b8c173fa3250..a6a0dda8a74a73666e77e3463387a7fefd5c0879 100644 --- a/tests/script/tsim/sync/threeReplica1VgElectWihtInsert.sim +++ b/tests/script/tsim/sync/threeReplica1VgElectWihtInsert.sim @@ -11,55 +11,38 @@ system sh/exec.sh -n dnode2 -s start system sh/exec.sh -n dnode3 -s start system sh/exec.sh -n dnode4 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][0] != 1 then - return -1 -endi -if $data[0][4] != ready then - goto check_dnode_ready -endi - sql connect sql create dnode $hostname port 7200 sql create dnode $hostname port 7300 sql create dnode $hostname port 7400 -$loop_cnt = 0 -check_dnode_ready_1: -$loop_cnt = $loop_cnt + 1 -sleep 200 -if $loop_cnt == 10 then - print ====> dnodes not ready! - return -1 -endi +$x = 0 +step1: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][4] != ready then - goto check_dnode_ready_1 +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 step1 endi -if $data[1][4] != ready then - goto check_dnode_ready_1 +if $data(2)[4] != ready then + goto step1 endi -if $data[2][4] != ready then - goto check_dnode_ready_1 +if $data(3)[4] != ready then + goto step1 endi -if $data[3][4] != ready then - goto check_dnode_ready_1 +if $data(4)[4] != ready then + goto step1 endi $vgroups = 1 diff --git a/tests/script/tsim/sync/vnodesnapshot-test.sim b/tests/script/tsim/sync/vnodesnapshot-test.sim index 3cf8cb4d9379ef137421b949ea57a1f85dd65ff4..8589078b5095d5490dd943a38cbc849b3ba99232 100644 --- a/tests/script/tsim/sync/vnodesnapshot-test.sim +++ b/tests/script/tsim/sync/vnodesnapshot-test.sim @@ -11,55 +11,38 @@ system sh/exec.sh -n dnode2 -s start system sh/exec.sh -n dnode3 -s start system sh/exec.sh -n dnode4 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][0] != 1 then - return -1 -endi -if $data[0][4] != ready then - goto check_dnode_ready -endi - sql connect sql create dnode $hostname port 7200 sql create dnode $hostname port 7300 sql create dnode $hostname port 7400 -$loop_cnt = 0 -check_dnode_ready_1: -$loop_cnt = $loop_cnt + 1 -sleep 200 -if $loop_cnt == 10 then - print ====> dnodes not ready! - return -1 -endi +$x = 0 +step1: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][4] != ready then - goto check_dnode_ready_1 +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 step1 endi -if $data[1][4] != ready then - goto check_dnode_ready_1 +if $data(2)[4] != ready then + goto step1 endi -if $data[2][4] != ready then - goto check_dnode_ready_1 +if $data(3)[4] != ready then + goto step1 endi -if $data[3][4] != ready then - goto check_dnode_ready_1 +if $data(4)[4] != ready then + goto step1 endi $replica = 3 diff --git a/tests/script/tsim/sync/vnodesnapshot.sim b/tests/script/tsim/sync/vnodesnapshot.sim index 347255b48911cbad4d8d1befaeca9f8bd4347f44..b9452d21477064e0bf5a31599bded6437004d7b4 100644 --- a/tests/script/tsim/sync/vnodesnapshot.sim +++ b/tests/script/tsim/sync/vnodesnapshot.sim @@ -11,55 +11,38 @@ system sh/exec.sh -n dnode2 -s start system sh/exec.sh -n dnode3 -s start system sh/exec.sh -n dnode4 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][0] != 1 then - return -1 -endi -if $data[0][4] != ready then - goto check_dnode_ready -endi - sql connect sql create dnode $hostname port 7200 sql create dnode $hostname port 7300 sql create dnode $hostname port 7400 -$loop_cnt = 0 -check_dnode_ready_1: -$loop_cnt = $loop_cnt + 1 -sleep 200 -if $loop_cnt == 10 then - print ====> dnodes not ready! - return -1 -endi +$x = 0 +step1: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi sql show dnodes -print ===> $rows $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] -print ===> $rows $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] $data[1][5] $data[1][6] -print ===> $rows $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] $data[2][5] $data[2][6] -print ===> $rows $data[3][0] $data[3][1] $data[3][2] $data[3][3] $data[3][4] $data[3][5] $data[3][6] -if $data[0][4] != ready then - goto check_dnode_ready_1 +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 step1 endi -if $data[1][4] != ready then - goto check_dnode_ready_1 +if $data(2)[4] != ready then + goto step1 endi -if $data[2][4] != ready then - goto check_dnode_ready_1 +if $data(3)[4] != ready then + goto step1 endi -if $data[3][4] != ready then - goto check_dnode_ready_1 +if $data(4)[4] != ready then + goto step1 endi $replica = 3