usage.sim 2.9 KB
Newer Older
S
slguan 已提交
1
system sh/stop_dnodes.sh
S
slguan 已提交
2
system sh/deploy.sh -n dnode1 -i 1
S
Shengliang Guan 已提交
3
system sh/exec.sh -n dnode1 -s start
4 5
#system sh/exec.sh -n monitor -s 1
system sh/exec.sh -n monitorInterval -s 1
S
scripts  
Shengliang Guan 已提交
6
sleep 3000
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
sql connect

print =============== show accounts

print =============== create account
sql alter account root pass "taosdata" tseries 8000 streams 10 dbs 5 users 5  
sql show accounts
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != root then 
  return -1
endi
if $data02 != 3/5 then 
  return -1
endi
if $data03 != 0/5 then 
  return -1
endi
if $data04 != 0/8000 then 
  return -1
endi
if $data05 != 0/10 then 
  return -1
endi
30 31 32 33
if $data06 != 0.000/unlimited then 
  return -1
endi  

S
slguan 已提交
34
print =============== check usage account
35 36 37 38 39
sql create database d1 wal 2
sql create database d2 wal 2
sql create database d3 wal 2
sql create database d4 wal 2
sql create database d5 wal 2
S
slguan 已提交
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60

sql create table d1.t1 (ts timestamp, i int);
sql create user u1 pass "u1"

sql show accounts
print $data10 $data11 $data12 $data13 $data14 $data15 $data16
if $data00 != root then 
  return -1
endi
if $data02 != 4/5 then 
  return -1
endi
if $data03 != 5/5 then 
  return -1
endi
if $data04 != 1/8000 then 
  return -1
endi
if $data05 != 0/10 then 
  return -1
endi
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 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
if $data06 != 0.000/unlimited then 
  return -1
endi

print =============== step2
sql alter account root pass "taosdata" tseries 10 storage 1073741824 streams 10 dbs 5 users 5
sql show accounts
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != root then 
  return -1
endi
if $data02 != 4/5 then 
  return -1
endi
if $data03 != 5/5 then 
  return -1
endi
if $data04 != 1/10 then 
  return -1
endi
if $data05 != 0/10 then 
  return -1
endi
if $data06 != 0.000/1.000 then 
  return -1
endi
  
print =============== step3
sql alter account root pass "taosdata" tseries 10 storage 16 streams 10 dbs 5 users 5
sql show accounts
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != root then 
  return -1
endi
if $data02 != 4/5 then 
  return -1
endi
if $data03 != 5/5 then 
  return -1
endi
if $data04 != 1/10 then 
  return -1
endi
if $data05 != 0/10 then 
  return -1
endi
if $data06 != 0.000/0.000 then 
  return -1
endi

print =============== step4
sql insert into d1.t1 values(now + 1s, 1)
sql insert into d1.t1 values(now + 2s, 2)

115 116
sleep 10000
print no write auth
117 118 119 120
sql_error insert into d1.t1 values(now + 3s, 2)
sql_error insert into d1.t1 values(now + 4s, 2)

sql alter account root pass "taosdata" tseries 10 storage 36 streams 10 dbs 5 users 5
121 122
sleep 10000
print has write auth
123 124 125 126
sql insert into d1.t1 values(now + 5s, 1)
sql insert into d1.t1 values(now + 6s, 2)

# no write auth
127 128
sleep 10000
print no write auth
129 130 131
sql_error insert into d1.t1 values(now + 7s, 2)
sql_error insert into d1.t1 values(now + 8s, 2)

S
slguan 已提交
132
print =============== check grant
S
scripts  
slguan 已提交
133 134
sql_error create database d6

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