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

S
shenglian zhou 已提交
10

S
Shengliang Guan 已提交
11
print =============== step1: create alter drop show user
S
Shengliang Guan 已提交
12
sql create user u1 pass 'taosdata'
X
Xiaoyu Wang 已提交
13
sql select * from information_schema.ins_users
S
Shengliang Guan 已提交
14 15 16 17 18 19
sql alter user u1 sysinfo 1
sql alter user u1 enable 1
sql alter user u1 pass 'taosdata'
sql drop user u1
sql_error alter user u2 sysinfo 0

S
Shengliang Guan 已提交
20
print =============== step2 create drop dnode
S
Shengliang Guan 已提交
21
sql create dnode $hostname port 7200
S
Shengliang Guan 已提交
22
sql create dnode $hostname port 7300
D
dmchen 已提交
23
sql drop dnode 3 force
S
Shengliang Guan 已提交
24
sql alter dnode 1 'debugflag 131'
S
Shengliang Guan 已提交
25

X
Xiaoyu Wang 已提交
26
print =============== step3: select * from information_schema.ins_dnodes
S
Shengliang Guan 已提交
27 28 29 30 31 32 33 34
$x = 0
step3:
	$x = $x + 1
	sleep 1000
	if $x == 60 then
	  print ====> dnode not ready!
		return -1
	endi
X
Xiaoyu Wang 已提交
35
sql select * from information_schema.ins_dnodes
S
Shengliang Guan 已提交
36 37 38 39 40 41 42 43 44 45 46 47
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
if $rows != 2 then
  return -1
endi
if $data(1)[4] != ready then
  goto step3
endi
if $data(2)[4] != ready then
  goto step3
endi

S
Shengliang Guan 已提交
48 49 50 51 52 53
print =============== create database, stable, table
sql create database db vgroups 3
sql use db
sql create table stb (ts timestamp, c int) tags (t int)
sql create table t0 using stb tags (0)
sql create table tba (ts timestamp, c1 binary(10), c2 nchar(10));
S
Shengliang Guan 已提交
54 55

print =============== run show xxxx
X
Xiaoyu Wang 已提交
56
sql select * from information_schema.ins_dnodes
S
Shengliang Guan 已提交
57
if $rows != 2 then 
S
Shengliang Guan 已提交
58 59 60
  return -1
endi

X
Xiaoyu Wang 已提交
61
sql select * from information_schema.ins_mnodes
S
Shengliang Guan 已提交
62 63 64 65
if $rows != 1 then 
  return -1
endi

X
Xiaoyu Wang 已提交
66
sql select * from information_schema.ins_databases
S
Shengliang Guan 已提交
67 68 69 70 71 72 73 74 75 76 77
if $rows != 3 then
  return -1
endi

sql show stables
if $rows != 1 then 
  return -1
endi

sql show tables
if $rows != 2 then 
S
Shengliang Guan 已提交
78 79 80
  return -1
endi

X
Xiaoyu Wang 已提交
81
sql select * from information_schema.ins_users
S
Shengliang Guan 已提交
82 83 84 85 86
if $rows != 1 then 
  return -1
endi

print =============== run select * from information_schema.xxxx
D
dapan1121 已提交
87
sql select * from information_schema.ins_dnodes
S
Shengliang Guan 已提交
88
if $rows != 2 then 
S
Shengliang Guan 已提交
89 90 91
  return -1
endi

D
dapan1121 已提交
92
sql select * from information_schema.ins_mnodes
S
Shengliang Guan 已提交
93 94 95 96
if $rows != 1 then 
  return -1
endi

D
dapan1121 已提交
97
sql select * from information_schema.ins_databases
S
Shengliang Guan 已提交
98 99 100 101
if $rows != 3 then
  return -1
endi

D
dapan1121 已提交
102
sql select * from information_schema.ins_stables
S
Shengliang Guan 已提交
103 104 105 106
if $rows != 1 then 
  return -1
endi

D
dapan1121 已提交
107
sql select * from information_schema.ins_tables
D
dapan1121 已提交
108
if $rows <= 0 then
S
Shengliang Guan 已提交
109 110 111
  return -1
endi

D
dapan1121 已提交
112
sql select * from information_schema.ins_users
S
Shengliang Guan 已提交
113 114 115 116
if $rows != 1 then 
  return -1
endi

D
dapan1121 已提交
117
sql select * from information_schema.ins_vgroups
S
Shengliang Guan 已提交
118 119 120 121
if $rows != 3 then 
  return -1
endi

S
Shengliang Guan 已提交
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
sql show variables;
if $rows != 4 then
  return -1
endi

sql show dnode 1 variables;
if $rows <= 0 then
  return -1
endi

sql show local variables;
if $rows <= 0 then
  return -1
endi

S
Shengliang Guan 已提交
137
print =============== stop
138
system sh/exec.sh -n dnode1 -s stop -x SIGINT
S
Shengliang Guan 已提交
139
system sh/exec.sh -n dnode2 -s stop -x SIGINT
140

S
Shengliang Guan 已提交
141
print =============== check
S
Shengliang Guan 已提交
142
$null=
S
Shengliang Guan 已提交
143

S
Shengliang Guan 已提交
144
system_content sh/checkValgrind.sh -n dnode1 
S
Shengliang Guan 已提交
145
print cmd return result ----> [ $system_content ]
S
Shengliang Guan 已提交
146
if $system_content > 0 then
S
Shengliang Guan 已提交
147
  return -1
148
endi 
P
plum-lihui 已提交
149 150

if $system_content == $null then
S
Shengliang Guan 已提交
151
  return -1
P
plum-lihui 已提交
152
endi 
S
Shengliang Guan 已提交
153 154 155

system_content sh/checkValgrind.sh -n dnode2
print cmd return result ----> [ $system_content ]
156
if $system_content > 0 then
S
Shengliang Guan 已提交
157 158 159 160 161
  return -1
endi 

if $system_content == $null then
  return -1
S
shenglian zhou 已提交
162
endi