test: valgrind case

This commit is contained in:
Shengliang Guan 2022-08-01 11:48:55 +08:00
parent 01bf1e4684
commit 9187231615
1 changed files with 58 additions and 40 deletions

View File

@ -1,51 +1,69 @@
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start system sh/cfg.sh -n dnode1 -c debugflag -v 131
system sh/exec.sh -n dnode1 -s start -v
sql connect sql connect
print =============== create database d1 print =============== step1: create drop show dnodes
sql create database d1 $x = 0
sql create table d1.t1 (ts timestamp, i int); step1:
sql create table d1.t2 (ts timestamp, i int); $x = $x + 1
sql create table d1.t3 (ts timestamp, i int); sleep 1000
sql create table d1.t4 (ts timestamp, i int); if $x == 10 then
print ---> dnode not ready!
sql show databases return -1
if $rows != 3 then endi
sql show dnodes
print ---> $data00 $data01 $data02 $data03 $data04 $data05
if $rows != 1 then
return -1 return -1
endi endi
if $data(1)[4] != ready then
if $data20 != d1 then goto step1
return -1
endi endi
if $data22 != 2 then $tbPrefix = tb
return -1 $tbNum = 5
endi $rowNum = 10
#if $data03 != 4 then print =============== step2: prepare data
# return -1 sql create database db vgroups 2
#endi sql use db
sql create table if not exists stb (ts timestamp, tbcol int, tbcol2 float, tbcol3 double, tbcol4 binary(30), tbcol5 binary(30)) tags (tgcol int unsigned)
sql show d1.tables $i = 0
if $rows != 4 then while $i < $tbNum
return -1 $tb = $tbPrefix . $i
endi sql create table $tb using stb tags( $i )
$x = 0
while $x < $rowNum
$cc = $x * 60000
$ms = 1601481600000 + $cc
sql insert into $tb values ($ms , $x , $x , $x , "abcd1234=-+*" , "123456 0" )
$x = $x + 1
endw
print =============== create database d2 $cc = $x * 60000
sql create database d2 $ms = 1601481600000 + $cc
sql create table d2.t1 (ts timestamp, i int); sql insert into $tb values ($ms , NULL , NULL , NULL , NULL , NULL )
sql create table d2.t2 (ts timestamp, i int); $i = $i + 1
sql create table d2.t3 (ts timestamp, i int); endw
sql show databases print =============== step3: tb
if $rows != 4 then sql select tbcol5 - tbcol tbcol from tb1
return -1 sql select tbcol2 - tbcol tbcol from tb1
endi
sql show d2.tables
if $rows != 3 then
return -1
endi
_OVER:
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
print =============== check
$null=
system_content sh/checkValgrind.sh -n dnode1
print cmd return result ----> [ $system_content ]
if $system_content > 0 then
return -1
endi
if $system_content == $null then
return -1
endi