提交 8e2d4811 编写于 作者: S slguan

[TD-16] add script for account

上级 4dac7f04
......@@ -93,7 +93,7 @@ int32_t tscInitRpc(const char *user, const char *secret) {
rpcInit.sessions = tsMaxMgmtConnections;
rpcInit.connType = TAOS_CONN_CLIENT;
rpcInit.idleTime = 2000;
rpcInit.user = "root";
rpcInit.user = (char*)user;
rpcInit.ckey = "key";
rpcInit.secret = secretEncrypt;
......
......@@ -90,9 +90,9 @@ echo "logDir $LOG_DIR" >> $TAOS_CFG
echo "publicIp $NODE_IP" >> $TAOS_CFG
echo "internalIp $NODE_IP" >> $TAOS_CFG
echo "privateIp $NODE_IP" >> $TAOS_CFG
echo "dDebugFlag 199" >> $TAOS_CFG
echo "dDebugFlag 135" >> $TAOS_CFG
echo "mDebugFlag 199" >> $TAOS_CFG
echo "sdbDebugFlag 199" >> $TAOS_CFG
echo "sdbDebugFlag 135" >> $TAOS_CFG
echo "rpcDebugFlag 135" >> $TAOS_CFG
echo "tmrDebugFlag 131" >> $TAOS_CFG
echo "cDebugFlag 135" >> $TAOS_CFG
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/exec_up.sh -n dnode1 -s start
sql connect
print =============== show accounts
sql show accounts
if $rows != 1 then
return -1
endi
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != root then
return -1
endi
if $data02 != 3/10 then
return -1
endi
if $data03 != 0/64 then
return -1
endi
if $data04 != 0/2147483647 then
return -1
endi
if $data05 != 0/1000 then
return -1
endi
if $data06 != 0.000/unlimited then
return -1
endi
print =============== create account
sql create account hou pass "hou" tseries 80000 storage 10737418240 streams 10 qtime 3600 dbs 3 users 3 conns 10
sql show accounts
if $rows != 2 then
return -1
endi
print $data10 $data11 $data12 $data13 $data14 $data15 $data16
if $data10 != hou then
return -1
endi
if $data12 != 2/3 then
return -1
endi
if $data13 != 0/3 then
return -1
endi
if $data14 != 0/80000 then
return -1
endi
if $data15 != 0/10 then
return -1
endi
if $data16 != 0.000/10.000 then
return -1
endi
print =============== alter account
sql alter account hou pass "hou" tseries 8000 streams 10 dbs 5 users 5
sql show accounts
if $rows != 2 then
return -1
endi
print $data10 $data11 $data12 $data13 $data14 $data15 $data16
if $data10 != hou then
return -1
endi
if $data12 != 2/5 then
return -1
endi
if $data13 != 0/5 then
return -1
endi
if $data14 != 0/8000 then
return -1
endi
if $data15 != 0/10 then
return -1
endi
if $data16 != 0.000/10.000 then
return -1
endi
print =============== alter account
sql create account hou pass "hou" tseries 8000 streams 10 dbs 5 users 6
sql show accounts
if $rows != 2 then
return -1
endi
print $data10 $data11 $data12 $data13 $data14 $data15 $data16
if $data10 != hou then
return -1
endi
if $data12 != 2/6 then
return -1
endi
if $data13 != 0/5 then
return -1
endi
if $data14 != 0/8000 then
return -1
endi
if $data15 != 0/10 then
return -1
endi
if $data16 != 0.000/10.000 then
return -1
endi
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/exec_up.sh -n dnode1 -s start
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
print =============== check usage account
sql create database d1
sql create database d2
sql create database d3
sql create database d4
sql create database d5
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
print =============== check grant
sql_error create database d6
\ No newline at end of file
#################################
run unique/account/basic.sim
run unique/account/paras.sim
run unique/account/usage.sim
##################################
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册