From 7477103daee5881277f3d1fcf00f4c0e72a1035a Mon Sep 17 00:00:00 2001 From: Minghao Li Date: Mon, 11 Jul 2022 20:42:56 +0800 Subject: [PATCH] refactor(sync): add test case --- tests/script/tsim/sync/vnodesnapshot-test.sim | 94 ++++++++++++++++++- 1 file changed, 93 insertions(+), 1 deletion(-) diff --git a/tests/script/tsim/sync/vnodesnapshot-test.sim b/tests/script/tsim/sync/vnodesnapshot-test.sim index e4ef6739dd..837903af37 100644 --- a/tests/script/tsim/sync/vnodesnapshot-test.sim +++ b/tests/script/tsim/sync/vnodesnapshot-test.sim @@ -168,11 +168,103 @@ system sh/exec.sh -n dnode3 -s stop -x SIGINT - +######################################################## print ===> start dnode1 dnode2 dnode3 dnode4 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 +sleep 3000 + +print =============== query data +sql connect +sql use db +sql select * from ct1 +print rows: $rows +print $data00 $data01 $data02 +if $rows != 100 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 +######################################################## + + +######################################################## +print ===> start dnode1 dnode3 dnode4 +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 + +sleep 3000 + +print =============== query data +sql connect +sql use db +sql select * from ct1 +print rows: $rows +print $data00 $data01 $data02 +if $rows != 100 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 +######################################################## + + +######################################################## +print ===> start dnode1 dnode2 dnode4 +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 + +sleep 3000 + +print =============== query data +sql select * from ct1 +print rows: $rows +print $data00 $data01 $data02 +if $rows != 100 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 +######################################################## + + +######################################################## +print ===> start dnode1 dnode2 dnode3 +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 + +sleep 3000 + +print =============== query data +sql select * from ct1 +print rows: $rows +print $data00 $data01 $data02 +if $rows != 100 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 +######################################################## +