diff --git a/source/dnode/mgmt/impl/test/CMakeLists.txt b/source/dnode/mgmt/impl/test/CMakeLists.txt
index 1896a605cd3b455f83ba7a1fda70031e89ad6f7e..6e6015b5f41d30fbeb0c61fcd98f63eeb608998c 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 0000000000000000000000000000000000000000..b06fd1bbca74a49bd71d2a179b8a62b55828f488
--- /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 773482678977a7096b5469d141fa21d2568dae25..7d9bff7b23cba4196fffc27da2ae16c3e23028bc 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 7ba19677fd38e2ca182495268a56be240d928bee..a78b8388c62f151601cef59896c6951506cf280c 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 54d7e73be6542d8391dfdfddaf5f3f7857a7db1d..9041098d71c9acb570c1dd59662b298fd21024f0 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 e9b1ef45bdd419f17aa97b0f60cb43d9837efebe..3d4844c3f6044b0dd3fa9da5ad4df0d5ac645b8f 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 87e6bfde747926e58cc5b4257ca1ea9ca9e025bb..77122d1bb9e95fd33e0d9e9580cc7d6ae40a11aa 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 0000000000000000000000000000000000000000..2536001231c82537d64735ce14ada91f45501d07
--- /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 0000000000000000000000000000000000000000..8678e098f4dbb9b1738b468d17e2d0f473812374
--- /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 a0df0f29218a63e5141adaa9244605c569802353..8622672758a40593a602aa5efe046f375c04163a 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 dca0f4851658caa57ec264a9ce9c896e5e44fc45..40af751e3335e8ba1362ef279d6f04490d4cc136 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 13429cec28217886cdb44e5fe8672b43746402f8..086ba7bb0f7e4c6a63f5c7e32823014608a986a0 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 8ac5f6214430a1e46f757f755e97b2fca28c4119..fb2974294cf24b4ae944e844f865571ad26c6bfd 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 e1b6664e9fcfa2f59be737cbef6752c96976a7d1..46ced254c60230bf4726f82e09f00183b7aea021 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 718fbea50d9f880e4d61b469fd750a0c878b7cca..15a0c8087caaf7770b04787c8ffef87659623ce1 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 5a7df55c4ca4bd567019de333736d7f2309f06e5..906a066f74cd0c155321aaa60603ac3e7f42f885 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 eee61cbf4e0b171f8ff936e9b6916170d74812ed..2d44249f776cb3022ff5559c61db9864b16990e2 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 6e71eb51ebaaa29b226a51a73d187aee45004797..ca768db56c9a1a53098ef5cbdfd52a18bd2c9b56 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 4c32edc15230ab5a1601ae689864b28fc3fcd9ae..7816de6ab918299c18ee63dd55dbc4172acc9214 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 ca7a8a0981040c5d46ecb99856ba8531d3d414d4..97a8bd2caf22200858ad5c5615ccf445f60f15cf 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 ce8fd1b166c166d60336978ff245bb6bdab8c457..76954db21348921964fc48a214e6c858d470311e 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);