diff --git a/source/dnode/mgmt/impl/test/CMakeLists.txt b/source/dnode/mgmt/impl/test/CMakeLists.txt
index 1896a605cd..6e6015b5f4 100644
--- a/source/dnode/mgmt/impl/test/CMakeLists.txt
+++ b/source/dnode/mgmt/impl/test/CMakeLists.txt
@@ -1,5 +1,7 @@
enable_testing()
+add_subdirectory(qnode)
+
# add_subdirectory(auth)
# add_subdirectory(balance)
add_subdirectory(cluster)
diff --git a/source/dnode/mgmt/impl/test/bnode/bnode.cpp b/source/dnode/mgmt/impl/test/bnode/bnode.cpp
new file mode 100644
index 0000000000..b06fd1bbca
--- /dev/null
+++ b/source/dnode/mgmt/impl/test/bnode/bnode.cpp
@@ -0,0 +1,154 @@
+/**
+ * @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
diff --git a/source/dnode/mgmt/impl/test/cluster/cluster.cpp b/source/dnode/mgmt/impl/test/cluster/cluster.cpp
index 7734826789..7d9bff7b23 100644
--- a/source/dnode/mgmt/impl/test/cluster/cluster.cpp
+++ b/source/dnode/mgmt/impl/test/cluster/cluster.cpp
@@ -9,7 +9,7 @@
*
*/
-#include "base.h"
+#include "sut.h"
class DndTestCluster : public ::testing::Test {
protected:
diff --git a/source/dnode/mgmt/impl/test/db/db.cpp b/source/dnode/mgmt/impl/test/db/db.cpp
index 7ba19677fd..a78b8388c6 100644
--- a/source/dnode/mgmt/impl/test/db/db.cpp
+++ b/source/dnode/mgmt/impl/test/db/db.cpp
@@ -9,7 +9,7 @@
*
*/
-#include "base.h"
+#include "sut.h"
class DndTestDb : public ::testing::Test {
protected:
diff --git a/source/dnode/mgmt/impl/test/dnode/dnode.cpp b/source/dnode/mgmt/impl/test/dnode/dnode.cpp
index 54d7e73be6..9041098d71 100644
--- a/source/dnode/mgmt/impl/test/dnode/dnode.cpp
+++ b/source/dnode/mgmt/impl/test/dnode/dnode.cpp
@@ -9,7 +9,7 @@
*
*/
-#include "base.h"
+#include "sut.h"
class DndTestDnode : public ::testing::Test {
public:
diff --git a/source/dnode/mgmt/impl/test/mnode/mnode.cpp b/source/dnode/mgmt/impl/test/mnode/mnode.cpp
index e9b1ef45bd..3d4844c3f6 100644
--- a/source/dnode/mgmt/impl/test/mnode/mnode.cpp
+++ b/source/dnode/mgmt/impl/test/mnode/mnode.cpp
@@ -9,7 +9,7 @@
*
*/
-#include "base.h"
+#include "sut.h"
class DndTestMnode : public ::testing::Test {
public:
diff --git a/source/dnode/mgmt/impl/test/profile/profile.cpp b/source/dnode/mgmt/impl/test/profile/profile.cpp
index 87e6bfde74..77122d1bb9 100644
--- a/source/dnode/mgmt/impl/test/profile/profile.cpp
+++ b/source/dnode/mgmt/impl/test/profile/profile.cpp
@@ -9,7 +9,7 @@
*
*/
-#include "base.h"
+#include "sut.h"
class DndTestProfile : public ::testing::Test {
protected:
diff --git a/source/dnode/mgmt/impl/test/qnode/CMakeLists.txt b/source/dnode/mgmt/impl/test/qnode/CMakeLists.txt
new file mode 100644
index 0000000000..2536001231
--- /dev/null
+++ b/source/dnode/mgmt/impl/test/qnode/CMakeLists.txt
@@ -0,0 +1,11 @@
+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
+)
diff --git a/source/dnode/mgmt/impl/test/qnode/dqnode.cpp b/source/dnode/mgmt/impl/test/qnode/dqnode.cpp
new file mode 100644
index 0000000000..8678e098f4
--- /dev/null
+++ b/source/dnode/mgmt/impl/test/qnode/dqnode.cpp
@@ -0,0 +1,26 @@
+/**
+ * @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;
diff --git a/source/dnode/mgmt/impl/test/show/show.cpp b/source/dnode/mgmt/impl/test/show/show.cpp
index a0df0f2921..8622672758 100644
--- a/source/dnode/mgmt/impl/test/show/show.cpp
+++ b/source/dnode/mgmt/impl/test/show/show.cpp
@@ -9,7 +9,7 @@
*
*/
-#include "base.h"
+#include "sut.h"
class DndTestShow : public ::testing::Test {
protected:
diff --git a/source/dnode/mgmt/impl/test/stb/stb.cpp b/source/dnode/mgmt/impl/test/stb/stb.cpp
index dca0f48516..40af751e33 100644
--- a/source/dnode/mgmt/impl/test/stb/stb.cpp
+++ b/source/dnode/mgmt/impl/test/stb/stb.cpp
@@ -9,7 +9,7 @@
*
*/
-#include "base.h"
+#include "sut.h"
class DndTestStb : public ::testing::Test {
protected:
diff --git a/source/dnode/mgmt/impl/test/sut/inc/base.h b/source/dnode/mgmt/impl/test/sut/inc/sut.h
similarity index 100%
rename from source/dnode/mgmt/impl/test/sut/inc/base.h
rename to source/dnode/mgmt/impl/test/sut/inc/sut.h
diff --git a/source/dnode/mgmt/impl/test/sut/src/client.cpp b/source/dnode/mgmt/impl/test/sut/src/client.cpp
index 13429cec28..086ba7bb0f 100644
--- a/source/dnode/mgmt/impl/test/sut/src/client.cpp
+++ b/source/dnode/mgmt/impl/test/sut/src/client.cpp
@@ -13,7 +13,7 @@
* along with this program. If not, see .
*/
-#include "base.h"
+#include "sut.h"
static void processClientRsp(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) {
TestClient* client = (TestClient*)parent;
diff --git a/source/dnode/mgmt/impl/test/sut/src/server.cpp b/source/dnode/mgmt/impl/test/sut/src/server.cpp
index 8ac5f62144..fb2974294c 100644
--- a/source/dnode/mgmt/impl/test/sut/src/server.cpp
+++ b/source/dnode/mgmt/impl/test/sut/src/server.cpp
@@ -13,7 +13,7 @@
* along with this program. If not, see .
*/
-#include "base.h"
+#include "sut.h"
void* serverLoop(void* param) {
while (1) {
diff --git a/source/dnode/mgmt/impl/test/sut/src/base.cpp b/source/dnode/mgmt/impl/test/sut/src/sut.cpp
similarity index 99%
rename from source/dnode/mgmt/impl/test/sut/src/base.cpp
rename to source/dnode/mgmt/impl/test/sut/src/sut.cpp
index e1b6664e9f..46ced254c6 100644
--- a/source/dnode/mgmt/impl/test/sut/src/base.cpp
+++ b/source/dnode/mgmt/impl/test/sut/src/sut.cpp
@@ -13,7 +13,7 @@
* along with this program. If not, see .
*/
-#include "base.h"
+#include "sut.h"
void Testbase::InitLog(const char* path) {
dDebugFlag = 0;
diff --git a/source/dnode/mgmt/impl/test/vgroup/vgroup.cpp b/source/dnode/mgmt/impl/test/vgroup/vgroup.cpp
index 718fbea50d..15a0c8087c 100644
--- a/source/dnode/mgmt/impl/test/vgroup/vgroup.cpp
+++ b/source/dnode/mgmt/impl/test/vgroup/vgroup.cpp
@@ -9,7 +9,7 @@
*
*/
-#include "base.h"
+#include "sut.h"
class DndTestVgroup : public ::testing::Test {
protected:
diff --git a/source/dnode/mnode/impl/test/acct/acct.cpp b/source/dnode/mnode/impl/test/acct/acct.cpp
index 5a7df55c4c..906a066f74 100644
--- a/source/dnode/mnode/impl/test/acct/acct.cpp
+++ b/source/dnode/mnode/impl/test/acct/acct.cpp
@@ -9,9 +9,9 @@
*
*/
-#include "base.h"
+#include "sut.h"
-class DndTestAcct : public ::testing::Test {
+class MndTestAcct : 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 DndTestAcct::test;
+Testbase MndTestAcct::test;
-TEST_F(DndTestAcct, 01_CreateAcct) {
+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_AlterAcct) {
+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_DropAcct) {
+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_ShowAcct) {
+TEST_F(MndTestAcct, 04_Show_Acct) {
int32_t contLen = sizeof(SShowMsg);
SShowMsg* pReq = (SShowMsg*)rpcMallocCont(contLen);
diff --git a/source/dnode/mnode/impl/test/bnode/bnode.cpp b/source/dnode/mnode/impl/test/bnode/bnode.cpp
index eee61cbf4e..2d44249f77 100644
--- a/source/dnode/mnode/impl/test/bnode/bnode.cpp
+++ b/source/dnode/mnode/impl/test/bnode/bnode.cpp
@@ -9,9 +9,9 @@
*
*/
-#include "base.h"
+#include "sut.h"
-class DndTestBnode : public ::testing::Test {
+class MndTestBnode : public ::testing::Test {
public:
void SetUp() override {}
void TearDown() override {}
@@ -35,10 +35,10 @@ class DndTestBnode : public ::testing::Test {
static TestServer server2;
};
-Testbase DndTestBnode::test;
-TestServer DndTestBnode::server2;
+Testbase MndTestBnode::test;
+TestServer MndTestBnode::server2;
-TEST_F(DndTestBnode, 01_ShowBnode) {
+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(DndTestBnode, 02_Create_Bnode_Invalid_Id) {
+TEST_F(MndTestBnode, 02_Create_Bnode_Invalid_Id) {
{
int32_t contLen = sizeof(SMCreateBnodeMsg);
@@ -77,7 +77,7 @@ TEST_F(DndTestBnode, 02_Create_Bnode_Invalid_Id) {
}
}
-TEST_F(DndTestBnode, 03_Create_Bnode_Invalid_Id) {
+TEST_F(MndTestBnode, 03_Create_Bnode_Invalid_Id) {
{
int32_t contLen = sizeof(SMCreateBnodeMsg);
@@ -90,7 +90,7 @@ TEST_F(DndTestBnode, 03_Create_Bnode_Invalid_Id) {
}
}
-TEST_F(DndTestBnode, 04_Create_Bnode) {
+TEST_F(MndTestBnode, 04_Create_Bnode) {
{
// create dnode
int32_t contLen = sizeof(SCreateDnodeMsg);
diff --git a/source/dnode/mnode/impl/test/qnode/qnode.cpp b/source/dnode/mnode/impl/test/qnode/qnode.cpp
index 6e71eb51eb..ca768db56c 100644
--- a/source/dnode/mnode/impl/test/qnode/qnode.cpp
+++ b/source/dnode/mnode/impl/test/qnode/qnode.cpp
@@ -9,9 +9,9 @@
*
*/
-#include "base.h"
+#include "sut.h"
-class DndTestQnode : public ::testing::Test {
+class MndTestQnode : public ::testing::Test {
public:
void SetUp() override {}
void TearDown() override {}
@@ -35,10 +35,10 @@ class DndTestQnode : public ::testing::Test {
static TestServer server2;
};
-Testbase DndTestQnode::test;
-TestServer DndTestQnode::server2;
+Testbase MndTestQnode::test;
+TestServer MndTestQnode::server2;
-TEST_F(DndTestQnode, 01_ShowQnode) {
+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(DndTestQnode, 02_Create_Qnode_Invalid_Id) {
+TEST_F(MndTestQnode, 02_Create_Qnode_Invalid_Id) {
{
int32_t contLen = sizeof(SMCreateQnodeMsg);
@@ -77,7 +77,7 @@ TEST_F(DndTestQnode, 02_Create_Qnode_Invalid_Id) {
}
}
-TEST_F(DndTestQnode, 03_Create_Qnode_Invalid_Id) {
+TEST_F(MndTestQnode, 03_Create_Qnode_Invalid_Id) {
{
int32_t contLen = sizeof(SMCreateQnodeMsg);
@@ -90,7 +90,7 @@ TEST_F(DndTestQnode, 03_Create_Qnode_Invalid_Id) {
}
}
-TEST_F(DndTestQnode, 04_Create_Qnode) {
+TEST_F(MndTestQnode, 04_Create_Qnode) {
{
// create dnode
int32_t contLen = sizeof(SCreateDnodeMsg);
diff --git a/source/dnode/mnode/impl/test/snode/snode.cpp b/source/dnode/mnode/impl/test/snode/snode.cpp
index 4c32edc152..7816de6ab9 100644
--- a/source/dnode/mnode/impl/test/snode/snode.cpp
+++ b/source/dnode/mnode/impl/test/snode/snode.cpp
@@ -9,9 +9,9 @@
*
*/
-#include "base.h"
+#include "sut.h"
-class DndTestSnode : public ::testing::Test {
+class MndTestSnode : public ::testing::Test {
public:
void SetUp() override {}
void TearDown() override {}
@@ -35,10 +35,10 @@ class DndTestSnode : public ::testing::Test {
static TestServer server2;
};
-Testbase DndTestSnode::test;
-TestServer DndTestSnode::server2;
+Testbase MndTestSnode::test;
+TestServer MndTestSnode::server2;
-TEST_F(DndTestSnode, 01_ShowSnode) {
+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(DndTestSnode, 02_Create_Snode_Invalid_Id) {
+TEST_F(MndTestSnode, 02_Create_Snode_Invalid_Id) {
{
int32_t contLen = sizeof(SMCreateSnodeMsg);
@@ -77,7 +77,7 @@ TEST_F(DndTestSnode, 02_Create_Snode_Invalid_Id) {
}
}
-TEST_F(DndTestSnode, 03_Create_Snode_Invalid_Id) {
+TEST_F(MndTestSnode, 03_Create_Snode_Invalid_Id) {
{
int32_t contLen = sizeof(SMCreateSnodeMsg);
@@ -90,7 +90,7 @@ TEST_F(DndTestSnode, 03_Create_Snode_Invalid_Id) {
}
}
-TEST_F(DndTestSnode, 04_Create_Snode) {
+TEST_F(MndTestSnode, 04_Create_Snode) {
{
// create dnode
int32_t contLen = sizeof(SCreateDnodeMsg);
diff --git a/source/dnode/mnode/impl/test/trans/trans.cpp b/source/dnode/mnode/impl/test/trans/trans.cpp
index ca7a8a0981..97a8bd2caf 100644
--- a/source/dnode/mnode/impl/test/trans/trans.cpp
+++ b/source/dnode/mnode/impl/test/trans/trans.cpp
@@ -9,10 +9,10 @@
*
*/
-#include "base.h"
+#include "sut.h"
#include "os.h"
-class DndTestTrans : public ::testing::Test {
+class MndTestTrans : 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 DndTestTrans::test;
+Testbase MndTestTrans::test;
-TEST_F(DndTestTrans, 01_CreateUser_Crash) {
+TEST_F(MndTestTrans, 01_Create_User_Crash) {
{
int32_t contLen = sizeof(SCreateUserReq);
diff --git a/source/dnode/mnode/impl/test/user/user.cpp b/source/dnode/mnode/impl/test/user/user.cpp
index ce8fd1b166..76954db213 100644
--- a/source/dnode/mnode/impl/test/user/user.cpp
+++ b/source/dnode/mnode/impl/test/user/user.cpp
@@ -9,9 +9,9 @@
*
*/
-#include "base.h"
+#include "sut.h"
-class DndTestUser : public ::testing::Test {
+class MndTestUser : 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 DndTestUser::test;
+Testbase MndTestUser::test;
-TEST_F(DndTestUser, 01_ShowUser) {
+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(DndTestUser, 02_Create_User) {
+TEST_F(MndTestUser, 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(DndTestUser, 03_Alter_User) {
+TEST_F(MndTestUser, 03_Alter_User) {
{
int32_t contLen = sizeof(SAlterUserReq);
@@ -149,7 +149,7 @@ TEST_F(DndTestUser, 03_Alter_User) {
}
}
-TEST_F(DndTestUser, 04_Drop_User) {
+TEST_F(MndTestUser, 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(DndTestUser, 05_Create_Drop_Alter_User) {
+TEST_F(MndTestUser, 05_Create_Drop_Alter_User) {
{
int32_t contLen = sizeof(SCreateUserReq);