account_delete.sim 1.6 KB
Newer Older
S
slguan 已提交
1
system sh/stop_dnodes.sh
S
slguan 已提交
2
system sh/deploy.sh -n dnode1 -i 1
S
scripts  
slguan 已提交
3
system sh/cfg.sh -n dnode1 -c wallevel -v 0
S
slguan 已提交
4
system sh/exec_up.sh -n dnode1 -s start
S
slguan 已提交
5 6

sleep 3000
S
scripts  
Shengliang Guan 已提交
7
sql connect
S
slguan 已提交
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

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 已提交
54 55
print $data00 $data01 $data02 $data03
if $data02 != 2 then
S
slguan 已提交
56 57 58 59 60
  return -1
endi
sql drop account oroot

print ============= step4
S
slguan 已提交
61 62 63 64 65 66 67 68
$x = 0
show4: 
	$x = $x + 1
	sleep 2000
	if $x == 10 then 
		return -1
	endi

S
slguan 已提交
69
sql show dnodes
S
slguan 已提交
70
if $data02 != 0 then
S
slguan 已提交
71
  goto show4
S
slguan 已提交
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
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
S
scripts  
slguan 已提交
97 98 99
endi

system sh/exec_up.sh -n dnode1 -s stop  -x SIGINT