checkError2.sim 1.6 KB
Newer Older
1 2
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
S
Shengliang Guan 已提交
3
system sh/cfg.sh -n dnode1 -c debugflag -v 131
S
Shengliang Guan 已提交
4 5 6
system sh/exec.sh -n dnode1 -s start -v
sql connect

S
Shengliang Guan 已提交
7
print =============== step1: create drop show dnodes
S
Shengliang Guan 已提交
8 9 10 11 12
$x = 0
step1:
	$x = $x + 1
	sleep 1000
	if $x == 10 then
S
Shengliang Guan 已提交
13
	  print ---> dnode not ready!
S
Shengliang Guan 已提交
14 15 16
		return -1
	endi
sql show dnodes
S
Shengliang Guan 已提交
17
print ---> $data00 $data01 $data02 $data03 $data04 $data05
S
Shengliang Guan 已提交
18 19 20
if $rows != 1 then
  return -1
endi
S
Shengliang Guan 已提交
21 22 23
if $data(1)[4] != ready then
  goto step1
endi
S
Shengliang Guan 已提交
24

S
Shengliang Guan 已提交
25
print =============== step2: create db
S
Shengliang Guan 已提交
26
sql create database d1 vgroups 1 buffer 3
S
Shengliang Guan 已提交
27 28 29 30 31 32 33 34 35 36
sql show databases
sql use d1
sql show vgroups

print =============== step3: create show stable
sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned)
sql show stables
if $rows != 1 then 
  return -1
endi
S
Shengliang Guan 已提交
37

38 39
print =============== step3: create show table
sql create table ct1 using stb tags(1000)
S
Shengliang Guan 已提交
40 41 42 43
sql show tables
if $rows != 1 then 
  return -1
endi
44 45 46 47 48 49

print =============== step5: insert data
sql insert into ct1 values(now+0s, 10, 2.0, 3.0)
sql insert into ct1 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)

print =============== step6: select data
S
Shengliang Guan 已提交
50
sql select * from ct1
51 52
#sql select * from stb

S
Shengliang Guan 已提交
53
_OVER:
54 55
system sh/exec.sh -n dnode1 -s stop -x SIGINT

S
Shengliang Guan 已提交
56
print =============== check
S
Shengliang Guan 已提交
57
print ----> start to check if there are ERRORS in vagrind log file for each dnode
58
system_content sh/checkValgrind.sh -n dnode1 
S
Shengliang Guan 已提交
59 60

print cmd return result ----> [ $system_content ]
S
Shengliang Guan 已提交
61
if $system_content <= 2 then
P
plum-lihui 已提交
62
  return 0
63
endi 
P
plum-lihui 已提交
64 65 66 67 68 69

$null=
if $system_content == $null then
  return 0
endi 

P
plum-lihui 已提交
70
return -1