basic1.sim 1.6 KB
Newer Older
S
Shengliang Guan 已提交
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
system sh/exec.sh -n dnode1 -s start -v
S
Shengliang Guan 已提交
5 6
sql connect

S
Shengliang Guan 已提交
7 8 9 10 11 12
print =============== step1: create drop show dnodes
$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
sql show databases
S
Shengliang Guan 已提交
28 29
sql use d1
sql show vgroups
S
Shengliang Guan 已提交
30

S
Shengliang Guan 已提交
31
print =============== step3: create show stable
S
Shengliang Guan 已提交
32 33 34 35 36 37
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 已提交
38
print =============== step3: create show table
S
Shengliang Guan 已提交
39 40 41 42 43 44
sql create table ct1 using stb tags(1000)
sql show tables
if $rows != 1 then 
  return -1
endi

S
Shengliang Guan 已提交
45
print =============== step5: insert data
S
Shengliang Guan 已提交
46 47
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)
S
Shengliang Guan 已提交
48

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

S
Shengliang Guan 已提交
53
_OVER:
S
Shengliang Guan 已提交
54
system sh/exec.sh -n dnode1 -s stop -x SIGINT
S
Shengliang Guan 已提交
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70

print =============== check
print ----> start to check if there are ERRORS in vagrind log file for each dnode
system_content sh/checkValgrind.sh -n dnode1 

print cmd return result ----> [ $system_content ]
if $system_content <= 0 then
  return 0
endi 

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

return -1