From 505b0f1f45a667ba8f87d11c8e5c72a30eda104a Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 4 Jul 2022 20:36:45 +0800 Subject: [PATCH] test: case for valgrind --- tests/script/tmp/prepare.sim | 14 +++++++------- tests/script/tsim/valgrind/basic.sim | 29 ++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/tests/script/tmp/prepare.sim b/tests/script/tmp/prepare.sim index d0276a2a02..2e16ee7bda 100644 --- a/tests/script/tmp/prepare.sim +++ b/tests/script/tmp/prepare.sim @@ -30,10 +30,10 @@ endw return -create database db vgroups 1024 buffer 3; -use db; -create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned); -create table ct1 using stb tags(1000); -create table ct2 using stb tags(1000) ; -show db.tables; -insert into ct1 values(now+0s, 10, 2.0, 3.0); \ No newline at end of file +sql create database db vgroups 1024 buffer 3; +sql use db; +sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned); +sql create table ct1 using stb tags(1000); +sql create table ct2 using stb tags(1000) ; +sql show db.tables; +sql insert into ct1 values(now+0s, 10, 2.0, 3.0); \ No newline at end of file diff --git a/tests/script/tsim/valgrind/basic.sim b/tests/script/tsim/valgrind/basic.sim index 0f11ae0313..b449527568 100644 --- a/tests/script/tsim/valgrind/basic.sim +++ b/tests/script/tsim/valgrind/basic.sim @@ -1,8 +1,33 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/exec.sh -n dnode1 -s start +system sh/exec.sh -n dnode1 -s start -v sql connect -sql create database d0 vgroups 1; +print =============== step1: create drop show dnodes +$x = 0 +step1: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi +sql show dnodes +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +if $rows != 1 then + return -1 +endi +goto _OVER + +print =============== step2: create alter drop show user +sql create user u1 pass 'taosdata' +sql show users +sql alter user u1 sysinfo 1 +sql alter user u1 enable 1 +sql alter user u1 pass 'taosdata' +sql alter user u2 sysinfo 0 +sql drop user u1 + +_OVER: system sh/exec.sh -n dnode1 -s stop -x SIGINT