From efdcfe46531df225b7db8643e4d1177a54c9c861 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 2 Nov 2022 12:00:58 +0800 Subject: [PATCH] test: add case --- tests/script/tmp/data.sim | 71 +++------------------------------------ 1 file changed, 4 insertions(+), 67 deletions(-) diff --git a/tests/script/tmp/data.sim b/tests/script/tmp/data.sim index c59a43263b..cdabc97c09 100644 --- a/tests/script/tmp/data.sim +++ b/tests/script/tmp/data.sim @@ -45,74 +45,9 @@ if $data(4)[4] != ready then goto step1 endi -return - +return print =============== step2: create database -sql create database db vgroups 1 replica 3 -sql select * from information_schema.ins_databases -if $rows != 3 then - return -1 -endi -if $data(db)[4] != 3 then - return -1 -endi - -sql select * from information_schema.ins_dnodes -if $data(2)[2] != 1 then - return -1 -endi -if $data(3)[2] != 1 then - return -1 -endi -if $data(4)[2] != 1 then - return -1 -endi - -# vnodes -sql select * from information_schema.ins_dnodes -if $data(2)[2] != 1 then - return -1 -endi -if $data(3)[2] != 1 then - return -1 -endi -if $data(4)[2] != 1 then - return -1 -endi - -# v1_dnode -$hasleader = 0 -$x = 0 -step2: - $x = $x + 1 - sleep 1000 - if $x == 20 then - print ====> dnode not ready! - return -1 - endi -sql show db.vgroups -print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 -if $data(2)[3] != 2 then - return -1 -endi -if $data(2)[5] != 3 then - return -1 -endi -if $data(2)[7] != 4 then - return -1 -endi -if $data(2)[4] == leader then - $hasleader = 1 -endi -if $data(2)[6] == leader then - $hasleader = 1 -endi -if $data(2)[8] == leader then - $hasleader = 1 -endi -if $hasleader != 1 then - goto step2 -endi +sql create database db vgroups 33 replica 3 sql use db; sql create table stb (ts timestamp, c int) tags (t int); @@ -122,6 +57,8 @@ sql select * from information_schema.ins_stables where db_name = 'db'; sql select * from information_schema.ins_tables where db_name = 'db'; sql show db.vgroups; +system sh/exec.sh -n dnode2 -s stop + return print ======== start back run_back tmp/back.sim -- GitLab