basic.sim 2.6 KB
Newer Older
P
plum-lihui 已提交
1 2 3 4 5 6 7 8
system sh/stop_dnodes.sh

system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wal -v 1
system sh/exec.sh -n dnode1 -s start
sleep 500
sql connect

X
Xiaoyu Wang 已提交
9 10 11
# todo remove
sql create database useless_db

P
plum-lihui 已提交
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
$loop_cnt = 0
check_dnode_ready:
	$loop_cnt = $loop_cnt + 1
	sleep 100
	if $loop_cnt == 10 then
	  print ====> dnode not ready!
		return -1
	endi
sql show dnodes
print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05
if $data00 != 1 then
  return -1
endi
if $data04 != ready then
  goto check_dnode_ready
endi

X
Xiaoyu Wang 已提交
29 30 31
# todo remove
sql drop database useless_db

P
plum-lihui 已提交
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
#root@trd02 /data2/dnode $ tmq_demo --help                                                                          
#Used to tmq_demo                                                                   
#        -c      Configuration directory, default is                                                                
#        -d      The name of the database to be created, default is tmqdb                                           
#        -s      The name of the super table to be created, default is stb
#        -f      The file of result, default is ./tmqResult.txt
#        -w      The path of vnode of wal, default is /data2/dnode/data/vnodes/vnode2/wal
#        -t      numOfThreads, default is 1
#        -n      numOfTables, default is 1
#        -v      numOfVgroups, default is 1
#        -a      runMode, default is 0
#        -l      numOfColumn, default is 1
#        -q      ratio, default is 1.000000
#        -b      batchNumOfRow, default is 1
#        -r      totalRowsOfPerTbl, default is 10000
#        -m      startTimestamp, default is 1640966400000 [2022-01-01 00:00:00]
#        -g      showMsgFlag, default is 0
#        
P
plum-lihui 已提交
50 51 52 53 54 55
print cmd===> system_content ../../debug/tests/test/c/tmq_demo -sim 1 -b 100 -c ../../sim/tsim/cfg -w ../../sim/dnode1/data/vnode/vnode4/wal
system_content ../../debug/tests/test/c/tmq_demo -sim 1 -b 100 -c ../../sim/tsim/cfg -w ../../sim/dnode1/data/vnode/vnode4/wal
print cmd result----> $system_content
if $system_content != @{consume success: 100}@ then
  print not match in pos000
endi
P
plum-lihui 已提交
56 57 58

sql show databases
print ===> $rows $data00 $data01 $data02 $data03
X
Xiaoyu Wang 已提交
59
if $rows != 2 then 
P
plum-lihui 已提交
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
  return -1
endi
if $data00 != tmqdb then 
  return -1
endi

sql use tmqdb
sql show tables
print ===> $rows $data00 $data01 $data02 $data03
if $rows != 1 then 
  return -1
endi
if $data00 != stb0 then 
  return -1
endi

sql select count(*) from stb0
print ===> $rows $data00 $data01 $data02 $data03
if $rows != 1 then 
  return -1
endi
if $data00 != 10000 then 
  return -1
endi
P
plum-lihui 已提交
84

P
plum-lihui 已提交
85
#system sh/exec.sh -n dnode1 -s stop -x SIGINT