TDengine/tests/script/general/cache/restart_metrics.sim
Shuduo Sang d69c5977db
Test/sangshuduo/td 13408 move tests in (#10589)
* restore .gitmodules

* Revert "[TD-13408]<test>: move tests directory out"

This reverts commit 7db7bd9337.

* revert to make tests back

* immigrate file change in stand-alone repo to TDengine

* remove tests repository checkout

Co-authored-by: tangfangzhi <fztang@taosdata.com>
2022-03-07 17:59:24 +08:00

93 lines
No EOL
1.8 KiB
Text

system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print ======================== dnode1 start
$i = 0
$dbPrefix = ca_rm_db
$tbPrefix = ca_rm_tb
$mtPrefix = ca_rm_mt
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
$mt = $mtPrefix . $i
print =============== step1
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(100))
sql create table $tb using $mt tags( "1" )
sql insert into $tb values (now, 1)
sql select * from $tb
#print ===>rows $rows, data $data01
if $rows != 1 then
print expect 1, actual: $rows
return -1
endi
if $data01 != 1 then
print expect 1 actual: $data01
return -1
endi
sql select * from $mt
print ===>rows $rows, data $data01
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
print =============== step2
system sh/exec.sh -n dnode1 -s stop
sleep 3000
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
print =============== step3
print ==> sleep 1 seconds to renew cache
sql reset query cache
sleep 1000
print =============== step4
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol bool) TAGS(tgcol int)
sql create table $tb using $mt tags( 3 )
sql insert into $tb values (now, 2)
sql select * from $tb
print ===>rows $rows, data $data01
if $rows != 1 then
return -1
endi
if $data01 != 1 then
print expect 1, actual $data01
return -1
endi
sql select * from $mt
print ===>rows $rows, data $data01
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data02 != 3 then
print expect 3 actual: $data02
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT