Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7974143d
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看板
提交
7974143d
编写于
1月 04, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes
上级
dfd724a8
变更
22
显示空白变更内容
内联
并排
Showing
22 changed file
with
247 addition
and
54 deletion
+247
-54
source/dnode/mgmt/impl/test/CMakeLists.txt
source/dnode/mgmt/impl/test/CMakeLists.txt
+2
-0
source/dnode/mgmt/impl/test/bnode/bnode.cpp
source/dnode/mgmt/impl/test/bnode/bnode.cpp
+154
-0
source/dnode/mgmt/impl/test/cluster/cluster.cpp
source/dnode/mgmt/impl/test/cluster/cluster.cpp
+1
-1
source/dnode/mgmt/impl/test/db/db.cpp
source/dnode/mgmt/impl/test/db/db.cpp
+1
-1
source/dnode/mgmt/impl/test/dnode/dnode.cpp
source/dnode/mgmt/impl/test/dnode/dnode.cpp
+1
-1
source/dnode/mgmt/impl/test/mnode/mnode.cpp
source/dnode/mgmt/impl/test/mnode/mnode.cpp
+1
-1
source/dnode/mgmt/impl/test/profile/profile.cpp
source/dnode/mgmt/impl/test/profile/profile.cpp
+1
-1
source/dnode/mgmt/impl/test/qnode/CMakeLists.txt
source/dnode/mgmt/impl/test/qnode/CMakeLists.txt
+11
-0
source/dnode/mgmt/impl/test/qnode/dqnode.cpp
source/dnode/mgmt/impl/test/qnode/dqnode.cpp
+26
-0
source/dnode/mgmt/impl/test/show/show.cpp
source/dnode/mgmt/impl/test/show/show.cpp
+1
-1
source/dnode/mgmt/impl/test/stb/stb.cpp
source/dnode/mgmt/impl/test/stb/stb.cpp
+1
-1
source/dnode/mgmt/impl/test/sut/inc/sut.h
source/dnode/mgmt/impl/test/sut/inc/sut.h
+0
-0
source/dnode/mgmt/impl/test/sut/src/client.cpp
source/dnode/mgmt/impl/test/sut/src/client.cpp
+1
-1
source/dnode/mgmt/impl/test/sut/src/server.cpp
source/dnode/mgmt/impl/test/sut/src/server.cpp
+1
-1
source/dnode/mgmt/impl/test/sut/src/sut.cpp
source/dnode/mgmt/impl/test/sut/src/sut.cpp
+1
-1
source/dnode/mgmt/impl/test/vgroup/vgroup.cpp
source/dnode/mgmt/impl/test/vgroup/vgroup.cpp
+1
-1
source/dnode/mnode/impl/test/acct/acct.cpp
source/dnode/mnode/impl/test/acct/acct.cpp
+7
-7
source/dnode/mnode/impl/test/bnode/bnode.cpp
source/dnode/mnode/impl/test/bnode/bnode.cpp
+8
-8
source/dnode/mnode/impl/test/qnode/qnode.cpp
source/dnode/mnode/impl/test/qnode/qnode.cpp
+8
-8
source/dnode/mnode/impl/test/snode/snode.cpp
source/dnode/mnode/impl/test/snode/snode.cpp
+8
-8
source/dnode/mnode/impl/test/trans/trans.cpp
source/dnode/mnode/impl/test/trans/trans.cpp
+4
-4
source/dnode/mnode/impl/test/user/user.cpp
source/dnode/mnode/impl/test/user/user.cpp
+8
-8
未找到文件。
source/dnode/mgmt/impl/test/CMakeLists.txt
浏览文件 @
7974143d
enable_testing
()
add_subdirectory
(
qnode
)
# add_subdirectory(auth)
# add_subdirectory(balance)
add_subdirectory
(
cluster
)
...
...
source/dnode/mgmt/impl/test/bnode/bnode.cpp
0 → 100644
浏览文件 @
7974143d
/**
* @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
(
SMCreateBnodeMsg
);
SMCreateBnodeMsg
*
pReq
=
(
SMCreateBnodeMsg
*
)
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
(
SMCreateBnodeMsg
);
SMCreateBnodeMsg
*
pReq
=
(
SMCreateBnodeMsg
*
)
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
(
SMCreateBnodeMsg
);
SMCreateBnodeMsg
*
pReq
=
(
SMCreateBnodeMsg
*
)
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
(
SMDropBnodeMsg
);
SMDropBnodeMsg
*
pReq
=
(
SMDropBnodeMsg
*
)
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/cluster/cluster.cpp
浏览文件 @
7974143d
...
...
@@ -9,7 +9,7 @@
*
*/
#include "
base
.h"
#include "
sut
.h"
class
DndTestCluster
:
public
::
testing
::
Test
{
protected:
...
...
source/dnode/mgmt/impl/test/db/db.cpp
浏览文件 @
7974143d
...
...
@@ -9,7 +9,7 @@
*
*/
#include "
base
.h"
#include "
sut
.h"
class
DndTestDb
:
public
::
testing
::
Test
{
protected:
...
...
source/dnode/mgmt/impl/test/dnode/dnode.cpp
浏览文件 @
7974143d
...
...
@@ -9,7 +9,7 @@
*
*/
#include "
base
.h"
#include "
sut
.h"
class
DndTestDnode
:
public
::
testing
::
Test
{
public:
...
...
source/dnode/mgmt/impl/test/mnode/mnode.cpp
浏览文件 @
7974143d
...
...
@@ -9,7 +9,7 @@
*
*/
#include "
base
.h"
#include "
sut
.h"
class
DndTestMnode
:
public
::
testing
::
Test
{
public:
...
...
source/dnode/mgmt/impl/test/profile/profile.cpp
浏览文件 @
7974143d
...
...
@@ -9,7 +9,7 @@
*
*/
#include "
base
.h"
#include "
sut
.h"
class
DndTestProfile
:
public
::
testing
::
Test
{
protected:
...
...
source/dnode/mgmt/impl/test/qnode/CMakeLists.txt
0 → 100644
浏览文件 @
7974143d
aux_source_directory
(
. DQTEST_SRC
)
add_executable
(
dnode_test_qnode
${
DQTEST_SRC
}
)
target_link_libraries
(
dnode_test_qnode
PUBLIC sut
)
add_test
(
NAME dnode_test_qnode
COMMAND dnode_test_qnode
)
source/dnode/mgmt/impl/test/qnode/dqnode.cpp
0 → 100644
浏览文件 @
7974143d
/**
* @file dqnode.cpp
* @author slguan (slguan@taosdata.com)
* @brief DNODE module qnode tests
* @version 1.0
* @date 2022-01-05
*
* @copyright Copyright (c) 2022
*
*/
#include "sut.h"
class
DndTestQnode
:
public
::
testing
::
Test
{
protected:
static
void
SetUpTestSuite
()
{
test
.
Init
(
"/tmp/dnode_test_qnode"
,
9111
);
}
static
void
TearDownTestSuite
()
{
test
.
Cleanup
();
}
static
Testbase
test
;
public:
void
SetUp
()
override
{}
void
TearDown
()
override
{}
};
Testbase
DndTestQnode
::
test
;
source/dnode/mgmt/impl/test/show/show.cpp
浏览文件 @
7974143d
...
...
@@ -9,7 +9,7 @@
*
*/
#include "
base
.h"
#include "
sut
.h"
class
DndTestShow
:
public
::
testing
::
Test
{
protected:
...
...
source/dnode/mgmt/impl/test/stb/stb.cpp
浏览文件 @
7974143d
...
...
@@ -9,7 +9,7 @@
*
*/
#include "
base
.h"
#include "
sut
.h"
class
DndTestStb
:
public
::
testing
::
Test
{
protected:
...
...
source/dnode/mgmt/impl/test/sut/inc/
base
.h
→
source/dnode/mgmt/impl/test/sut/inc/
sut
.h
浏览文件 @
7974143d
文件已移动
source/dnode/mgmt/impl/test/sut/src/client.cpp
浏览文件 @
7974143d
...
...
@@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "
base
.h"
#include "
sut
.h"
static
void
processClientRsp
(
void
*
parent
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
TestClient
*
client
=
(
TestClient
*
)
parent
;
...
...
source/dnode/mgmt/impl/test/sut/src/server.cpp
浏览文件 @
7974143d
...
...
@@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "
base
.h"
#include "
sut
.h"
void
*
serverLoop
(
void
*
param
)
{
while
(
1
)
{
...
...
source/dnode/mgmt/impl/test/sut/src/
base
.cpp
→
source/dnode/mgmt/impl/test/sut/src/
sut
.cpp
浏览文件 @
7974143d
...
...
@@ -13,7 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "
base
.h"
#include "
sut
.h"
void
Testbase
::
InitLog
(
const
char
*
path
)
{
dDebugFlag
=
0
;
...
...
source/dnode/mgmt/impl/test/vgroup/vgroup.cpp
浏览文件 @
7974143d
...
...
@@ -9,7 +9,7 @@
*
*/
#include "
base
.h"
#include "
sut
.h"
class
DndTestVgroup
:
public
::
testing
::
Test
{
protected:
...
...
source/dnode/mnode/impl/test/acct/acct.cpp
浏览文件 @
7974143d
...
...
@@ -9,9 +9,9 @@
*
*/
#include "
base
.h"
#include "
sut
.h"
class
D
ndTestAcct
:
public
::
testing
::
Test
{
class
M
ndTestAcct
:
public
::
testing
::
Test
{
protected:
static
void
SetUpTestSuite
()
{
test
.
Init
(
"/tmp/mnode_test_acct"
,
9012
);
}
static
void
TearDownTestSuite
()
{
test
.
Cleanup
();
}
...
...
@@ -23,9 +23,9 @@ class DndTestAcct : public ::testing::Test {
void
TearDown
()
override
{}
};
Testbase
D
ndTestAcct
::
test
;
Testbase
M
ndTestAcct
::
test
;
TEST_F
(
DndTestAcct
,
01
_Create
Acct
)
{
TEST_F
(
MndTestAcct
,
01
_Create_
Acct
)
{
int32_t
contLen
=
sizeof
(
SCreateAcctReq
);
SCreateAcctReq
*
pReq
=
(
SCreateAcctReq
*
)
rpcMallocCont
(
contLen
);
...
...
@@ -35,7 +35,7 @@ TEST_F(DndTestAcct, 01_CreateAcct) {
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_MND_MSG_NOT_PROCESSED
);
}
TEST_F
(
DndTestAcct
,
02
_Alter
Acct
)
{
TEST_F
(
MndTestAcct
,
02
_Alter_
Acct
)
{
int32_t
contLen
=
sizeof
(
SCreateAcctReq
);
SAlterAcctReq
*
pReq
=
(
SAlterAcctReq
*
)
rpcMallocCont
(
contLen
);
...
...
@@ -45,7 +45,7 @@ TEST_F(DndTestAcct, 02_AlterAcct) {
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_MND_MSG_NOT_PROCESSED
);
}
TEST_F
(
DndTestAcct
,
03
_Drop
Acct
)
{
TEST_F
(
MndTestAcct
,
03
_Drop_
Acct
)
{
int32_t
contLen
=
sizeof
(
SDropAcctReq
);
SDropAcctReq
*
pReq
=
(
SDropAcctReq
*
)
rpcMallocCont
(
contLen
);
...
...
@@ -55,7 +55,7 @@ TEST_F(DndTestAcct, 03_DropAcct) {
ASSERT_EQ
(
pMsg
->
code
,
TSDB_CODE_MND_MSG_NOT_PROCESSED
);
}
TEST_F
(
DndTestAcct
,
04
_Show
Acct
)
{
TEST_F
(
MndTestAcct
,
04
_Show_
Acct
)
{
int32_t
contLen
=
sizeof
(
SShowMsg
);
SShowMsg
*
pReq
=
(
SShowMsg
*
)
rpcMallocCont
(
contLen
);
...
...
source/dnode/mnode/impl/test/bnode/bnode.cpp
浏览文件 @
7974143d
...
...
@@ -9,9 +9,9 @@
*
*/
#include "
base
.h"
#include "
sut
.h"
class
D
ndTestBnode
:
public
::
testing
::
Test
{
class
M
ndTestBnode
:
public
::
testing
::
Test
{
public:
void
SetUp
()
override
{}
void
TearDown
()
override
{}
...
...
@@ -35,10 +35,10 @@ class DndTestBnode : public ::testing::Test {
static
TestServer
server2
;
};
Testbase
D
ndTestBnode
::
test
;
TestServer
D
ndTestBnode
::
server2
;
Testbase
M
ndTestBnode
::
test
;
TestServer
M
ndTestBnode
::
server2
;
TEST_F
(
DndTestBnode
,
01
_Show
Bnode
)
{
TEST_F
(
MndTestBnode
,
01
_Show_
Bnode
)
{
test
.
SendShowMetaMsg
(
TSDB_MGMT_TABLE_BNODE
,
""
);
CHECK_META
(
"show bnodes"
,
3
);
...
...
@@ -50,7 +50,7 @@ TEST_F(DndTestBnode, 01_ShowBnode) {
EXPECT_EQ
(
test
.
GetShowRows
(),
0
);
}
TEST_F
(
D
ndTestBnode
,
02
_Create_Bnode_Invalid_Id
)
{
TEST_F
(
M
ndTestBnode
,
02
_Create_Bnode_Invalid_Id
)
{
{
int32_t
contLen
=
sizeof
(
SMCreateBnodeMsg
);
...
...
@@ -77,7 +77,7 @@ TEST_F(DndTestBnode, 02_Create_Bnode_Invalid_Id) {
}
}
TEST_F
(
D
ndTestBnode
,
03
_Create_Bnode_Invalid_Id
)
{
TEST_F
(
M
ndTestBnode
,
03
_Create_Bnode_Invalid_Id
)
{
{
int32_t
contLen
=
sizeof
(
SMCreateBnodeMsg
);
...
...
@@ -90,7 +90,7 @@ TEST_F(DndTestBnode, 03_Create_Bnode_Invalid_Id) {
}
}
TEST_F
(
D
ndTestBnode
,
04
_Create_Bnode
)
{
TEST_F
(
M
ndTestBnode
,
04
_Create_Bnode
)
{
{
// create dnode
int32_t
contLen
=
sizeof
(
SCreateDnodeMsg
);
...
...
source/dnode/mnode/impl/test/qnode/qnode.cpp
浏览文件 @
7974143d
...
...
@@ -9,9 +9,9 @@
*
*/
#include "
base
.h"
#include "
sut
.h"
class
D
ndTestQnode
:
public
::
testing
::
Test
{
class
M
ndTestQnode
:
public
::
testing
::
Test
{
public:
void
SetUp
()
override
{}
void
TearDown
()
override
{}
...
...
@@ -35,10 +35,10 @@ class DndTestQnode : public ::testing::Test {
static
TestServer
server2
;
};
Testbase
D
ndTestQnode
::
test
;
TestServer
D
ndTestQnode
::
server2
;
Testbase
M
ndTestQnode
::
test
;
TestServer
M
ndTestQnode
::
server2
;
TEST_F
(
DndTestQnode
,
01
_Show
Qnode
)
{
TEST_F
(
MndTestQnode
,
01
_Show_
Qnode
)
{
test
.
SendShowMetaMsg
(
TSDB_MGMT_TABLE_QNODE
,
""
);
CHECK_META
(
"show qnodes"
,
3
);
...
...
@@ -50,7 +50,7 @@ TEST_F(DndTestQnode, 01_ShowQnode) {
EXPECT_EQ
(
test
.
GetShowRows
(),
0
);
}
TEST_F
(
D
ndTestQnode
,
02
_Create_Qnode_Invalid_Id
)
{
TEST_F
(
M
ndTestQnode
,
02
_Create_Qnode_Invalid_Id
)
{
{
int32_t
contLen
=
sizeof
(
SMCreateQnodeMsg
);
...
...
@@ -77,7 +77,7 @@ TEST_F(DndTestQnode, 02_Create_Qnode_Invalid_Id) {
}
}
TEST_F
(
D
ndTestQnode
,
03
_Create_Qnode_Invalid_Id
)
{
TEST_F
(
M
ndTestQnode
,
03
_Create_Qnode_Invalid_Id
)
{
{
int32_t
contLen
=
sizeof
(
SMCreateQnodeMsg
);
...
...
@@ -90,7 +90,7 @@ TEST_F(DndTestQnode, 03_Create_Qnode_Invalid_Id) {
}
}
TEST_F
(
D
ndTestQnode
,
04
_Create_Qnode
)
{
TEST_F
(
M
ndTestQnode
,
04
_Create_Qnode
)
{
{
// create dnode
int32_t
contLen
=
sizeof
(
SCreateDnodeMsg
);
...
...
source/dnode/mnode/impl/test/snode/snode.cpp
浏览文件 @
7974143d
...
...
@@ -9,9 +9,9 @@
*
*/
#include "
base
.h"
#include "
sut
.h"
class
D
ndTestSnode
:
public
::
testing
::
Test
{
class
M
ndTestSnode
:
public
::
testing
::
Test
{
public:
void
SetUp
()
override
{}
void
TearDown
()
override
{}
...
...
@@ -35,10 +35,10 @@ class DndTestSnode : public ::testing::Test {
static
TestServer
server2
;
};
Testbase
D
ndTestSnode
::
test
;
TestServer
D
ndTestSnode
::
server2
;
Testbase
M
ndTestSnode
::
test
;
TestServer
M
ndTestSnode
::
server2
;
TEST_F
(
DndTestSnode
,
01
_Show
Snode
)
{
TEST_F
(
MndTestSnode
,
01
_Show_
Snode
)
{
test
.
SendShowMetaMsg
(
TSDB_MGMT_TABLE_SNODE
,
""
);
CHECK_META
(
"show snodes"
,
3
);
...
...
@@ -50,7 +50,7 @@ TEST_F(DndTestSnode, 01_ShowSnode) {
EXPECT_EQ
(
test
.
GetShowRows
(),
0
);
}
TEST_F
(
D
ndTestSnode
,
02
_Create_Snode_Invalid_Id
)
{
TEST_F
(
M
ndTestSnode
,
02
_Create_Snode_Invalid_Id
)
{
{
int32_t
contLen
=
sizeof
(
SMCreateSnodeMsg
);
...
...
@@ -77,7 +77,7 @@ TEST_F(DndTestSnode, 02_Create_Snode_Invalid_Id) {
}
}
TEST_F
(
D
ndTestSnode
,
03
_Create_Snode_Invalid_Id
)
{
TEST_F
(
M
ndTestSnode
,
03
_Create_Snode_Invalid_Id
)
{
{
int32_t
contLen
=
sizeof
(
SMCreateSnodeMsg
);
...
...
@@ -90,7 +90,7 @@ TEST_F(DndTestSnode, 03_Create_Snode_Invalid_Id) {
}
}
TEST_F
(
D
ndTestSnode
,
04
_Create_Snode
)
{
TEST_F
(
M
ndTestSnode
,
04
_Create_Snode
)
{
{
// create dnode
int32_t
contLen
=
sizeof
(
SCreateDnodeMsg
);
...
...
source/dnode/mnode/impl/test/trans/trans.cpp
浏览文件 @
7974143d
...
...
@@ -9,10 +9,10 @@
*
*/
#include "
base
.h"
#include "
sut
.h"
#include "os.h"
class
D
ndTestTrans
:
public
::
testing
::
Test
{
class
M
ndTestTrans
:
public
::
testing
::
Test
{
protected:
static
void
SetUpTestSuite
()
{
test
.
Init
(
"/tmp/mnode_test_trans"
,
9013
);
}
static
void
TearDownTestSuite
()
{
test
.
Cleanup
();
}
...
...
@@ -48,9 +48,9 @@ class DndTestTrans : public ::testing::Test {
void
TearDown
()
override
{}
};
Testbase
D
ndTestTrans
::
test
;
Testbase
M
ndTestTrans
::
test
;
TEST_F
(
DndTestTrans
,
01
_Create
User_Crash
)
{
TEST_F
(
MndTestTrans
,
01
_Create_
User_Crash
)
{
{
int32_t
contLen
=
sizeof
(
SCreateUserReq
);
...
...
source/dnode/mnode/impl/test/user/user.cpp
浏览文件 @
7974143d
...
...
@@ -9,9 +9,9 @@
*
*/
#include "
base
.h"
#include "
sut
.h"
class
D
ndTestUser
:
public
::
testing
::
Test
{
class
M
ndTestUser
:
public
::
testing
::
Test
{
protected:
static
void
SetUpTestSuite
()
{
test
.
Init
(
"/tmp/mnode_test_user"
,
9011
);
}
static
void
TearDownTestSuite
()
{
test
.
Cleanup
();
}
...
...
@@ -23,9 +23,9 @@ class DndTestUser : public ::testing::Test {
void
TearDown
()
override
{}
};
Testbase
D
ndTestUser
::
test
;
Testbase
M
ndTestUser
::
test
;
TEST_F
(
DndTestUser
,
01
_Show
User
)
{
TEST_F
(
MndTestUser
,
01
_Show_
User
)
{
test
.
SendShowMetaMsg
(
TSDB_MGMT_TABLE_USER
,
""
);
CHECK_META
(
"show users"
,
4
);
...
...
@@ -43,7 +43,7 @@ TEST_F(DndTestUser, 01_ShowUser) {
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
}
TEST_F
(
D
ndTestUser
,
02
_Create_User
)
{
TEST_F
(
M
ndTestUser
,
02
_Create_User
)
{
{
int32_t
contLen
=
sizeof
(
SCreateUserReq
);
...
...
@@ -99,7 +99,7 @@ TEST_F(DndTestUser, 02_Create_User) {
EXPECT_EQ
(
test
.
GetShowRows
(),
2
);
}
TEST_F
(
D
ndTestUser
,
03
_Alter_User
)
{
TEST_F
(
M
ndTestUser
,
03
_Alter_User
)
{
{
int32_t
contLen
=
sizeof
(
SAlterUserReq
);
...
...
@@ -149,7 +149,7 @@ TEST_F(DndTestUser, 03_Alter_User) {
}
}
TEST_F
(
D
ndTestUser
,
04
_Drop_User
)
{
TEST_F
(
M
ndTestUser
,
04
_Drop_User
)
{
{
int32_t
contLen
=
sizeof
(
SDropUserReq
);
...
...
@@ -190,7 +190,7 @@ TEST_F(DndTestUser, 04_Drop_User) {
EXPECT_EQ
(
test
.
GetShowRows
(),
1
);
}
TEST_F
(
D
ndTestUser
,
05
_Create_Drop_Alter_User
)
{
TEST_F
(
M
ndTestUser
,
05
_Create_Drop_Alter_User
)
{
{
int32_t
contLen
=
sizeof
(
SCreateUserReq
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录