Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
663ca79a
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看板
提交
663ca79a
编写于
1月 06, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename files
上级
5839f8f6
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
79 addition
and
48 deletion
+79
-48
source/dnode/mgmt/impl/test/CMakeLists.txt
source/dnode/mgmt/impl/test/CMakeLists.txt
+1
-8
source/dnode/mgmt/impl/test/mnode/CMakeLists.txt
source/dnode/mgmt/impl/test/mnode/CMakeLists.txt
+2
-2
source/dnode/mgmt/impl/test/mnode/qmnode.cpp
source/dnode/mgmt/impl/test/mnode/qmnode.cpp
+26
-0
source/dnode/mnode/impl/test/CMakeLists.txt
source/dnode/mnode/impl/test/CMakeLists.txt
+1
-0
source/dnode/mnode/impl/test/mnode/CMakeLists.txt
source/dnode/mnode/impl/test/mnode/CMakeLists.txt
+11
-0
source/dnode/mnode/impl/test/mnode/mnode.cpp
source/dnode/mnode/impl/test/mnode/mnode.cpp
+38
-38
未找到文件。
source/dnode/mgmt/impl/test/CMakeLists.txt
浏览文件 @
663ca79a
...
...
@@ -3,16 +3,9 @@ enable_testing()
add_subdirectory
(
qnode
)
add_subdirectory
(
bnode
)
add_subdirectory
(
snode
)
# add_subdirectory(auth)
# add_subdirectory(balance)
add_subdirectory
(
db
)
# add_subdirectory(func)
add_subdirectory
(
mnode
)
add_subdirectory
(
db
)
add_subdirectory
(
stb
)
# add_subdirectory(sync)
# add_subdirectory(telem)
# add_subdirectory(trans)
add_subdirectory
(
vgroup
)
add_subdirectory
(
sut
)
source/dnode/mgmt/impl/test/mnode/CMakeLists.txt
浏览文件 @
663ca79a
aux_source_directory
(
. MTEST_SRC
)
add_executable
(
dnode_test_mnode
${
MTEST_SRC
}
)
aux_source_directory
(
.
D
MTEST_SRC
)
add_executable
(
dnode_test_mnode
${
D
MTEST_SRC
}
)
target_link_libraries
(
dnode_test_mnode
PUBLIC sut
...
...
source/dnode/mgmt/impl/test/mnode/qmnode.cpp
0 → 100644
浏览文件 @
663ca79a
/**
* @file dmnode.cpp
* @author slguan (slguan@taosdata.com)
* @brief DNODE module mnode tests
* @version 1.0
* @date 2022-01-07
*
* @copyright Copyright (c) 2022
*
*/
#include "sut.h"
class
DndTestMnode
:
public
::
testing
::
Test
{
protected:
static
void
SetUpTestSuite
()
{
test
.
Init
(
"/tmp/dnode_test_mnode"
,
9113
);
}
static
void
TearDownTestSuite
()
{
test
.
Cleanup
();
}
static
Testbase
test
;
public:
void
SetUp
()
override
{}
void
TearDown
()
override
{}
};
Testbase
DndTestMnode
::
test
;
source/dnode/mnode/impl/test/CMakeLists.txt
浏览文件 @
663ca79a
...
...
@@ -9,3 +9,4 @@ add_subdirectory(bnode)
add_subdirectory
(
show
)
add_subdirectory
(
profile
)
add_subdirectory
(
dnode
)
add_subdirectory
(
mnode
)
source/dnode/mnode/impl/test/mnode/CMakeLists.txt
0 → 100644
浏览文件 @
663ca79a
aux_source_directory
(
. MTEST_SRC
)
add_executable
(
mnode_test_mnode
${
MTEST_SRC
}
)
target_link_libraries
(
mnode_test_mnode
PUBLIC sut
)
add_test
(
NAME mnode_test_mnode
COMMAND mnode_test_mnode
)
source/dnode/m
gmt
/impl/test/mnode/mnode.cpp
→
source/dnode/m
node
/impl/test/mnode/mnode.cpp
浏览文件 @
663ca79a
/**
* @file
d
node.cpp
* @file
m
node.cpp
* @author slguan (slguan@taosdata.com)
* @brief
DNODE module dnode-msg
tests
* @version
0.1
* @date 202
1-12-15
* @brief
MNODE module mnode
tests
* @version
1.0
* @date 202
2-01-07
*
* @copyright Copyright (c) 202
1
* @copyright Copyright (c) 202
2
*
*/
#include "sut.h"
class
D
ndTestMnode
:
public
::
testing
::
Test
{
class
M
ndTestMnode
:
public
::
testing
::
Test
{
public:
void
SetUp
()
override
{}
void
TearDown
()
override
{}
public:
static
void
SetUpTestSuite
()
{
test
.
Init
(
"/tmp/
dnode_test_mnode1"
,
906
1
);
test
.
Init
(
"/tmp/
mnode_test_mnode1"
,
903
1
);
const
char
*
fqdn
=
"localhost"
;
const
char
*
firstEp
=
"localhost:90
6
1"
;
const
char
*
firstEp
=
"localhost:90
3
1"
;
server2
.
Start
(
"/tmp/
dnode_test_mnode2"
,
fqdn
,
906
2
,
firstEp
);
server3
.
Start
(
"/tmp/
dnode_test_mnode3"
,
fqdn
,
906
3
,
firstEp
);
server4
.
Start
(
"/tmp/
dnode_test_mnode4"
,
fqdn
,
906
4
,
firstEp
);
server5
.
Start
(
"/tmp/
dnode_test_mnode5"
,
fqdn
,
906
5
,
firstEp
);
server2
.
Start
(
"/tmp/
mnode_test_mnode2"
,
fqdn
,
903
2
,
firstEp
);
server3
.
Start
(
"/tmp/
mnode_test_mnode3"
,
fqdn
,
903
3
,
firstEp
);
server4
.
Start
(
"/tmp/
mnode_test_mnode4"
,
fqdn
,
903
4
,
firstEp
);
server5
.
Start
(
"/tmp/
mnode_test_mnode5"
,
fqdn
,
903
5
,
firstEp
);
taosMsleep
(
300
);
}
...
...
@@ -44,13 +44,13 @@ class DndTestMnode : public ::testing::Test {
static
TestServer
server5
;
};
Testbase
D
ndTestMnode
::
test
;
TestServer
D
ndTestMnode
::
server2
;
TestServer
D
ndTestMnode
::
server3
;
TestServer
D
ndTestMnode
::
server4
;
TestServer
D
ndTestMnode
::
server5
;
Testbase
M
ndTestMnode
::
test
;
TestServer
M
ndTestMnode
::
server2
;
TestServer
M
ndTestMnode
::
server3
;
TestServer
M
ndTestMnode
::
server4
;
TestServer
M
ndTestMnode
::
server5
;
TEST_F
(
D
ndTestMnode
,
01
_ShowDnode
)
{
TEST_F
(
M
ndTestMnode
,
01
_ShowDnode
)
{
test
.
SendShowMetaReq
(
TSDB_MGMT_TABLE_MNODE
,
""
);
CHECK_META
(
"show mnodes"
,
5
);
...
...
@@ -64,13 +64,13 @@ TEST_F(DndTestMnode, 01_ShowDnode) {
EXPECT_EQ
(
test
.
GetShowRows
(),
1
);
CheckInt16
(
1
);
CheckBinary
(
"localhost:90
6
1"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
3
1"
,
TSDB_EP_LEN
);
CheckBinary
(
"master"
,
12
);
CheckInt64
(
0
);
CheckTimestamp
();
}
TEST_F
(
D
ndTestMnode
,
02
_Create_Mnode_Invalid_Id
)
{
TEST_F
(
M
ndTestMnode
,
02
_Create_Mnode_Invalid_Id
)
{
{
int32_t
contLen
=
sizeof
(
SMCreateMnodeMsg
);
...
...
@@ -83,7 +83,7 @@ TEST_F(DndTestMnode, 02_Create_Mnode_Invalid_Id) {
}
}
TEST_F
(
D
ndTestMnode
,
03
_Create_Mnode_Invalid_Id
)
{
TEST_F
(
M
ndTestMnode
,
03
_Create_Mnode_Invalid_Id
)
{
{
int32_t
contLen
=
sizeof
(
SMCreateMnodeMsg
);
...
...
@@ -96,14 +96,14 @@ TEST_F(DndTestMnode, 03_Create_Mnode_Invalid_Id) {
}
}
TEST_F
(
D
ndTestMnode
,
04
_Create_Mnode
)
{
TEST_F
(
M
ndTestMnode
,
04
_Create_Mnode
)
{
{
// create dnode
int32_t
contLen
=
sizeof
(
SCreateDnodeReq
);
SCreateDnodeReq
*
pReq
=
(
SCreateDnodeReq
*
)
rpcMallocCont
(
contLen
);
strcpy
(
pReq
->
fqdn
,
"localhost"
);
pReq
->
port
=
htonl
(
90
6
2
);
pReq
->
port
=
htonl
(
90
3
2
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_DNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
...
...
@@ -132,8 +132,8 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
CheckInt16
(
1
);
CheckInt16
(
2
);
CheckBinary
(
"localhost:90
6
1"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
6
2"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
3
1"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
3
2"
,
TSDB_EP_LEN
);
CheckBinary
(
"master"
,
12
);
CheckBinary
(
"slave"
,
12
);
CheckInt64
(
0
);
...
...
@@ -158,7 +158,7 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
EXPECT_EQ
(
test
.
GetShowRows
(),
1
);
CheckInt16
(
1
);
CheckBinary
(
"localhost:90
6
1"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:90
3
1"
,
TSDB_EP_LEN
);
CheckBinary
(
"master"
,
12
);
CheckInt64
(
0
);
CheckTimestamp
();
...
...
@@ -181,7 +181,7 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
// EXPECT_EQ(test.GetShowRows(), 1);
// CheckInt16(1);
// CheckBinary("localhost:90
6
1", TSDB_EP_LEN);
// CheckBinary("localhost:90
3
1", TSDB_EP_LEN);
// CheckInt16(0);
// CheckInt16(1);
// CheckBinary("ready", 10);
...
...
@@ -192,7 +192,7 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
// int32_t contLen = sizeof(SCreateDnodeReq);
// SCreateDnodeReq* pReq = (SCreateDnodeReq*)rpcMallocCont(contLen);
// strcpy(pReq->ep, "localhost:90
6
3");
// strcpy(pReq->ep, "localhost:90
3
3");
// SRpcMsg* pRsp = test.SendReq(TDMT_MND_CREATE_DNODE, pReq, contLen);
// ASSERT_NE(pRsp, nullptr);
...
...
@@ -203,7 +203,7 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
// int32_t contLen = sizeof(SCreateDnodeReq);
// SCreateDnodeReq* pReq = (SCreateDnodeReq*)rpcMallocCont(contLen);
// strcpy(pReq->ep, "localhost:90
6
4");
// strcpy(pReq->ep, "localhost:90
3
4");
// SRpcMsg* pRsp = test.SendReq(TDMT_MND_CREATE_DNODE, pReq, contLen);
// ASSERT_NE(pRsp, nullptr);
...
...
@@ -214,7 +214,7 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
// int32_t contLen = sizeof(SCreateDnodeReq);
// SCreateDnodeReq* pReq = (SCreateDnodeReq*)rpcMallocCont(contLen);
// strcpy(pReq->ep, "localhost:90
6
5");
// strcpy(pReq->ep, "localhost:90
3
5");
// SRpcMsg* pRsp = test.SendReq(TDMT_MND_CREATE_DNODE, pReq, contLen);
// ASSERT_NE(pRsp, nullptr);
...
...
@@ -231,10 +231,10 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
// CheckInt16(3);
// CheckInt16(4);
// CheckInt16(5);
// CheckBinary("localhost:90
6
1", TSDB_EP_LEN);
// CheckBinary("localhost:90
6
3", TSDB_EP_LEN);
// CheckBinary("localhost:90
6
4", TSDB_EP_LEN);
// CheckBinary("localhost:90
6
5", TSDB_EP_LEN);
// CheckBinary("localhost:90
3
1", TSDB_EP_LEN);
// CheckBinary("localhost:90
3
3", TSDB_EP_LEN);
// CheckBinary("localhost:90
3
4", TSDB_EP_LEN);
// CheckBinary("localhost:90
3
5", TSDB_EP_LEN);
// CheckInt16(0);
// CheckInt16(0);
// CheckInt16(0);
...
...
@@ -274,10 +274,10 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
// CheckInt16(3);
// CheckInt16(4);
// CheckInt16(5);
// CheckBinary("localhost:90
6
1", TSDB_EP_LEN);
// CheckBinary("localhost:90
6
3", TSDB_EP_LEN);
// CheckBinary("localhost:90
6
4", TSDB_EP_LEN);
// CheckBinary("localhost:90
6
5", TSDB_EP_LEN);
// CheckBinary("localhost:90
3
1", TSDB_EP_LEN);
// CheckBinary("localhost:90
3
3", TSDB_EP_LEN);
// CheckBinary("localhost:90
3
4", TSDB_EP_LEN);
// CheckBinary("localhost:90
3
5", 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录