user_create.sim 1.3 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
Shengliang Guan 已提交
4
system sh/exec.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

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:
C
chang 已提交
38
sql drop user _root -x step32
S
slguan 已提交
39 40
  return -1
step32:
C
chang 已提交
41
sql drop user monitor -x step33
S
slguan 已提交
42 43 44 45 46 47 48 49 50 51
  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
if $data1_read != writable then 
S
slguan 已提交
67 68 69 70 71 72 73
  return -1
endi

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

C
chang 已提交
74
sql drop user _root -x step41
S
slguan 已提交
75 76 77
  return -1
step41:

C
chang 已提交
78
sql drop user monitor -x step42
S
slguan 已提交
79 80 81 82 83
  return -1
step42:

sql drop user read

S
Shengliang Guan 已提交
84
system sh/exec.sh -n dnode1 -s stop  -x SIGINT