Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ac7a543b
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看板
提交
ac7a543b
编写于
12月 15, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-10431 acct test
上级
c8a74657
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
111 addition
and
97 deletion
+111
-97
source/dnode/mgmt/impl/test/CMakeLists.txt
source/dnode/mgmt/impl/test/CMakeLists.txt
+1
-1
source/dnode/mgmt/impl/test/acct/CMakeLists.txt
source/dnode/mgmt/impl/test/acct/CMakeLists.txt
+6
-6
source/dnode/mgmt/impl/test/acct/acct.cpp
source/dnode/mgmt/impl/test/acct/acct.cpp
+13
-10
source/dnode/mgmt/impl/test/db/db.cpp
source/dnode/mgmt/impl/test/db/db.cpp
+79
-67
source/dnode/mgmt/impl/test/dnode/dnode.cpp
source/dnode/mgmt/impl/test/dnode/dnode.cpp
+7
-7
source/dnode/mgmt/impl/test/user/user.cpp
source/dnode/mgmt/impl/test/user/user.cpp
+5
-5
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+0
-1
未找到文件。
source/dnode/mgmt/impl/test/CMakeLists.txt
浏览文件 @
ac7a543b
#
add_subdirectory(acct)
add_subdirectory
(
acct
)
# add_subdirectory(auth)
# add_subdirectory(auth)
# add_subdirectory(balance)
# add_subdirectory(balance)
# add_subdirectory(cluster)
# add_subdirectory(cluster)
...
...
source/dnode/mgmt/impl/test/acct/CMakeLists.txt
浏览文件 @
ac7a543b
add_executable
(
dn
dTestA
cct
""
)
add_executable
(
dn
ode_test_a
cct
""
)
target_sources
(
dn
dTestA
cct
target_sources
(
dn
ode_test_a
cct
PRIVATE
PRIVATE
"acct.cpp"
"acct.cpp"
"../sut/deploy.cpp"
"../sut/deploy.cpp"
)
)
target_link_libraries
(
target_link_libraries
(
dn
dTestA
cct
dn
ode_test_a
cct
PUBLIC dnode
PUBLIC dnode
PUBLIC util
PUBLIC util
PUBLIC os
PUBLIC os
PUBLIC gtest_main
PUBLIC gtest_main
)
)
target_include_directories
(
dn
dTestA
cct
target_include_directories
(
dn
ode_test_a
cct
PUBLIC
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/server/dnode/mgmt"
"
${
CMAKE_SOURCE_DIR
}
/include/server/dnode/mgmt"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../inc"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../inc"
...
@@ -24,6 +24,6 @@ target_include_directories(dndTestAcct
...
@@ -24,6 +24,6 @@ target_include_directories(dndTestAcct
enable_testing
()
enable_testing
()
add_test
(
add_test
(
NAME dn
dTestA
cct
NAME dn
ode_test_a
cct
COMMAND dn
dTestA
cct
COMMAND dn
ode_test_a
cct
)
)
source/dnode/mgmt/impl/test/acct/acct.cpp
浏览文件 @
ac7a543b
...
@@ -17,24 +17,27 @@
...
@@ -17,24 +17,27 @@
class
DndTestAcct
:
public
::
testing
::
Test
{
class
DndTestAcct
:
public
::
testing
::
Test
{
protected:
protected:
void
SetUp
()
override
{}
static
SServer
*
CreateServer
(
const
char
*
path
,
const
char
*
fqdn
,
uint16_t
port
,
const
char
*
firstEp
)
{
void
TearDown
()
override
{}
SServer
*
pServer
=
createServer
(
path
,
fqdn
,
port
,
firstEp
);
ASSERT
(
pServer
);
return
pServer
;
}
static
void
SetUpTestSuite
()
{
static
void
SetUpTestSuite
()
{
const
char
*
user
=
"root"
;
initLog
(
"/tmp/tdlog"
);
const
char
*
pass
=
"taosdata"
;
const
char
*
path
=
"/tmp/dndTestAcct"
;
const
char
*
fqdn
=
"localhost"
;
uint16_t
port
=
9520
;
pServer
=
createServer
(
path
,
fqdn
,
port
);
const
char
*
fqdn
=
"localhost"
;
ASSERT
(
pServer
);
const
char
*
firstEp
=
"localhost:9012"
;
pClient
=
createClient
(
user
,
pass
,
fqdn
,
port
);
pServer
=
CreateServer
(
"/tmp/dnode_test_user"
,
fqdn
,
9012
,
firstEp
);
pClient
=
createClient
(
"root"
,
"taosdata"
,
fqdn
,
9012
);
taosMsleep
(
300
);
}
}
static
void
TearDownTestSuite
()
{
static
void
TearDownTestSuite
()
{
stopServer
(
pServer
);
stopServer
(
pServer
);
dropClient
(
pClient
);
dropClient
(
pClient
);
pServer
=
NULL
;
pClient
=
NULL
;
}
}
static
SServer
*
pServer
;
static
SServer
*
pServer
;
...
...
source/dnode/mgmt/impl/test/db/db.cpp
浏览文件 @
ac7a543b
...
@@ -182,7 +182,7 @@ SServer* DndTestDb::pServer;
...
@@ -182,7 +182,7 @@ SServer* DndTestDb::pServer;
SClient
*
DndTestDb
::
pClient
;
SClient
*
DndTestDb
::
pClient
;
int32_t
DndTestDb
::
connId
;
int32_t
DndTestDb
::
connId
;
TEST_F
(
DndTestDb
,
ShowDb
)
{
TEST_F
(
DndTestDb
,
01
_
ShowDb
)
{
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_DB
,
"show databases"
,
16
);
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_DB
,
"show databases"
,
16
);
CheckSchema
(
0
,
TSDB_DATA_TYPE_BINARY
,
TSDB_DB_NAME_LEN
-
1
+
VARSTR_HEADER_SIZE
,
"name"
);
CheckSchema
(
0
,
TSDB_DATA_TYPE_BINARY
,
TSDB_DB_NAME_LEN
-
1
+
VARSTR_HEADER_SIZE
,
"name"
);
CheckSchema
(
1
,
TSDB_DATA_TYPE_TIMESTAMP
,
8
,
"create time"
);
CheckSchema
(
1
,
TSDB_DATA_TYPE_TIMESTAMP
,
8
,
"create time"
);
...
@@ -204,7 +204,7 @@ TEST_F(DndTestDb, ShowDb) {
...
@@ -204,7 +204,7 @@ TEST_F(DndTestDb, ShowDb) {
SendThenCheckShowRetrieveMsg
(
0
);
SendThenCheckShowRetrieveMsg
(
0
);
}
}
TEST_F
(
DndTestDb
,
CreateDb_01
)
{
TEST_F
(
DndTestDb
,
02
_CreateDb
)
{
{
{
SCreateDbMsg
*
pReq
=
(
SCreateDbMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateDbMsg
));
SCreateDbMsg
*
pReq
=
(
SCreateDbMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateDbMsg
));
strcpy
(
pReq
->
db
,
"1.d1"
);
strcpy
(
pReq
->
db
,
"1.d1"
);
...
@@ -258,65 +258,51 @@ TEST_F(DndTestDb, CreateDb_01) {
...
@@ -258,65 +258,51 @@ TEST_F(DndTestDb, CreateDb_01) {
CheckInt8
(
0
);
// update
CheckInt8
(
0
);
// update
}
}
#if 0
TEST_F
(
DndTestDb
,
03
_AlterDb
)
{
TEST_F(DndTestDb, AlterUser_01) {
{
SAlterUserMsg* pReq = (SAlterUserMsg*)rpcMallocCont(sizeof(SAlterUserMsg));
SAlterDbMsg
*
pReq
=
(
SAlterDbMsg
*
)
rpcMallocCont
(
sizeof
(
SAlterDbMsg
));
strcpy(pReq->user, "u1");
strcpy
(
pReq
->
db
,
"1.d1"
);
strcpy(pReq->pass, "p2");
pReq
->
totalBlocks
=
htonl
(
12
);
pReq
->
daysToKeep0
=
htonl
(
300
);
SRpcMsg rpcMsg = {0};
pReq
->
daysToKeep1
=
htonl
(
400
);
rpcMsg.pCont = pReq;
pReq
->
daysToKeep2
=
htonl
(
500
);
rpcMsg.contLen = sizeof(SAlterUserMsg);
pReq
->
fsyncPeriod
=
htonl
(
4000
);
rpcMsg.msgType = TSDB_MSG_TYPE_ALTER_USER;
pReq
->
walLevel
=
2
;
pReq
->
quorum
=
2
;
sendMsg(pClient, &rpcMsg);
pReq
->
cacheLastRow
=
1
;
SRpcMsg* pMsg = pClient->pRsp;
ASSERT_NE(pMsg, nullptr);
ASSERT_EQ(pMsg->code, 0);
SendTheCheckShowMetaMsg(TSDB_MGMT_TABLE_USER, "show users", 4);
SendThenCheckShowRetrieveMsg(3);
CheckBinary("u1", TSDB_USER_LEN);
CheckBinary("root", TSDB_USER_LEN);
CheckBinary("u2", TSDB_USER_LEN);
CheckBinary("normal", 10);
CheckBinary("super", 10);
CheckBinary("normal", 10);
CheckTimestamp();
CheckTimestamp();
CheckTimestamp();
CheckBinary("root", TSDB_USER_LEN);
CheckBinary("root", TSDB_USER_LEN);
CheckBinary("root", TSDB_USER_LEN);
}
TEST_F(DndTestDb, DropUser_01) {
SRpcMsg
rpcMsg
=
{
0
};
SDropUserMsg* pReq = (SDropUserMsg*)rpcMallocCont(sizeof(SDropUserMsg));
rpcMsg
.
pCont
=
pReq
;
strcpy(pReq->user, "u1");
rpcMsg
.
contLen
=
sizeof
(
SAlterDbMsg
);
rpcMsg
.
msgType
=
TSDB_MSG_TYPE_ALTER_DB
;
SRpcMsg rpcMsg = {0};
rpcMsg.pCont = pReq;
sendMsg
(
pClient
,
&
rpcMsg
);
rpcMsg.contLen = sizeof(SDropUserMsg);
SRpcMsg
*
pMsg
=
pClient
->
pRsp
;
rpcMsg.msgType = TSDB_MSG_TYPE_DROP_USER;
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
sendMsg(pClient, &rpcMsg);
}
SRpcMsg* pMsg = pClient->pRsp;
ASSERT_NE(pMsg, nullptr);
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_DB
,
"show databases"
,
16
);
ASSERT_EQ(pMsg->code, 0);
SendThenCheckShowRetrieveMsg
(
1
);
CheckBinary
(
"d1"
,
TSDB_DB_NAME_LEN
-
1
);
SendTheCheckShowMetaMsg(TSDB_MGMT_TABLE_USER, "show users", 4);
SendThenCheckShowRetrieveMsg(2);
CheckBinary("root", TSDB_USER_LEN);
CheckBinary("u2", TSDB_USER_LEN);
CheckBinary("super", 10);
CheckBinary("normal", 10);
CheckTimestamp();
CheckTimestamp
();
CheckTimestamp
();
CheckBinary("root", TSDB_USER_LEN);
CheckInt16
(
1
);
// replica
CheckBinary("root", TSDB_USER_LEN);
CheckInt16
(
2
);
// quorum
CheckInt16
(
10
);
// days
CheckBinary
(
"300,400,500"
,
24
);
// days
CheckInt32
(
16
);
// cache
CheckInt32
(
12
);
// blocks
CheckInt32
(
100
);
// minrows
CheckInt32
(
4096
);
// maxrows
CheckInt8
(
2
);
// wallevel
CheckInt32
(
4000
);
// fsync
CheckInt8
(
2
);
// comp
CheckInt8
(
1
);
// cachelast
CheckBinary
(
"ms"
,
3
);
// precision
CheckInt8
(
0
);
// update
}
}
TEST_F(DndTestDb, RestartDnode) {
TEST_F
(
DndTestDb
,
04
_
RestartDnode
)
{
stopServer
(
pServer
);
stopServer
(
pServer
);
pServer
=
NULL
;
pServer
=
NULL
;
...
@@ -328,16 +314,42 @@ TEST_F(DndTestDb, RestartDnode) {
...
@@ -328,16 +314,42 @@ TEST_F(DndTestDb, RestartDnode) {
uInfo
(
"all server is running"
);
uInfo
(
"all server is running"
);
SendTheCheckShowMetaMsg(TSDB_MGMT_TABLE_USER, "show users", 4);
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_DB
,
"show databases"
,
16
);
SendThenCheckShowRetrieveMsg(2);
SendThenCheckShowRetrieveMsg
(
1
);
CheckBinary("root", TSDB_USER_LEN);
CheckBinary
(
"d1"
,
TSDB_DB_NAME_LEN
-
1
);
CheckBinary("u2", TSDB_USER_LEN);
CheckBinary("super", 10);
CheckBinary("normal", 10);
CheckTimestamp();
CheckTimestamp
();
CheckTimestamp
();
CheckBinary("root", TSDB_USER_LEN);
CheckInt16
(
1
);
// replica
CheckBinary("root", TSDB_USER_LEN);
CheckInt16
(
2
);
// quorum
CheckInt16
(
10
);
// days
CheckBinary
(
"300,400,500"
,
24
);
// days
CheckInt32
(
16
);
// cache
CheckInt32
(
12
);
// blocks
CheckInt32
(
100
);
// minrows
CheckInt32
(
4096
);
// maxrows
CheckInt8
(
2
);
// wallevel
CheckInt32
(
4000
);
// fsync
CheckInt8
(
2
);
// comp
CheckInt8
(
1
);
// cachelast
CheckBinary
(
"ms"
,
3
);
// precision
CheckInt8
(
0
);
// update
}
}
#endif
TEST_F
(
DndTestDb
,
05
_DropDb
)
{
\ No newline at end of file
{
SDropDbMsg
*
pReq
=
(
SDropDbMsg
*
)
rpcMallocCont
(
sizeof
(
SAlterDbMsg
));
strcpy
(
pReq
->
db
,
"1.d1"
);
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
pCont
=
pReq
;
rpcMsg
.
contLen
=
sizeof
(
SDropDbMsg
);
rpcMsg
.
msgType
=
TSDB_MSG_TYPE_DROP_DB
;
sendMsg
(
pClient
,
&
rpcMsg
);
SRpcMsg
*
pMsg
=
pClient
->
pRsp
;
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
}
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_DB
,
"show databases"
,
16
);
SendThenCheckShowRetrieveMsg
(
0
);
}
\ No newline at end of file
source/dnode/mgmt/impl/test/dnode/dnode.cpp
浏览文件 @
ac7a543b
...
@@ -24,7 +24,7 @@ class DndTestDnode : public ::testing::Test {
...
@@ -24,7 +24,7 @@ class DndTestDnode : public ::testing::Test {
}
}
static
void
SetUpTestSuite
()
{
static
void
SetUpTestSuite
()
{
initLog
(
"/tmp/
dnode_test_dnode
"
);
initLog
(
"/tmp/
tdlog
"
);
const
char
*
fqdn
=
"localhost"
;
const
char
*
fqdn
=
"localhost"
;
const
char
*
firstEp
=
"localhost:9041"
;
const
char
*
firstEp
=
"localhost:9041"
;
...
@@ -188,7 +188,7 @@ SServer* DndTestDnode::pServer4;
...
@@ -188,7 +188,7 @@ SServer* DndTestDnode::pServer4;
SServer
*
DndTestDnode
::
pServer5
;
SServer
*
DndTestDnode
::
pServer5
;
SClient
*
DndTestDnode
::
pClient
;
SClient
*
DndTestDnode
::
pClient
;
TEST_F
(
DndTestDnode
,
ShowDnode
)
{
TEST_F
(
DndTestDnode
,
01
_
ShowDnode
)
{
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_DNODE
,
"show dnodes"
,
7
);
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_DNODE
,
"show dnodes"
,
7
);
CheckSchema
(
0
,
TSDB_DATA_TYPE_SMALLINT
,
2
,
"id"
);
CheckSchema
(
0
,
TSDB_DATA_TYPE_SMALLINT
,
2
,
"id"
);
CheckSchema
(
1
,
TSDB_DATA_TYPE_BINARY
,
TSDB_EP_LEN
+
VARSTR_HEADER_SIZE
,
"end point"
);
CheckSchema
(
1
,
TSDB_DATA_TYPE_BINARY
,
TSDB_EP_LEN
+
VARSTR_HEADER_SIZE
,
"end point"
);
...
@@ -208,7 +208,7 @@ TEST_F(DndTestDnode, ShowDnode) {
...
@@ -208,7 +208,7 @@ TEST_F(DndTestDnode, ShowDnode) {
CheckBinary
(
""
,
24
);
CheckBinary
(
""
,
24
);
}
}
TEST_F
(
DndTestDnode
,
ConfigDnode_01
)
{
TEST_F
(
DndTestDnode
,
02
_ConfigDnode
)
{
SCfgDnodeMsg
*
pReq
=
(
SCfgDnodeMsg
*
)
rpcMallocCont
(
sizeof
(
SCfgDnodeMsg
));
SCfgDnodeMsg
*
pReq
=
(
SCfgDnodeMsg
*
)
rpcMallocCont
(
sizeof
(
SCfgDnodeMsg
));
pReq
->
dnodeId
=
htonl
(
1
);
pReq
->
dnodeId
=
htonl
(
1
);
strcpy
(
pReq
->
config
,
"ddebugflag 131"
);
strcpy
(
pReq
->
config
,
"ddebugflag 131"
);
...
@@ -224,7 +224,7 @@ TEST_F(DndTestDnode, ConfigDnode_01) {
...
@@ -224,7 +224,7 @@ TEST_F(DndTestDnode, ConfigDnode_01) {
ASSERT_EQ
(
pMsg
->
code
,
0
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
}
}
TEST_F
(
DndTestDnode
,
CreateDnode_01
)
{
TEST_F
(
DndTestDnode
,
03
_CreateDnode
)
{
SCreateDnodeMsg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateDnodeMsg
));
SCreateDnodeMsg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateDnodeMsg
));
strcpy
(
pReq
->
ep
,
"localhost:9042"
);
strcpy
(
pReq
->
ep
,
"localhost:9042"
);
...
@@ -257,7 +257,7 @@ TEST_F(DndTestDnode, CreateDnode_01) {
...
@@ -257,7 +257,7 @@ TEST_F(DndTestDnode, CreateDnode_01) {
CheckBinary
(
""
,
24
);
CheckBinary
(
""
,
24
);
}
}
TEST_F
(
DndTestDnode
,
DropDnode_01
)
{
TEST_F
(
DndTestDnode
,
04
_DropDnode
)
{
SDropDnodeMsg
*
pReq
=
(
SDropDnodeMsg
*
)
rpcMallocCont
(
sizeof
(
SDropDnodeMsg
));
SDropDnodeMsg
*
pReq
=
(
SDropDnodeMsg
*
)
rpcMallocCont
(
sizeof
(
SDropDnodeMsg
));
pReq
->
dnodeId
=
htonl
(
2
);
pReq
->
dnodeId
=
htonl
(
2
);
...
@@ -282,7 +282,7 @@ TEST_F(DndTestDnode, DropDnode_01) {
...
@@ -282,7 +282,7 @@ TEST_F(DndTestDnode, DropDnode_01) {
CheckBinary
(
""
,
24
);
CheckBinary
(
""
,
24
);
}
}
TEST_F
(
DndTestDnode
,
CreateDnode_02
)
{
TEST_F
(
DndTestDnode
,
05
_CreateDnode
)
{
{
{
SCreateDnodeMsg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateDnodeMsg
));
SCreateDnodeMsg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateDnodeMsg
));
strcpy
(
pReq
->
ep
,
"localhost:9043"
);
strcpy
(
pReq
->
ep
,
"localhost:9043"
);
...
@@ -361,7 +361,7 @@ TEST_F(DndTestDnode, CreateDnode_02) {
...
@@ -361,7 +361,7 @@ TEST_F(DndTestDnode, CreateDnode_02) {
CheckBinary
(
""
,
24
);
CheckBinary
(
""
,
24
);
}
}
TEST_F
(
DndTestDnode
,
RestartDnode_01
)
{
TEST_F
(
DndTestDnode
,
06
_RestartDnode
)
{
uInfo
(
"stop all server"
);
uInfo
(
"stop all server"
);
stopServer
(
pServer1
);
stopServer
(
pServer1
);
stopServer
(
pServer2
);
stopServer
(
pServer2
);
...
...
source/dnode/mgmt/impl/test/user/user.cpp
浏览文件 @
ac7a543b
...
@@ -170,7 +170,7 @@ SServer* DndTestUser::pServer;
...
@@ -170,7 +170,7 @@ SServer* DndTestUser::pServer;
SClient
*
DndTestUser
::
pClient
;
SClient
*
DndTestUser
::
pClient
;
int32_t
DndTestUser
::
connId
;
int32_t
DndTestUser
::
connId
;
TEST_F
(
DndTestUser
,
ShowUser
)
{
TEST_F
(
DndTestUser
,
01
_
ShowUser
)
{
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_USER
,
"show users"
,
4
);
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_USER
,
"show users"
,
4
);
CheckSchema
(
0
,
TSDB_DATA_TYPE_BINARY
,
TSDB_USER_LEN
+
VARSTR_HEADER_SIZE
,
"name"
);
CheckSchema
(
0
,
TSDB_DATA_TYPE_BINARY
,
TSDB_USER_LEN
+
VARSTR_HEADER_SIZE
,
"name"
);
CheckSchema
(
1
,
TSDB_DATA_TYPE_BINARY
,
10
+
VARSTR_HEADER_SIZE
,
"privilege"
);
CheckSchema
(
1
,
TSDB_DATA_TYPE_BINARY
,
10
+
VARSTR_HEADER_SIZE
,
"privilege"
);
...
@@ -184,7 +184,7 @@ TEST_F(DndTestUser, ShowUser) {
...
@@ -184,7 +184,7 @@ TEST_F(DndTestUser, ShowUser) {
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
}
}
TEST_F
(
DndTestUser
,
CreateUser_01
)
{
TEST_F
(
DndTestUser
,
02
_CreateUser
)
{
{
{
SCreateUserMsg
*
pReq
=
(
SCreateUserMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateUserMsg
));
SCreateUserMsg
*
pReq
=
(
SCreateUserMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateUserMsg
));
strcpy
(
pReq
->
user
,
"u1"
);
strcpy
(
pReq
->
user
,
"u1"
);
...
@@ -233,7 +233,7 @@ TEST_F(DndTestUser, CreateUser_01) {
...
@@ -233,7 +233,7 @@ TEST_F(DndTestUser, CreateUser_01) {
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
}
}
TEST_F
(
DndTestUser
,
AlterUser_01
)
{
TEST_F
(
DndTestUser
,
03
_AlterUser
)
{
SAlterUserMsg
*
pReq
=
(
SAlterUserMsg
*
)
rpcMallocCont
(
sizeof
(
SAlterUserMsg
));
SAlterUserMsg
*
pReq
=
(
SAlterUserMsg
*
)
rpcMallocCont
(
sizeof
(
SAlterUserMsg
));
strcpy
(
pReq
->
user
,
"u1"
);
strcpy
(
pReq
->
user
,
"u1"
);
strcpy
(
pReq
->
pass
,
"p2"
);
strcpy
(
pReq
->
pass
,
"p2"
);
...
@@ -264,7 +264,7 @@ TEST_F(DndTestUser, AlterUser_01) {
...
@@ -264,7 +264,7 @@ TEST_F(DndTestUser, AlterUser_01) {
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
}
}
TEST_F
(
DndTestUser
,
DropUser_01
)
{
TEST_F
(
DndTestUser
,
04
_DropUser
)
{
SDropUserMsg
*
pReq
=
(
SDropUserMsg
*
)
rpcMallocCont
(
sizeof
(
SDropUserMsg
));
SDropUserMsg
*
pReq
=
(
SDropUserMsg
*
)
rpcMallocCont
(
sizeof
(
SDropUserMsg
));
strcpy
(
pReq
->
user
,
"u1"
);
strcpy
(
pReq
->
user
,
"u1"
);
...
@@ -290,7 +290,7 @@ TEST_F(DndTestUser, DropUser_01) {
...
@@ -290,7 +290,7 @@ TEST_F(DndTestUser, DropUser_01) {
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
}
}
TEST_F
(
DndTestUser
,
RestartDnode
)
{
TEST_F
(
DndTestUser
,
05
_
RestartDnode
)
{
stopServer
(
pServer
);
stopServer
(
pServer
);
pServer
=
NULL
;
pServer
=
NULL
;
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
ac7a543b
...
@@ -646,7 +646,6 @@ static int32_t mndProcessDropDbMsg(SMnodeMsg *pMsg) {
...
@@ -646,7 +646,6 @@ static int32_t mndProcessDropDbMsg(SMnodeMsg *pMsg) {
mndReleaseDb
(
pMnode
,
pDb
);
mndReleaseDb
(
pMnode
,
pDb
);
if
(
code
!=
0
)
{
if
(
code
!=
0
)
{
terrno
=
code
;
mError
(
"db:%s, failed to drop since %s"
,
pDrop
->
db
,
terrstr
());
mError
(
"db:%s, failed to drop since %s"
,
pDrop
->
db
,
terrstr
());
return
code
;
return
code
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录