提交 3b0a3e5b 编写于 作者: S Shengliang Guan

test: add user test cases into ci

上级 06d2ee37
......@@ -196,7 +196,7 @@ static int32_t mndProcessConnectReq(SNodeMsg *pReq) {
goto CONN_OVER;
}
if (0 != strncmp(connReq.passwd, pUser->pass, TSDB_PASSWORD_LEN - 1)) {
mError("user:%s, failed to auth while acquire user\n %s \r\n %s", pReq->user, connReq.passwd, pUser->pass);
mError("user:%s, failed to auth while acquire user, input:%s saved:%s", pReq->user, connReq.passwd, pUser->pass);
code = TSDB_CODE_RPC_AUTH_FAILURE;
goto CONN_OVER;
}
......
......@@ -441,7 +441,7 @@ static int32_t mndProcessAlterUserReq(SNodeMsg *pReq) {
if (alterReq.alterType == TSDB_ALTER_USER_PASSWD) {
char pass[TSDB_PASSWORD_LEN + 1] = {0};
taosEncryptPass_c((uint8_t *)alterReq.pass, strlen(alterReq.pass), pass);
memcpy(pUser->pass, pass, TSDB_PASSWORD_LEN);
memcpy(newUser.pass, pass, TSDB_PASSWORD_LEN);
} else if (alterReq.alterType == TSDB_ALTER_USER_SUPERUSER) {
newUser.superUser = alterReq.superUser;
} else if (alterReq.alterType == TSDB_ALTER_USER_ADD_READ_DB) {
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/exec.sh -n dnode1 -s start
sql connect
print =============== step1
sql show users
if $rows != 3 then
if $rows != 1 then
return -1
endi
......@@ -17,7 +15,7 @@ sql create user read PASS 'pass123' -x step1
step1:
sql show users
if $rows != 4 then
if $rows != 2 then
return -1
endi
......
......@@ -3,6 +3,9 @@
# ---- user
./test.sh -f tsim/user/basic1.sim
./test.sh -f tsim/user/pass_alter.sim
./test.sh -f tsim/user/pass_len.sim
./test.sh -f tsim/user/user_len.sim
# ---- db
./test.sh -f tsim/db/create_all_options.sim
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print ============= step1
......@@ -13,7 +11,7 @@ sql alter user read pass 'taosdata'
sql alter user write pass 'taosdata'
sql show users
if $rows != 5 then
if $rows != 3 then
return -1
endi
......@@ -27,11 +25,11 @@ sql alter user write pass 'taosdata1' -x step2
return -1
step2:
sql_error create user read pass 'taosdata1'
sql_error create user write pass 'taosdata1'
sql_error create user read1 pass 'taosdata1'
sql_error create user write1 pass 'taosdata1'
sql show users
if $rows != 5 then
if $rows != 3 then
return -1
endi
......@@ -41,27 +39,27 @@ sleep 2500
print user write login
sql connect write
sql_error create user read pass 'taosdata1'
sql_error create user write pass 'taosdata1'
sql_error create user read2 pass 'taosdata1'
sql_error create user write2 pass 'taosdata1'
sql alter user write pass 'taosdata'
sql alter user read pass 'taosdata' -x step3
return -1
step3:
sql show users
if $rows != 5 then
if $rows != 3 then
return -1
endi
print ============= step4
sql close
sleep 2500
print root write login
print user root login
sql connect
sql create user oroot pass 'taosdata'
sql show users
if $rows != 6 then
if $rows != 4 then
return -1
endi
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/exec.sh -n dnode1 -s start
sql connect
......@@ -50,15 +48,16 @@ step3:
sql create user $user PASS 'abc0123456789'
sql show users
if $rows != 3 then
if $rows != 4 then
return -1
endi
print =============== step4
$i = 3
$user = $userPrefix . $i
sql create user $user PASS 'abcd012345678901234567891234567890' -x step4
sql create user $user PASS 'abcd012345678901234567891234567890abcd012345678901234567891234567890abcd012345678901234567891234567890abcd012345678901234567891234567890123' -x step4
return -1
step4:
sql show users
if $rows != 4 then
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
......@@ -24,7 +19,7 @@ sql create user PASS '123' -x step1
step1:
sql show users
if $rows != 3 then
if $rows != 1 then
return -1
endi
......@@ -33,13 +28,13 @@ sql drop user a -x step2
step2:
sql create user a PASS '123'
sql show users
if $rows != 4 then
if $rows != 2 then
return -1
endi
sql drop user a
sql show users
if $rows != 3 then
if $rows != 1 then
return -1
endi
......@@ -49,13 +44,13 @@ step3:
sql create user abc01234567890123456789 PASS '123'
sql show users
if $rows != 4 then
if $rows != 2 then
return -1
endi
sql drop user abc01234567890123456789
sql show users
if $rows != 3 then
if $rows != 1 then
return -1
endi
......@@ -64,7 +59,7 @@ sql create user abcd0123456789012345678901234567890111 PASS '123' -x step4
return -1
step4:
sql show users
if $rows != 3 then
if $rows != 1 then
return -1
endi
......@@ -77,13 +72,13 @@ step61:
sql create user a123 PASS '123'
sql show users
if $rows != 4 then
if $rows != 2 then
return -1
endi
sql drop user a123
sql show users
if $rows != 3 then
if $rows != 1 then
return -1
endi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册