basic1.sim 2.3 KB
Newer Older
1 2 3 4 5 6 7
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
sql connect

X
Xiaoyu Wang 已提交
8 9
print =============== select * from information_schema.ins_dnodes
sql select * from information_schema.ins_dnodes;
G
Ganlin Zhao 已提交
10
if $rows != 1 then
11 12 13
  return -1
endi

G
Ganlin Zhao 已提交
14
if $data00 != 1 then
15 16 17
  return -1
endi

X
Xiaoyu Wang 已提交
18
sql select * from information_schema.ins_mnodes;
G
Ganlin Zhao 已提交
19
if $rows != 1 then
20 21 22
  return -1
endi

G
Ganlin Zhao 已提交
23
if $data00 != 1 then
24 25 26
  return -1
endi

G
Ganlin Zhao 已提交
27
if $data02 != leader then
28 29 30 31 32 33 34
  return -1
endi

print =============== create dnodes
sql create dnode $hostname port 7200
sleep 2000

X
Xiaoyu Wang 已提交
35
sql select * from information_schema.ins_dnodes;
G
Ganlin Zhao 已提交
36
if $rows != 2 then
37 38 39
  return -1
endi

G
Ganlin Zhao 已提交
40
if $data00 != 1 then
41 42 43
  return -1
endi

G
Ganlin Zhao 已提交
44
if $data10 != 2 then
45 46 47 48
  return -1
endi

print $data02
G
Ganlin Zhao 已提交
49
if $data02 != 0 then
50 51 52
  return -1
endi

G
Ganlin Zhao 已提交
53
if $data12 != 0 then
54 55 56
  return -1
endi

G
Ganlin Zhao 已提交
57
if $data04 != ready then
58 59 60
  return -1
endi

G
Ganlin Zhao 已提交
61
if $data14 != ready then
62 63 64
  return -1
endi

X
Xiaoyu Wang 已提交
65
sql select * from information_schema.ins_mnodes;
G
Ganlin Zhao 已提交
66
if $rows != 1 then
67 68 69
  return -1
endi

G
Ganlin Zhao 已提交
70
if $data00 != 1 then
71 72 73
  return -1
endi

G
Ganlin Zhao 已提交
74
if $data02 != leader then
75 76 77
  return -1
endi

D
dapan1121 已提交
78 79 80
#print =============== create drop bnode 1
#sql create bnode on dnode 1
#sql show bnodes
G
Ganlin Zhao 已提交
81
#if $rows != 1 then
D
dapan1121 已提交
82 83
#  return -1
#endi
G
Ganlin Zhao 已提交
84
#if $data00 != 1 then
D
dapan1121 已提交
85 86 87 88 89 90
#  return -1
#endi
#sql_error create bnode on dnode 1
#
#sql drop bnode on dnode 1
#sql show bnodes
G
Ganlin Zhao 已提交
91
#if $rows != 0 then
D
dapan1121 已提交
92 93 94 95 96 97 98
#  return -1
#endi
#sql_error drop bnode on dnode 1
#
#print =============== create drop bnode 2
#sql create bnode on dnode 2
#sql show bnodes
G
Ganlin Zhao 已提交
99
#if $rows != 1 then
D
dapan1121 已提交
100 101
#  return -1
#endi
G
Ganlin Zhao 已提交
102
#if $data00 != 2 then
D
dapan1121 已提交
103 104 105 106 107 108
#  return -1
#endi
#sql_error create bnode on dnode 2
#
#sql drop bnode on dnode 2
#sql show bnodes
G
Ganlin Zhao 已提交
109
#if $rows != 0 then
D
dapan1121 已提交
110 111 112 113 114 115 116 117
#  return -1
#endi
#sql_error drop bnode on dnode 2
#
#print =============== create drop bnodes
#sql create bnode on dnode 1
#sql create bnode on dnode 2
#sql show bnodes
G
Ganlin Zhao 已提交
118
#if $rows != 2 then
D
dapan1121 已提交
119 120 121 122 123 124 125 126 127 128 129
#  return -1
#endi

#print =============== restart
#system sh/exec.sh -n dnode1 -s stop -x SIGINT
#system sh/exec.sh -n dnode2 -s stop -x SIGINT
#system sh/exec.sh -n dnode1 -s start
#system sh/exec.sh -n dnode2 -s start
#
#sleep 2000
#sql show bnodes
G
Ganlin Zhao 已提交
130
#if $rows != 2 then
D
dapan1121 已提交
131 132
#  return -1
#endi
133 134 135

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