user_create.sim 1.3 KB
Newer Older
S
slguan 已提交
1 2
system sh/stop_dnodes.sh

S
slguan 已提交
3 4

system sh/deploy.sh -n dnode1 -i 1
S
slguan 已提交
5 6 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
system sh/cfg.sh -n dnode1 -c clog -v 0
system sh/exec.sh -n dnode1 -s start
sql connect

print =============== step1
sql show users
if $rows != 3 then 
  return -1
endi

sql create user read PASS 'pass123'
sql create user read PASS 'pass123' -x step1
	return -1
step1:

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

sql alter user read PASS 'taosdata'

print =============== step2
sql close
sql connect read
sleep 2000

sql alter user read PASS 'taosdata'

print =============== step3
sql drop user read -x step31
  return -1
step31:
sql drop user sys -x step32
  return -1
step32:
sql drop user stream -x step33
  return -1
step33:

print =============== step4
sql close
sql connect
sleep 2000

sql alter user read privilege read
sql show users
S
scripts  
slguan 已提交
52 53
print $data1_read
if $data1_read != readable then 
S
slguan 已提交
54 55 56 57 58
  return -1
endi

sql_error alter user read privilege super
sql show users
S
scripts  
slguan 已提交
59 60
print $data1_read
if $data1_read != readable then
S
slguan 已提交
61 62 63 64 65
  return -1
endi

sql alter user read privilege write
sql show users
S
scripts  
slguan 已提交
66 67
print $data1_read
if $data1_read != writable then 
S
slguan 已提交
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
  return -1
endi

sql alter user read privilege 1 -x step43
  return -1
step43:

sql drop user sys -x step41
  return -1
step41:

sql drop user stream -x step42
  return -1
step42:

sql drop user read