basic.sim 2.5 KB
Newer Older
P
plum-lihui 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
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

$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

#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 已提交
44 45 46 47
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
P
plum-lihui 已提交
48
  return -1
P
plum-lihui 已提交
49
endi
P
plum-lihui 已提交
50 51 52

sql show databases
print ===> $rows $data00 $data01 $data02 $data03
53
if $rows != 3 then
P
plum-lihui 已提交
54 55
  return -1
endi
56
if $data20 != tmqdb then
P
plum-lihui 已提交
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
  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 已提交
78

79
system sh/exec.sh -n dnode1 -s stop -x SIGINT