Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d22296f2
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
d22296f2
编写于
12月 15, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename test name
上级
21c8fae2
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
370 addition
and
26 deletion
+370
-26
include/common/taosmsg.h
include/common/taosmsg.h
+0
-1
source/dnode/mgmt/impl/test/CMakeLists.txt
source/dnode/mgmt/impl/test/CMakeLists.txt
+1
-0
source/dnode/mgmt/impl/test/db/CMakeLists.txt
source/dnode/mgmt/impl/test/db/CMakeLists.txt
+29
-0
source/dnode/mgmt/impl/test/db/db.cpp
source/dnode/mgmt/impl/test/db/db.cpp
+315
-0
source/dnode/mgmt/impl/test/dnode/CMakeLists.txt
source/dnode/mgmt/impl/test/dnode/CMakeLists.txt
+6
-6
source/dnode/mgmt/impl/test/dnode/dnode.cpp
source/dnode/mgmt/impl/test/dnode/dnode.cpp
+10
-10
source/dnode/mgmt/impl/test/user/CMakeLists.txt
source/dnode/mgmt/impl/test/user/CMakeLists.txt
+6
-6
source/dnode/mgmt/impl/test/user/user.cpp
source/dnode/mgmt/impl/test/user/user.cpp
+3
-3
未找到文件。
include/common/taosmsg.h
浏览文件 @
d22296f2
...
...
@@ -632,7 +632,6 @@ typedef struct {
int32_t
reserve
[
8
];
}
SUseDbMsg
;
typedef
struct
{
char
db
[
TSDB_TABLE_FNAME_LEN
];
int32_t
reserve
[
8
];
...
...
source/dnode/mgmt/impl/test/CMakeLists.txt
浏览文件 @
d22296f2
# add_subdirectory(acct)
# add_subdirectory(cluster)
add_subdirectory
(
db
)
add_subdirectory
(
dnode
)
# add_subdirectory(profile)
# add_subdirectory(show)
...
...
source/dnode/mgmt/impl/test/db/CMakeLists.txt
0 → 100644
浏览文件 @
d22296f2
add_executable
(
dnode_test_db
""
)
target_sources
(
dnode_test_db
PRIVATE
"db.cpp"
"../sut/deploy.cpp"
)
target_link_libraries
(
dnode_test_db
PUBLIC dnode
PUBLIC util
PUBLIC os
PUBLIC gtest_main
)
target_include_directories
(
dnode_test_db
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/server/dnode/mgmt"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../inc"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../sut"
)
enable_testing
()
add_test
(
NAME dnode_test_db
COMMAND dnode_test_db
)
source/dnode/mgmt/impl/test/db/db.cpp
0 → 100644
浏览文件 @
d22296f2
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "deploy.h"
class
DndTestDb
:
public
::
testing
::
Test
{
protected:
static
SServer
*
CreateServer
(
const
char
*
path
,
const
char
*
fqdn
,
uint16_t
port
,
const
char
*
firstEp
)
{
SServer
*
pServer
=
createServer
(
path
,
fqdn
,
port
,
firstEp
);
ASSERT
(
pServer
);
return
pServer
;
}
static
void
SetUpTestSuite
()
{
initLog
(
"/tmp/dnode_test_db"
);
const
char
*
fqdn
=
"localhost"
;
const
char
*
firstEp
=
"localhost:9530"
;
pServer
=
CreateServer
(
"/tmp/dnode_test_db"
,
fqdn
,
9530
,
firstEp
);
pClient
=
createClient
(
"root"
,
"taosdata"
,
fqdn
,
9530
);
taosMsleep
(
300
);
}
static
void
TearDownTestSuite
()
{
stopServer
(
pServer
);
dropClient
(
pClient
);
pServer
=
NULL
;
pClient
=
NULL
;
}
static
SServer
*
pServer
;
static
SClient
*
pClient
;
static
int32_t
connId
;
public:
void
SetUp
()
override
{}
void
TearDown
()
override
{}
void
SendTheCheckShowMetaMsg
(
int8_t
showType
,
const
char
*
showName
,
int32_t
columns
)
{
SShowMsg
*
pShow
=
(
SShowMsg
*
)
rpcMallocCont
(
sizeof
(
SShowMsg
));
pShow
->
type
=
showType
;
strcpy
(
pShow
->
db
,
""
);
SRpcMsg
showRpcMsg
=
{
0
};
showRpcMsg
.
pCont
=
pShow
;
showRpcMsg
.
contLen
=
sizeof
(
SShowMsg
);
showRpcMsg
.
msgType
=
TSDB_MSG_TYPE_SHOW
;
sendMsg
(
pClient
,
&
showRpcMsg
);
ASSERT_NE
(
pClient
->
pRsp
,
nullptr
);
ASSERT_EQ
(
pClient
->
pRsp
->
code
,
0
);
ASSERT_NE
(
pClient
->
pRsp
->
pCont
,
nullptr
);
SShowRsp
*
pShowRsp
=
(
SShowRsp
*
)
pClient
->
pRsp
->
pCont
;
ASSERT_NE
(
pShowRsp
,
nullptr
);
pShowRsp
->
showId
=
htonl
(
pShowRsp
->
showId
);
pMeta
=
&
pShowRsp
->
tableMeta
;
pMeta
->
numOfTags
=
htons
(
pMeta
->
numOfTags
);
pMeta
->
numOfColumns
=
htons
(
pMeta
->
numOfColumns
);
pMeta
->
sversion
=
htons
(
pMeta
->
sversion
);
pMeta
->
tversion
=
htons
(
pMeta
->
tversion
);
pMeta
->
tuid
=
htobe64
(
pMeta
->
tuid
);
pMeta
->
suid
=
htobe64
(
pMeta
->
suid
);
showId
=
pShowRsp
->
showId
;
EXPECT_NE
(
pShowRsp
->
showId
,
0
);
EXPECT_STREQ
(
pMeta
->
tbFname
,
showName
);
EXPECT_EQ
(
pMeta
->
numOfTags
,
0
);
EXPECT_EQ
(
pMeta
->
numOfColumns
,
columns
);
EXPECT_EQ
(
pMeta
->
precision
,
0
);
EXPECT_EQ
(
pMeta
->
tableType
,
0
);
EXPECT_EQ
(
pMeta
->
update
,
0
);
EXPECT_EQ
(
pMeta
->
sversion
,
0
);
EXPECT_EQ
(
pMeta
->
tversion
,
0
);
EXPECT_EQ
(
pMeta
->
tuid
,
0
);
EXPECT_EQ
(
pMeta
->
suid
,
0
);
}
void
CheckSchema
(
int32_t
index
,
int8_t
type
,
int32_t
bytes
,
const
char
*
name
)
{
SSchema
*
pSchema
=
&
pMeta
->
pSchema
[
index
];
pSchema
->
bytes
=
htons
(
pSchema
->
bytes
);
EXPECT_EQ
(
pSchema
->
colId
,
0
);
EXPECT_EQ
(
pSchema
->
type
,
type
);
EXPECT_EQ
(
pSchema
->
bytes
,
bytes
);
EXPECT_STREQ
(
pSchema
->
name
,
name
);
}
void
SendThenCheckShowRetrieveMsg
(
int32_t
rows
)
{
SRetrieveTableMsg
*
pRetrieve
=
(
SRetrieveTableMsg
*
)
rpcMallocCont
(
sizeof
(
SRetrieveTableMsg
));
pRetrieve
->
showId
=
htonl
(
showId
);
pRetrieve
->
free
=
0
;
SRpcMsg
retrieveRpcMsg
=
{
0
};
retrieveRpcMsg
.
pCont
=
pRetrieve
;
retrieveRpcMsg
.
contLen
=
sizeof
(
SRetrieveTableMsg
);
retrieveRpcMsg
.
msgType
=
TSDB_MSG_TYPE_SHOW_RETRIEVE
;
sendMsg
(
pClient
,
&
retrieveRpcMsg
);
ASSERT_NE
(
pClient
->
pRsp
,
nullptr
);
ASSERT_EQ
(
pClient
->
pRsp
->
code
,
0
);
ASSERT_NE
(
pClient
->
pRsp
->
pCont
,
nullptr
);
pRetrieveRsp
=
(
SRetrieveTableRsp
*
)
pClient
->
pRsp
->
pCont
;
ASSERT_NE
(
pRetrieveRsp
,
nullptr
);
pRetrieveRsp
->
numOfRows
=
htonl
(
pRetrieveRsp
->
numOfRows
);
pRetrieveRsp
->
offset
=
htobe64
(
pRetrieveRsp
->
offset
);
pRetrieveRsp
->
useconds
=
htobe64
(
pRetrieveRsp
->
useconds
);
pRetrieveRsp
->
compLen
=
htonl
(
pRetrieveRsp
->
compLen
);
EXPECT_EQ
(
pRetrieveRsp
->
numOfRows
,
rows
);
EXPECT_EQ
(
pRetrieveRsp
->
offset
,
0
);
EXPECT_EQ
(
pRetrieveRsp
->
useconds
,
0
);
// EXPECT_EQ(pRetrieveRsp->completed, completed);
EXPECT_EQ
(
pRetrieveRsp
->
precision
,
TSDB_TIME_PRECISION_MILLI
);
EXPECT_EQ
(
pRetrieveRsp
->
compressed
,
0
);
EXPECT_EQ
(
pRetrieveRsp
->
reserved
,
0
);
EXPECT_EQ
(
pRetrieveRsp
->
compLen
,
0
);
pData
=
pRetrieveRsp
->
data
;
pos
=
0
;
}
void
CheckInt16
(
int16_t
val
)
{
int16_t
data
=
*
((
int16_t
*
)(
pData
+
pos
));
pos
+=
sizeof
(
int16_t
);
EXPECT_EQ
(
data
,
val
);
}
void
CheckInt64
(
int64_t
val
)
{
int64_t
data
=
*
((
int64_t
*
)(
pData
+
pos
));
pos
+=
sizeof
(
int64_t
);
EXPECT_EQ
(
data
,
val
);
}
void
CheckTimestamp
()
{
int64_t
data
=
*
((
int64_t
*
)(
pData
+
pos
));
pos
+=
sizeof
(
int64_t
);
EXPECT_GT
(
data
,
0
);
}
void
CheckBinary
(
const
char
*
val
,
int32_t
len
)
{
pos
+=
sizeof
(
VarDataLenT
);
char
*
data
=
(
char
*
)(
pData
+
pos
);
pos
+=
len
;
EXPECT_STREQ
(
data
,
val
);
}
int32_t
showId
;
STableMetaMsg
*
pMeta
;
SRetrieveTableRsp
*
pRetrieveRsp
;
char
*
pData
;
int32_t
pos
;
};
SServer
*
DndTestDb
::
pServer
;
SClient
*
DndTestDb
::
pClient
;
int32_t
DndTestDb
::
connId
;
TEST_F
(
DndTestDb
,
ShowUser
)
{
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_USER
,
"show users"
,
4
);
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
(
2
,
TSDB_DATA_TYPE_TIMESTAMP
,
8
,
"create time"
);
CheckSchema
(
3
,
TSDB_DATA_TYPE_BINARY
,
TSDB_USER_LEN
+
VARSTR_HEADER_SIZE
,
"account"
);
SendThenCheckShowRetrieveMsg
(
1
);
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
CheckBinary
(
"super"
,
10
);
CheckTimestamp
();
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
}
TEST_F
(
DndTestDb
,
CreateUser_01
)
{
{
SCreateUserMsg
*
pReq
=
(
SCreateUserMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateUserMsg
));
strcpy
(
pReq
->
user
,
"u1"
);
strcpy
(
pReq
->
pass
,
"p1"
);
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
pCont
=
pReq
;
rpcMsg
.
contLen
=
sizeof
(
SCreateUserMsg
);
rpcMsg
.
msgType
=
TSDB_MSG_TYPE_CREATE_USER
;
sendMsg
(
pClient
,
&
rpcMsg
);
SRpcMsg
*
pMsg
=
pClient
->
pRsp
;
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
}
{
SCreateUserMsg
*
pReq
=
(
SCreateUserMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateUserMsg
));
strcpy
(
pReq
->
user
,
"u2"
);
strcpy
(
pReq
->
pass
,
"p2"
);
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
pCont
=
pReq
;
rpcMsg
.
contLen
=
sizeof
(
SCreateUserMsg
);
rpcMsg
.
msgType
=
TSDB_MSG_TYPE_CREATE_USER
;
sendMsg
(
pClient
,
&
rpcMsg
);
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
,
AlterUser_01
)
{
SAlterUserMsg
*
pReq
=
(
SAlterUserMsg
*
)
rpcMallocCont
(
sizeof
(
SAlterUserMsg
));
strcpy
(
pReq
->
user
,
"u1"
);
strcpy
(
pReq
->
pass
,
"p2"
);
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
pCont
=
pReq
;
rpcMsg
.
contLen
=
sizeof
(
SAlterUserMsg
);
rpcMsg
.
msgType
=
TSDB_MSG_TYPE_ALTER_USER
;
sendMsg
(
pClient
,
&
rpcMsg
);
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
)
{
SDropUserMsg
*
pReq
=
(
SDropUserMsg
*
)
rpcMallocCont
(
sizeof
(
SDropUserMsg
));
strcpy
(
pReq
->
user
,
"u1"
);
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
pCont
=
pReq
;
rpcMsg
.
contLen
=
sizeof
(
SDropUserMsg
);
rpcMsg
.
msgType
=
TSDB_MSG_TYPE_DROP_USER
;
sendMsg
(
pClient
,
&
rpcMsg
);
SRpcMsg
*
pMsg
=
pClient
->
pRsp
;
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
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
();
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
}
TEST_F
(
DndTestDb
,
RestartDnode
)
{
stopServer
(
pServer
);
pServer
=
NULL
;
uInfo
(
"start all server"
);
const
char
*
fqdn
=
"localhost"
;
const
char
*
firstEp
=
"localhost:9530"
;
pServer
=
startServer
(
"/tmp/dnode_test_db"
,
fqdn
,
9530
,
firstEp
);
uInfo
(
"all server is running"
);
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
();
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
}
source/dnode/mgmt/impl/test/dnode/CMakeLists.txt
浏览文件 @
d22296f2
add_executable
(
dn
dTestD
node
""
)
add_executable
(
dn
ode_test_d
node
""
)
target_sources
(
dn
dTestD
node
target_sources
(
dn
ode_test_d
node
PRIVATE
"dnode.cpp"
"../sut/deploy.cpp"
)
target_link_libraries
(
dn
dTestD
node
dn
ode_test_d
node
PUBLIC dnode
PUBLIC util
PUBLIC os
PUBLIC gtest_main
)
target_include_directories
(
dn
dTestD
node
target_include_directories
(
dn
ode_test_d
node
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/server/dnode/mgmt"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../inc"
...
...
@@ -24,6 +24,6 @@ target_include_directories(dndTestDnode
enable_testing
()
add_test
(
NAME dn
dTestD
node
COMMAND dn
dTestD
node
NAME dn
ode_test_d
node
COMMAND dn
ode_test_d
node
)
source/dnode/mgmt/impl/test/dnode/dnode.cpp
浏览文件 @
d22296f2
...
...
@@ -24,15 +24,15 @@ class DndTestDnode : public ::testing::Test {
}
static
void
SetUpTestSuite
()
{
initLog
(
"/tmp/dn
dTestD
node"
);
initLog
(
"/tmp/dn
ode_test_d
node"
);
const
char
*
fqdn
=
"localhost"
;
const
char
*
firstEp
=
"localhost:9521"
;
pServer1
=
CreateServer
(
"/tmp/dn
dTestD
node1"
,
fqdn
,
9521
,
firstEp
);
pServer2
=
CreateServer
(
"/tmp/dn
dTestD
node2"
,
fqdn
,
9522
,
firstEp
);
pServer3
=
CreateServer
(
"/tmp/dn
dTestD
node3"
,
fqdn
,
9523
,
firstEp
);
pServer4
=
CreateServer
(
"/tmp/dn
dTestD
node4"
,
fqdn
,
9524
,
firstEp
);
pServer5
=
CreateServer
(
"/tmp/dn
dTestD
node5"
,
fqdn
,
9525
,
firstEp
);
pServer1
=
CreateServer
(
"/tmp/dn
ode_test_d
node1"
,
fqdn
,
9521
,
firstEp
);
pServer2
=
CreateServer
(
"/tmp/dn
ode_test_d
node2"
,
fqdn
,
9522
,
firstEp
);
pServer3
=
CreateServer
(
"/tmp/dn
ode_test_d
node3"
,
fqdn
,
9523
,
firstEp
);
pServer4
=
CreateServer
(
"/tmp/dn
ode_test_d
node4"
,
fqdn
,
9524
,
firstEp
);
pServer5
=
CreateServer
(
"/tmp/dn
ode_test_d
node5"
,
fqdn
,
9525
,
firstEp
);
pClient
=
createClient
(
"root"
,
"taosdata"
,
fqdn
,
9521
);
taosMsleep
(
300
);
}
...
...
@@ -378,10 +378,10 @@ TEST_F(DndTestDnode, RestartDnode_01) {
const
char
*
fqdn
=
"localhost"
;
const
char
*
firstEp
=
"localhost:9521"
;
pServer1
=
startServer
(
"/tmp/dn
dTestD
node1"
,
fqdn
,
9521
,
firstEp
);
pServer3
=
startServer
(
"/tmp/dn
dTestD
node3"
,
fqdn
,
9523
,
firstEp
);
pServer4
=
startServer
(
"/tmp/dn
dTestD
node4"
,
fqdn
,
9524
,
firstEp
);
pServer5
=
startServer
(
"/tmp/dn
dTestD
node5"
,
fqdn
,
9525
,
firstEp
);
pServer1
=
startServer
(
"/tmp/dn
ode_test_d
node1"
,
fqdn
,
9521
,
firstEp
);
pServer3
=
startServer
(
"/tmp/dn
ode_test_d
node3"
,
fqdn
,
9523
,
firstEp
);
pServer4
=
startServer
(
"/tmp/dn
ode_test_d
node4"
,
fqdn
,
9524
,
firstEp
);
pServer5
=
startServer
(
"/tmp/dn
ode_test_d
node5"
,
fqdn
,
9525
,
firstEp
);
uInfo
(
"all server is running"
);
...
...
source/dnode/mgmt/impl/test/user/CMakeLists.txt
浏览文件 @
d22296f2
add_executable
(
dn
dTestU
ser
""
)
add_executable
(
dn
ode_test_u
ser
""
)
target_sources
(
dn
dTestU
ser
target_sources
(
dn
ode_test_u
ser
PRIVATE
"user.cpp"
"../sut/deploy.cpp"
)
target_link_libraries
(
dn
dTestU
ser
dn
ode_test_u
ser
PUBLIC dnode
PUBLIC util
PUBLIC os
PUBLIC gtest_main
)
target_include_directories
(
dn
dTestU
ser
target_include_directories
(
dn
ode_test_u
ser
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/server/dnode/mgmt"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../inc"
...
...
@@ -24,6 +24,6 @@ target_include_directories(dndTestUser
enable_testing
()
add_test
(
NAME dn
dTestU
ser
COMMAND dn
dTestU
ser
NAME dn
ode_test_u
ser
COMMAND dn
ode_test_u
ser
)
source/dnode/mgmt/impl/test/user/user.cpp
浏览文件 @
d22296f2
...
...
@@ -24,11 +24,11 @@ class DndTestUser : public ::testing::Test {
}
static
void
SetUpTestSuite
()
{
initLog
(
"/tmp/dn
dTestU
ser"
);
initLog
(
"/tmp/dn
ode_test_u
ser"
);
const
char
*
fqdn
=
"localhost"
;
const
char
*
firstEp
=
"localhost:9530"
;
pServer
=
CreateServer
(
"/tmp/dn
dTestU
ser"
,
fqdn
,
9530
,
firstEp
);
pServer
=
CreateServer
(
"/tmp/dn
ode_test_u
ser"
,
fqdn
,
9530
,
firstEp
);
pClient
=
createClient
(
"root"
,
"taosdata"
,
fqdn
,
9530
);
taosMsleep
(
300
);
}
...
...
@@ -298,7 +298,7 @@ TEST_F(DndTestUser, RestartDnode) {
const
char
*
fqdn
=
"localhost"
;
const
char
*
firstEp
=
"localhost:9530"
;
pServer
=
startServer
(
"/tmp/dn
dTestU
ser"
,
fqdn
,
9530
,
firstEp
);
pServer
=
startServer
(
"/tmp/dn
ode_test_u
ser"
,
fqdn
,
9530
,
firstEp
);
uInfo
(
"all server is running"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录