Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3b0a3e5b
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3b0a3e5b
编写于
4月 27, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: add user test cases into ci
上级
06d2ee37
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
27 addition
and
34 deletion
+27
-34
source/dnode/mnode/impl/src/mndProfile.c
source/dnode/mnode/impl/src/mndProfile.c
+1
-1
source/dnode/mnode/impl/src/mndUser.c
source/dnode/mnode/impl/src/mndUser.c
+1
-1
tests/script/general/user/user_create.sim
tests/script/general/user/user_create.sim
+2
-4
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+3
-0
tests/script/tsim/user/pass_alter.sim
tests/script/tsim/user/pass_alter.sim
+9
-11
tests/script/tsim/user/pass_len.sim
tests/script/tsim/user/pass_len.sim
+3
-4
tests/script/tsim/user/user_len.sim
tests/script/tsim/user/user_len.sim
+8
-13
未找到文件。
source/dnode/mnode/impl/src/mndProfile.c
浏览文件 @
3b0a3e5b
...
...
@@ -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
;
}
...
...
source/dnode/mnode/impl/src/mndUser.c
浏览文件 @
3b0a3e5b
...
...
@@ -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
)
{
...
...
tests/script/general/user/user_create.sim
浏览文件 @
3b0a3e5b
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
...
...
tests/script/jenkins/basic.txt
浏览文件 @
3b0a3e5b
...
...
@@ -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
...
...
tests/script/
general
/user/pass_alter.sim
→
tests/script/
tsim
/user/pass_alter.sim
浏览文件 @
3b0a3e5b
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 read
1
pass 'taosdata1'
sql_error create user write
1
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 read
2
pass 'taosdata1'
sql_error create user write
2
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
...
...
tests/script/
general
/user/pass_len.sim
→
tests/script/
tsim
/user/pass_len.sim
浏览文件 @
3b0a3e5b
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 'abcd012345678901234567891234567890
abcd012345678901234567891234567890abcd012345678901234567891234567890abcd012345678901234567891234567890123
' -x step4
return -1
step4:
sql show users
if $rows != 4 then
...
...
tests/script/
general
/user/user_len.sim
→
tests/script/
tsim
/user/user_len.sim
浏览文件 @
3b0a3e5b
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录