Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c0aded7b
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
c0aded7b
编写于
1月 04, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add test cases
上级
c5decfec
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
350 addition
and
155 deletion
+350
-155
source/dnode/mgmt/impl/test/CMakeLists.txt
source/dnode/mgmt/impl/test/CMakeLists.txt
+2
-0
source/dnode/mgmt/impl/test/bnode/CMakeLists.txt
source/dnode/mgmt/impl/test/bnode/CMakeLists.txt
+11
-0
source/dnode/mgmt/impl/test/bnode/bnode.cpp
source/dnode/mgmt/impl/test/bnode/bnode.cpp
+0
-154
source/dnode/mgmt/impl/test/bnode/dbnode.cpp
source/dnode/mgmt/impl/test/bnode/dbnode.cpp
+133
-0
source/dnode/mgmt/impl/test/qnode/dqnode.cpp
source/dnode/mgmt/impl/test/qnode/dqnode.cpp
+60
-1
source/dnode/mgmt/impl/test/snode/CMakeLists.txt
source/dnode/mgmt/impl/test/snode/CMakeLists.txt
+11
-0
source/dnode/mgmt/impl/test/snode/dsnode.cpp
source/dnode/mgmt/impl/test/snode/dsnode.cpp
+133
-0
未找到文件。
source/dnode/mgmt/impl/test/CMakeLists.txt
浏览文件 @
c0aded7b
enable_testing
()
add_subdirectory
(
qnode
)
add_subdirectory
(
bnode
)
add_subdirectory
(
snode
)
# add_subdirectory(auth)
# add_subdirectory(balance)
...
...
source/dnode/mgmt/impl/test/bnode/CMakeLists.txt
0 → 100644
浏览文件 @
c0aded7b
aux_source_directory
(
. BQTEST_SRC
)
add_executable
(
dnode_test_bnode
${
BQTEST_SRC
}
)
target_link_libraries
(
dnode_test_bnode
PUBLIC sut
)
add_test
(
NAME dnode_test_bnode
COMMAND dnode_test_bnode
)
source/dnode/mgmt/impl/test/bnode/bnode.cpp
已删除
100644 → 0
浏览文件 @
c5decfec
/**
* @file dnode.cpp
* @author slguan (slguan@taosdata.com)
* @brief DNODE module dnode-msg tests
* @version 0.1
* @date 2021-12-15
*
* @copyright Copyright (c) 2021
*
*/
#include "sut.h"
class
DndTestBnode
:
public
::
testing
::
Test
{
public:
void
SetUp
()
override
{}
void
TearDown
()
override
{}
public:
static
void
SetUpTestSuite
()
{
test
.
Init
(
"/tmp/dnode_test_bnode1"
,
9068
);
const
char
*
fqdn
=
"localhost"
;
const
char
*
firstEp
=
"localhost:9068"
;
server2
.
Start
(
"/tmp/dnode_test_bnode2"
,
fqdn
,
9069
,
firstEp
);
taosMsleep
(
300
);
}
static
void
TearDownTestSuite
()
{
server2
.
Stop
();
test
.
Cleanup
();
}
static
Testbase
test
;
static
TestServer
server2
;
};
Testbase
DndTestBnode
::
test
;
TestServer
DndTestBnode
::
server2
;
TEST_F
(
DndTestBnode
,
01
_ShowBnode
)
{
test
.
SendShowMetaMsg
(
TSDB_MGMT_TABLE_BNODE
,
""
);
CHECK_META
(
"show bnodes"
,
3
);
CHECK_SCHEMA
(
0
,
TSDB_DATA_TYPE_SMALLINT
,
2
,
"id"
);
CHECK_SCHEMA
(
1
,
TSDB_DATA_TYPE_BINARY
,
TSDB_EP_LEN
+
VARSTR_HEADER_SIZE
,
"endpoint"
);
CHECK_SCHEMA
(
2
,
TSDB_DATA_TYPE_TIMESTAMP
,
8
,
"create_time"
);
test
.
SendShowRetrieveMsg
();
EXPECT_EQ
(
test
.
GetShowRows
(),
0
);
}
TEST_F
(
DndTestBnode
,
02
_Create_Bnode_Invalid_Id
)
{
{
int32_t
contLen
=
sizeof
(
SMCreateBnodeReq
);
SMCreateBnodeReq
*
pReq
=
(
SMCreateBnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_MND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
test
.
SendShowMetaMsg
(
TSDB_MGMT_TABLE_BNODE
,
""
);
CHECK_META
(
"show bnodes"
,
3
);
CHECK_SCHEMA
(
0
,
TSDB_DATA_TYPE_SMALLINT
,
2
,
"id"
);
CHECK_SCHEMA
(
1
,
TSDB_DATA_TYPE_BINARY
,
TSDB_EP_LEN
+
VARSTR_HEADER_SIZE
,
"endpoint"
);
CHECK_SCHEMA
(
2
,
TSDB_DATA_TYPE_TIMESTAMP
,
8
,
"create_time"
);
test
.
SendShowRetrieveMsg
();
EXPECT_EQ
(
test
.
GetShowRows
(),
1
);
CheckInt16
(
1
);
CheckBinary
(
"localhost:9068"
,
TSDB_EP_LEN
);
CheckTimestamp
();
}
}
TEST_F
(
DndTestBnode
,
03
_Create_Bnode_Invalid_Id
)
{
{
int32_t
contLen
=
sizeof
(
SMCreateBnodeReq
);
SMCreateBnodeReq
*
pReq
=
(
SMCreateBnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
2
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_MND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_MND_DNODE_NOT_EXIST
);
}
}
TEST_F
(
DndTestBnode
,
04
_Create_Bnode
)
{
{
// create dnode
int32_t
contLen
=
sizeof
(
SCreateDnodeMsg
);
SCreateDnodeMsg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
contLen
);
strcpy
(
pReq
->
fqdn
,
"localhost"
);
pReq
->
port
=
htonl
(
9069
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_MND_CREATE_DNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
taosMsleep
(
1300
);
test
.
SendShowMetaMsg
(
TSDB_MGMT_TABLE_DNODE
,
""
);
test
.
SendShowRetrieveMsg
();
EXPECT_EQ
(
test
.
GetShowRows
(),
2
);
}
{
// create bnode
int32_t
contLen
=
sizeof
(
SMCreateBnodeReq
);
SMCreateBnodeReq
*
pReq
=
(
SMCreateBnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
2
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_MND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
test
.
SendShowMetaMsg
(
TSDB_MGMT_TABLE_BNODE
,
""
);
test
.
SendShowRetrieveMsg
();
EXPECT_EQ
(
test
.
GetShowRows
(),
2
);
CheckInt16
(
1
);
CheckInt16
(
2
);
CheckBinary
(
"localhost:9068"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9069"
,
TSDB_EP_LEN
);
CheckTimestamp
();
CheckTimestamp
();
}
{
// drop bnode
int32_t
contLen
=
sizeof
(
SMDropBnodeReq
);
SMDropBnodeReq
*
pReq
=
(
SMDropBnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
2
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_MND_DROP_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
test
.
SendShowMetaMsg
(
TSDB_MGMT_TABLE_BNODE
,
""
);
test
.
SendShowRetrieveMsg
();
EXPECT_EQ
(
test
.
GetShowRows
(),
1
);
CheckInt16
(
1
);
CheckBinary
(
"localhost:9068"
,
TSDB_EP_LEN
);
CheckTimestamp
();
}
}
\ No newline at end of file
source/dnode/mgmt/impl/test/bnode/dbnode.cpp
0 → 100644
浏览文件 @
c0aded7b
/**
* @file dbnode.cpp
* @author slguan (slguan@taosdata.com)
* @brief DNODE module bnode tests
* @version 1.0
* @date 2022-01-05
*
* @copyright Copyright (c) 2022
*
*/
#include "sut.h"
class
DndTestBnode
:
public
::
testing
::
Test
{
protected:
static
void
SetUpTestSuite
()
{
test
.
Init
(
"/tmp/dnode_test_snode"
,
9112
);
}
static
void
TearDownTestSuite
()
{
test
.
Cleanup
();
}
static
Testbase
test
;
public:
void
SetUp
()
override
{}
void
TearDown
()
override
{}
};
Testbase
DndTestBnode
::
test
;
TEST_F
(
DndTestBnode
,
01
_Create_Bnode
)
{
{
int32_t
contLen
=
sizeof
(
SDCreateBnodeReq
);
SDCreateBnodeReq
*
pReq
=
(
SDCreateBnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
2
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_DND_BNODE_ID_INVALID
);
}
{
int32_t
contLen
=
sizeof
(
SDCreateBnodeReq
);
SDCreateBnodeReq
*
pReq
=
(
SDCreateBnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
}
{
int32_t
contLen
=
sizeof
(
SDCreateBnodeReq
);
SDCreateBnodeReq
*
pReq
=
(
SDCreateBnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_DND_BNODE_ALREADY_DEPLOYED
);
}
test
.
Restart
();
{
int32_t
contLen
=
sizeof
(
SDCreateBnodeReq
);
SDCreateBnodeReq
*
pReq
=
(
SDCreateBnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_DND_BNODE_ALREADY_DEPLOYED
);
}
}
TEST_F
(
DndTestBnode
,
01
_Drop_Bnode
)
{
{
int32_t
contLen
=
sizeof
(
SDDropBnodeReq
);
SDDropBnodeReq
*
pReq
=
(
SDDropBnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
2
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_DROP_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_DND_BNODE_ID_INVALID
);
}
{
int32_t
contLen
=
sizeof
(
SDDropBnodeReq
);
SDDropBnodeReq
*
pReq
=
(
SDDropBnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_DROP_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
}
{
int32_t
contLen
=
sizeof
(
SDDropBnodeReq
);
SDDropBnodeReq
*
pReq
=
(
SDDropBnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_DROP_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_DND_BNODE_NOT_DEPLOYED
);
}
test
.
Restart
();
{
int32_t
contLen
=
sizeof
(
SDDropBnodeReq
);
SDDropBnodeReq
*
pReq
=
(
SDDropBnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_DROP_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_DND_BNODE_NOT_DEPLOYED
);
}
{
int32_t
contLen
=
sizeof
(
SDCreateBnodeReq
);
SDCreateBnodeReq
*
pReq
=
(
SDCreateBnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_CREATE_BNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
}
}
\ No newline at end of file
source/dnode/mgmt/impl/test/qnode/dqnode.cpp
浏览文件 @
c0aded7b
...
...
@@ -25,7 +25,7 @@ class DndTestQnode : public ::testing::Test {
Testbase
DndTestQnode
::
test
;
TEST_F
(
DndTestQnode
,
01
_Create_Qnode
_Invalid
)
{
TEST_F
(
DndTestQnode
,
01
_Create_Qnode
)
{
{
int32_t
contLen
=
sizeof
(
SDCreateQnodeReq
);
...
...
@@ -71,4 +71,63 @@ TEST_F(DndTestQnode, 01_Create_Qnode_Invalid) {
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_DND_QNODE_ALREADY_DEPLOYED
);
}
}
TEST_F
(
DndTestQnode
,
01
_Drop_Qnode
)
{
{
int32_t
contLen
=
sizeof
(
SDDropQnodeReq
);
SDDropQnodeReq
*
pReq
=
(
SDDropQnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
2
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_DROP_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_DND_QNODE_ID_INVALID
);
}
{
int32_t
contLen
=
sizeof
(
SDDropQnodeReq
);
SDDropQnodeReq
*
pReq
=
(
SDDropQnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_DROP_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
}
{
int32_t
contLen
=
sizeof
(
SDDropQnodeReq
);
SDDropQnodeReq
*
pReq
=
(
SDDropQnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_DROP_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_DND_QNODE_NOT_DEPLOYED
);
}
test
.
Restart
();
{
int32_t
contLen
=
sizeof
(
SDDropQnodeReq
);
SDDropQnodeReq
*
pReq
=
(
SDDropQnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_DROP_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_DND_QNODE_NOT_DEPLOYED
);
}
{
int32_t
contLen
=
sizeof
(
SDCreateQnodeReq
);
SDCreateQnodeReq
*
pReq
=
(
SDCreateQnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
}
}
\ No newline at end of file
source/dnode/mgmt/impl/test/snode/CMakeLists.txt
0 → 100644
浏览文件 @
c0aded7b
aux_source_directory
(
. SQTEST_SRC
)
add_executable
(
dnode_test_snode
${
SQTEST_SRC
}
)
target_link_libraries
(
dnode_test_snode
PUBLIC sut
)
add_test
(
NAME dnode_test_snode
COMMAND dnode_test_snode
)
source/dnode/mgmt/impl/test/snode/dsnode.cpp
0 → 100644
浏览文件 @
c0aded7b
/**
* @file dsnode.cpp
* @author slguan (slguan@taosdata.com)
* @brief DNODE module snode tests
* @version 1.0
* @date 2022-01-05
*
* @copyright Copyright (c) 2022
*
*/
#include "sut.h"
class
DndTestSnode
:
public
::
testing
::
Test
{
protected:
static
void
SetUpTestSuite
()
{
test
.
Init
(
"/tmp/dnode_test_snode"
,
9112
);
}
static
void
TearDownTestSuite
()
{
test
.
Cleanup
();
}
static
Testbase
test
;
public:
void
SetUp
()
override
{}
void
TearDown
()
override
{}
};
Testbase
DndTestSnode
::
test
;
TEST_F
(
DndTestSnode
,
01
_Create_Snode
)
{
{
int32_t
contLen
=
sizeof
(
SDCreateSnodeReq
);
SDCreateSnodeReq
*
pReq
=
(
SDCreateSnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
2
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_DND_SNODE_ID_INVALID
);
}
{
int32_t
contLen
=
sizeof
(
SDCreateSnodeReq
);
SDCreateSnodeReq
*
pReq
=
(
SDCreateSnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
}
{
int32_t
contLen
=
sizeof
(
SDCreateSnodeReq
);
SDCreateSnodeReq
*
pReq
=
(
SDCreateSnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_DND_SNODE_ALREADY_DEPLOYED
);
}
test
.
Restart
();
{
int32_t
contLen
=
sizeof
(
SDCreateSnodeReq
);
SDCreateSnodeReq
*
pReq
=
(
SDCreateSnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_DND_SNODE_ALREADY_DEPLOYED
);
}
}
TEST_F
(
DndTestSnode
,
01
_Drop_Snode
)
{
{
int32_t
contLen
=
sizeof
(
SDDropSnodeReq
);
SDDropSnodeReq
*
pReq
=
(
SDDropSnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
2
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_DROP_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_DND_SNODE_ID_INVALID
);
}
{
int32_t
contLen
=
sizeof
(
SDDropSnodeReq
);
SDDropSnodeReq
*
pReq
=
(
SDDropSnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_DROP_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
}
{
int32_t
contLen
=
sizeof
(
SDDropSnodeReq
);
SDDropSnodeReq
*
pReq
=
(
SDDropSnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_DROP_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_DND_SNODE_NOT_DEPLOYED
);
}
test
.
Restart
();
{
int32_t
contLen
=
sizeof
(
SDDropSnodeReq
);
SDDropSnodeReq
*
pReq
=
(
SDDropSnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_DROP_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_DND_SNODE_NOT_DEPLOYED
);
}
{
int32_t
contLen
=
sizeof
(
SDCreateSnodeReq
);
SDCreateSnodeReq
*
pReq
=
(
SDCreateSnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pMsg
=
test
.
SendMsg
(
TDMT_DND_CREATE_SNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录