Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f7769b09
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f7769b09
编写于
1月 06, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes
上级
f17bf4bb
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
47 addition
and
36 deletion
+47
-36
source/dnode/mgmt/impl/test/CMakeLists.txt
source/dnode/mgmt/impl/test/CMakeLists.txt
+0
-1
source/dnode/mnode/impl/test/CMakeLists.txt
source/dnode/mnode/impl/test/CMakeLists.txt
+1
-0
source/dnode/mnode/impl/test/dnode/CMakeLists.txt
source/dnode/mnode/impl/test/dnode/CMakeLists.txt
+11
-0
source/dnode/mnode/impl/test/dnode/dnode.cpp
source/dnode/mnode/impl/test/dnode/dnode.cpp
+35
-35
未找到文件。
source/dnode/mgmt/impl/test/CMakeLists.txt
浏览文件 @
f7769b09
...
...
@@ -7,7 +7,6 @@ add_subdirectory(snode)
# add_subdirectory(auth)
# add_subdirectory(balance)
add_subdirectory
(
db
)
add_subdirectory
(
dnode
)
# add_subdirectory(func)
add_subdirectory
(
mnode
)
add_subdirectory
(
stb
)
...
...
source/dnode/mnode/impl/test/CMakeLists.txt
浏览文件 @
f7769b09
...
...
@@ -8,3 +8,4 @@ add_subdirectory(snode)
add_subdirectory
(
bnode
)
add_subdirectory
(
show
)
add_subdirectory
(
profile
)
add_subdirectory
(
dnode
)
source/dnode/m
gmt
/impl/test/dnode/CMakeLists.txt
→
source/dnode/m
node
/impl/test/dnode/CMakeLists.txt
浏览文件 @
f7769b09
aux_source_directory
(
. DTEST_SRC
)
add_executable
(
d
node_test_dnode
${
DTEST_SRC
}
)
add_executable
(
m
node_test_dnode
${
DTEST_SRC
}
)
target_link_libraries
(
d
node_test_dnode
m
node_test_dnode
PUBLIC sut
)
add_test
(
NAME
d
node_test_dnode
COMMAND
d
node_test_dnode
NAME
m
node_test_dnode
COMMAND
m
node_test_dnode
)
source/dnode/m
gmt
/impl/test/dnode/dnode.cpp
→
source/dnode/m
node
/impl/test/dnode/dnode.cpp
浏览文件 @
f7769b09
/**
* @file dnode.cpp
* @author slguan (slguan@taosdata.com)
* @brief
DNODE module dnode-msg
tests
* @version
0.1
* @date 202
1-12-15
* @brief
MNODE module dnode
tests
* @version
1.0
* @date 202
2-01-06
*
* @copyright Copyright (c) 202
1
* @copyright Copyright (c) 202
2
*
*/
#include "sut.h"
class
D
ndTestDnode
:
public
::
testing
::
Test
{
class
M
ndTestDnode
:
public
::
testing
::
Test
{
public:
void
SetUp
()
override
{}
void
TearDown
()
override
{}
public:
static
void
SetUpTestSuite
()
{
test
.
Init
(
"/tmp/dnode_test_dnode1"
,
90
41
);
test
.
Init
(
"/tmp/dnode_test_dnode1"
,
90
23
);
const
char
*
fqdn
=
"localhost"
;
const
char
*
firstEp
=
"localhost:90
41
"
;
const
char
*
firstEp
=
"localhost:90
23
"
;
server2
.
Start
(
"/tmp/dnode_test_dnode2"
,
fqdn
,
90
42
,
firstEp
);
server3
.
Start
(
"/tmp/dnode_test_dnode3"
,
fqdn
,
90
43
,
firstEp
);
server4
.
Start
(
"/tmp/dnode_test_dnode4"
,
fqdn
,
90
44
,
firstEp
);
server5
.
Start
(
"/tmp/dnode_test_dnode5"
,
fqdn
,
90
45
,
firstEp
);
server2
.
Start
(
"/tmp/dnode_test_dnode2"
,
fqdn
,
90
24
,
firstEp
);
server3
.
Start
(
"/tmp/dnode_test_dnode3"
,
fqdn
,
90
25
,
firstEp
);
server4
.
Start
(
"/tmp/dnode_test_dnode4"
,
fqdn
,
90
26
,
firstEp
);
server5
.
Start
(
"/tmp/dnode_test_dnode5"
,
fqdn
,
90
27
,
firstEp
);
taosMsleep
(
300
);
}
...
...
@@ -44,13 +44,13 @@ class DndTestDnode : public ::testing::Test {
static
TestServer
server5
;
};
Testbase
D
ndTestDnode
::
test
;
TestServer
D
ndTestDnode
::
server2
;
TestServer
D
ndTestDnode
::
server3
;
TestServer
D
ndTestDnode
::
server4
;
TestServer
D
ndTestDnode
::
server5
;
Testbase
M
ndTestDnode
::
test
;
TestServer
M
ndTestDnode
::
server2
;
TestServer
M
ndTestDnode
::
server3
;
TestServer
M
ndTestDnode
::
server4
;
TestServer
M
ndTestDnode
::
server5
;
TEST_F
(
D
ndTestDnode
,
01
_ShowDnode
)
{
TEST_F
(
M
ndTestDnode
,
01
_ShowDnode
)
{
test
.
SendShowMetaReq
(
TSDB_MGMT_TABLE_DNODE
,
""
);
CHECK_META
(
"show dnodes"
,
7
);
...
...
@@ -66,7 +66,7 @@ TEST_F(DndTestDnode, 01_ShowDnode) {
EXPECT_EQ
(
test
.
GetShowRows
(),
1
);
CheckInt16
(
1
);
CheckBinary
(
"localhost:90
41
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
23
"
,
TSDB_EP_LEN
);
CheckInt16
(
0
);
CheckInt16
(
16
);
CheckBinary
(
"ready"
,
10
);
...
...
@@ -74,7 +74,7 @@ TEST_F(DndTestDnode, 01_ShowDnode) {
CheckBinary
(
""
,
24
);
}
TEST_F
(
D
ndTestDnode
,
02
_ConfigDnode
)
{
TEST_F
(
M
ndTestDnode
,
02
_ConfigDnode
)
{
int32_t
contLen
=
sizeof
(
SCfgDnodeMsg
);
SCfgDnodeMsg
*
pReq
=
(
SCfgDnodeMsg
*
)
rpcMallocCont
(
contLen
);
...
...
@@ -86,13 +86,13 @@ TEST_F(DndTestDnode, 02_ConfigDnode) {
ASSERT_EQ
(
pRsp
->
code
,
0
);
}
TEST_F
(
D
ndTestDnode
,
03
_Create_Drop_Restart_Dnode
)
{
TEST_F
(
M
ndTestDnode
,
03
_Create_Drop_Restart_Dnode
)
{
{
int32_t
contLen
=
sizeof
(
SCreateDnodeMsg
);
SCreateDnodeMsg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
contLen
);
strcpy
(
pReq
->
fqdn
,
"localhost"
);
pReq
->
port
=
htonl
(
90
42
);
pReq
->
port
=
htonl
(
90
24
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_DNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -108,8 +108,8 @@ TEST_F(DndTestDnode, 03_Create_Drop_Restart_Dnode) {
CheckInt16
(
1
);
CheckInt16
(
2
);
CheckBinary
(
"localhost:90
41
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
42
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
23
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
24
"
,
TSDB_EP_LEN
);
CheckInt16
(
0
);
CheckInt16
(
0
);
CheckInt16
(
16
);
...
...
@@ -138,7 +138,7 @@ TEST_F(DndTestDnode, 03_Create_Drop_Restart_Dnode) {
EXPECT_EQ
(
test
.
GetShowRows
(),
1
);
CheckInt16
(
1
);
CheckBinary
(
"localhost:90
41
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
23
"
,
TSDB_EP_LEN
);
CheckInt16
(
0
);
CheckInt16
(
16
);
CheckBinary
(
"ready"
,
10
);
...
...
@@ -150,7 +150,7 @@ TEST_F(DndTestDnode, 03_Create_Drop_Restart_Dnode) {
SCreateDnodeMsg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
contLen
);
strcpy
(
pReq
->
fqdn
,
"localhost"
);
pReq
->
port
=
htonl
(
90
43
);
pReq
->
port
=
htonl
(
90
25
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_DNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -162,7 +162,7 @@ TEST_F(DndTestDnode, 03_Create_Drop_Restart_Dnode) {
SCreateDnodeMsg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
contLen
);
strcpy
(
pReq
->
fqdn
,
"localhost"
);
pReq
->
port
=
htonl
(
90
44
);
pReq
->
port
=
htonl
(
90
26
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_DNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -174,7 +174,7 @@ TEST_F(DndTestDnode, 03_Create_Drop_Restart_Dnode) {
SCreateDnodeMsg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
contLen
);
strcpy
(
pReq
->
fqdn
,
"localhost"
);
pReq
->
port
=
htonl
(
90
45
);
pReq
->
port
=
htonl
(
90
27
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_DNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -191,10 +191,10 @@ TEST_F(DndTestDnode, 03_Create_Drop_Restart_Dnode) {
CheckInt16
(
3
);
CheckInt16
(
4
);
CheckInt16
(
5
);
CheckBinary
(
"localhost:90
41
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
43
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
44
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
45
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
23
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
25
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
26
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
27
"
,
TSDB_EP_LEN
);
CheckInt16
(
0
);
CheckInt16
(
0
);
CheckInt16
(
0
);
...
...
@@ -234,10 +234,10 @@ TEST_F(DndTestDnode, 03_Create_Drop_Restart_Dnode) {
CheckInt16
(
3
);
CheckInt16
(
4
);
CheckInt16
(
5
);
CheckBinary
(
"localhost:90
41
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
43
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
44
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
45
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
23
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
25
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
26
"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
27
"
,
TSDB_EP_LEN
);
CheckInt16
(
0
);
CheckInt16
(
0
);
CheckInt16
(
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录