From de9a4bb973c6b15bce41ccf9f630eb490933eb61 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 11 Jun 2020 16:36:54 +0800 Subject: [PATCH] scripts --- tests/script/unique/column/replica3.sim | 4 +- tests/script/unique/db/replica_add12.sim | 66 +++------------------ tests/script/unique/db/replica_reduce32.sim | 32 ++++------ tests/script/unique/http/opentsdb.sim | 2 +- tests/script/unique/stable/dnode2_stop.sim | 3 +- 5 files changed, 25 insertions(+), 82 deletions(-) diff --git a/tests/script/unique/column/replica3.sim b/tests/script/unique/column/replica3.sim index c21f71dc2c..2d6c194ef8 100644 --- a/tests/script/unique/column/replica3.sim +++ b/tests/script/unique/column/replica3.sim @@ -29,8 +29,8 @@ while $x < 1010 $x = $x + 1 endw -sql_error create database d1 replica 2 wal 0 -sql create database d2 replica 1 wal 0 +sql_error create database d1 replica 2 wallevel 0 +sql_error create database d2 replica 1 wallevel 0 sql_error alter database d2 replica 2 system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/unique/db/replica_add12.sim b/tests/script/unique/db/replica_add12.sim index ff0dffe0e2..89502ce419 100644 --- a/tests/script/unique/db/replica_add12.sim +++ b/tests/script/unique/db/replica_add12.sim @@ -148,25 +148,10 @@ print ========= step5 system sh/exec.sh -n dnode2 -s stop -x SIGINT sleep 5000 -sql select * from d1.t1 -if $rows != 2 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 2 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 2 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 2 then - return -1 -endi +sql_error select * from d1.t1 +sql_error select * from d2.t2 +sql_error select * from d3.t3 +sql_error select * from d4.t4 print ===== insert data @@ -175,26 +160,6 @@ sql_error insert into d2.t2 values(now, 3) sql_error insert into d3.t3 values(now, 3) sql_error insert into d4.t4 values(now, 3) -sql select * from d1.t1 -if $rows != 2 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 2 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 2 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 2 then - return -1 -endi - print ========= step6 system sh/exec.sh -n dnode2 -s start sleep 5000 @@ -234,25 +199,10 @@ sql_error insert into d2.t2 values(now, 3) sql_error insert into d3.t3 values(now, 3) sql_error insert into d4.t4 values(now, 3) -sql select * from d1.t1 -if $rows != 3 then - return -1 -endi - -sql select * from d2.t2 -if $rows != 3 then - return -1 -endi - -sql select * from d3.t3 -if $rows != 3 then - return -1 -endi - -sql select * from d4.t4 -if $rows != 3 then - return -1 -endi +sql_error select * from d1.t1 +sql_error select * from d2.t2 +sql_error select * from d3.t3 +sql_error select * from d4.t4 print ========= step7 system sh/exec.sh -n dnode3 -s start diff --git a/tests/script/unique/db/replica_reduce32.sim b/tests/script/unique/db/replica_reduce32.sim index bc08911a7c..5516009369 100644 --- a/tests/script/unique/db/replica_reduce32.sim +++ b/tests/script/unique/db/replica_reduce32.sim @@ -102,19 +102,15 @@ print ========= step4 system sh/exec.sh -n dnode2 -s stop -x SIGINT sleep 5000 -sql insert into d1.t1 values(now, 3) -x step1 -step1: -sql insert into d2.t2 values(now, 3) -x step2 -step2: -sql insert into d3.t3 values(now, 3) -x step3 -step3: -sql insert into d4.t4 values(now, 3) -x step4 -step4: +sql_error insert into d1.t1 values(now, 3) +sql_error insert into d2.t2 values(now, 3) +sql_error insert into d3.t3 values(now, 3) +sql_error insert into d4.t4 values(now, 3) -sql select * from d1.t1 -sql select * from d2.t2 -sql select * from d3.t3 -sql select * from d4.t4 +sql_error select * from d1.t1 +sql_error select * from d2.t2 +sql_error select * from d3.t3 +sql_error select * from d4.t4 print ========= step5 system sh/exec.sh -n dnode2 -s start @@ -126,14 +122,10 @@ sleep 5000 sql reset query cache sleep 1000 -sql insert into d1.t1 values(now, 3) -x step11 -step11: -sql insert into d2.t2 values(now, 3) -x step21 -step21: -sql insert into d3.t3 values(now, 3) -x step31 -step31: -sql insert into d4.t4 values(now, 3) -x step41 -step41: +sql_error insert into d1.t1 values(now, 3) +sql_error insert into d2.t2 values(now, 3) +sql_error insert into d3.t3 values(now, 3) +sql_error insert into d4.t4 values(now, 3) print ========= step6 system sh/exec.sh -n dnode3 -s start diff --git a/tests/script/unique/http/opentsdb.sim b/tests/script/unique/http/opentsdb.sim index 61ce5127b4..58f6609d15 100644 --- a/tests/script/unique/http/opentsdb.sim +++ b/tests/script/unique/http/opentsdb.sim @@ -125,7 +125,7 @@ endi system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","group1": "1","group1": "1","group1": "1","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put print $system_content -if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbbbbbb","table":"sys_cpu_d_bbbbbbb_lga_1_1_1_1_1_web01","timestamp":1346846400,"value":18.000000,"tags":{"dc":"lga","group1":"1","group1":"1","group1":"1","group1":"1","group1":"1","host":"web01"},"status":"error","code":-2147483135}}],"failed":1,"success":0,"affected_rows":0}@ then +if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbbbbbb","table":"sys_cpu_d_bbbbbbb_lga_1_1_1_1_1_web01","timestamp":1346846400,"value":18.000000,"tags":{"dc":"lga","group1":"1","group1":"1","group1":"1","group1":"1","group1":"1","host":"web01"},"status":"error","code":-2147482782}}],"failed":1,"success":0,"affected_rows":0}@ then return -1 endi diff --git a/tests/script/unique/stable/dnode2_stop.sim b/tests/script/unique/stable/dnode2_stop.sim index 0a801d9c7e..cb7df5a3cf 100644 --- a/tests/script/unique/stable/dnode2_stop.sim +++ b/tests/script/unique/stable/dnode2_stop.sim @@ -74,6 +74,7 @@ endi sleep 100 system sh/exec.sh -n dnode2 -s stop -x SIGINT +sleep 5000 print =============== step2 sql select count(*) from $mt -x step2 @@ -85,7 +86,7 @@ sql select count(tbcol) from $mt -x step21 step21: system sh/exec.sh -n dnode2 -s start -sleep 10000 +sleep 5000 print =============== step3 sql select count(tbcol) as c from $mt where ts <= 1519833840000 -- GitLab