account_delete.sim 1.5 KB
Newer Older
S
slguan 已提交
1 2 3 4
system sh/stop_dnodes.sh

system sh/ip.sh -i 1 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
S
slguan 已提交
5 6
system sh/cfg.sh -n dnode1 -c clog -v 0
system sh/exec_up.sh -n dnode1 -s start
S
slguan 已提交
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 44 45 46 47 48 49 50 51 52 53 54 55

sql connect
sleep 3000

print ============= step1
sql create account oroot pass 'taosdata' 
sql close
sql connect oroot
sleep 2000

print ============= step2
sql create user read pass 'taosdata'
sql create user write pass 'taosdata'

sql create database d1
sql create database d2
sql create table d1.t1 (ts timestamp, i int)
sql create table d2.t2 (ts timestamp, i int)
sql insert into d1.t1 values(now, 1)
sql insert into d2.t2 values(now, 1)
sql insert into d2.t2 values(now+1s, 2)

sql show databases
if $rows != 2 then 
  return -1
endi
sql show users
if $rows != 4 then 
  return -1
endi
sql select * from d1.t1
if $rows != 1 then 
  return -1
endi
sql select * from d2.t2 
if $rows != 2 then 
  return -1
endi

print ============= step3
sql close
sql connect
sleep 2000

sql show databases
if $rows != 0 then 
  return -1
endi
sql show dnodes
S
slguan 已提交
56
if $data03 != 2 then
S
slguan 已提交
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
  return -1
endi
sql drop account oroot

print ============= step4
sleep 2000
sql show dnodes
if $data02 != 0 then
  return -1
endi

print ============= step5
sql create account oroot pass 'taosdata'

sql close
sql connect oroot
sleep 2000

sql show databases
if $rows != 0 then 
  return -1
endi
sql show users
if $rows != 2 then 
  return -1
endi

sql close
sql connect
sleep 2000
sql drop account oroot
sql show accounts
if $rows != 1 then 
  return -1
endi