From 0526051edd43778bbd14c34ead72aa0aaa1c65d5 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 4 Jan 2022 04:18:09 -0800 Subject: [PATCH] minor changes --- source/dnode/mgmt/impl/test/CMakeLists.txt | 3 --- source/dnode/mnode/impl/test/CMakeLists.txt | 6 ++++- source/dnode/mnode/impl/test/acct/acct.cpp | 2 +- .../impl/test/bnode/CMakeLists.txt | 0 .../{mgmt => mnode}/impl/test/bnode/bnode.cpp | 26 +++++++++---------- .../impl/test/qnode/CMakeLists.txt | 0 .../{mgmt => mnode}/impl/test/qnode/qnode.cpp | 26 +++++++++---------- .../impl/test/snode/CMakeLists.txt | 0 .../{mgmt => mnode}/impl/test/snode/snode.cpp | 26 +++++++++---------- source/dnode/mnode/impl/test/trans/trans.cpp | 2 +- source/dnode/mnode/impl/test/user/user.cpp | 4 +-- 11 files changed, 48 insertions(+), 47 deletions(-) rename source/dnode/{mgmt => mnode}/impl/test/bnode/CMakeLists.txt (100%) rename source/dnode/{mgmt => mnode}/impl/test/bnode/bnode.cpp (87%) rename source/dnode/{mgmt => mnode}/impl/test/qnode/CMakeLists.txt (100%) rename source/dnode/{mgmt => mnode}/impl/test/qnode/qnode.cpp (87%) rename source/dnode/{mgmt => mnode}/impl/test/snode/CMakeLists.txt (100%) rename source/dnode/{mgmt => mnode}/impl/test/snode/snode.cpp (87%) diff --git a/source/dnode/mgmt/impl/test/CMakeLists.txt b/source/dnode/mgmt/impl/test/CMakeLists.txt index b36cdbd690..1896a605cd 100644 --- a/source/dnode/mgmt/impl/test/CMakeLists.txt +++ b/source/dnode/mgmt/impl/test/CMakeLists.txt @@ -7,9 +7,6 @@ add_subdirectory(db) add_subdirectory(dnode) # add_subdirectory(func) add_subdirectory(mnode) -add_subdirectory(qnode) -add_subdirectory(snode) -add_subdirectory(bnode) add_subdirectory(profile) add_subdirectory(show) add_subdirectory(stb) diff --git a/source/dnode/mnode/impl/test/CMakeLists.txt b/source/dnode/mnode/impl/test/CMakeLists.txt index dfac7a76c9..075ff38bc6 100644 --- a/source/dnode/mnode/impl/test/CMakeLists.txt +++ b/source/dnode/mnode/impl/test/CMakeLists.txt @@ -1,5 +1,9 @@ enable_testing() -add_subdirectory(acct) add_subdirectory(user) +add_subdirectory(acct) add_subdirectory(trans) +add_subdirectory(qnode) +add_subdirectory(snode) +add_subdirectory(bnode) + diff --git a/source/dnode/mnode/impl/test/acct/acct.cpp b/source/dnode/mnode/impl/test/acct/acct.cpp index f517b26596..5a7df55c4c 100644 --- a/source/dnode/mnode/impl/test/acct/acct.cpp +++ b/source/dnode/mnode/impl/test/acct/acct.cpp @@ -3,7 +3,7 @@ * @author slguan (slguan@taosdata.com) * @brief MNODE module acct tests * @version 1.0 - * @date 2021-12-15 + * @date 2022-01-04 * * @copyright Copyright (c) 2022 * diff --git a/source/dnode/mgmt/impl/test/bnode/CMakeLists.txt b/source/dnode/mnode/impl/test/bnode/CMakeLists.txt similarity index 100% rename from source/dnode/mgmt/impl/test/bnode/CMakeLists.txt rename to source/dnode/mnode/impl/test/bnode/CMakeLists.txt diff --git a/source/dnode/mgmt/impl/test/bnode/bnode.cpp b/source/dnode/mnode/impl/test/bnode/bnode.cpp similarity index 87% rename from source/dnode/mgmt/impl/test/bnode/bnode.cpp rename to source/dnode/mnode/impl/test/bnode/bnode.cpp index b1a85522c4..eee61cbf4e 100644 --- a/source/dnode/mgmt/impl/test/bnode/bnode.cpp +++ b/source/dnode/mnode/impl/test/bnode/bnode.cpp @@ -1,11 +1,11 @@ /** - * @file dnode.cpp + * @file bnode.cpp * @author slguan (slguan@taosdata.com) - * @brief DNODE module dnode-msg tests - * @version 0.1 - * @date 2021-12-15 + * @brief MNODE module bnode tests + * @version 1.0 + * @date 2022-01-05 * - * @copyright Copyright (c) 2021 + * @copyright Copyright (c) 2022 * */ @@ -18,11 +18,11 @@ class DndTestBnode : public ::testing::Test { public: static void SetUpTestSuite() { - test.Init("/tmp/dnode_test_bnode1", 9068); + test.Init("/tmp/mnode_test_bnode1", 9018); const char* fqdn = "localhost"; - const char* firstEp = "localhost:9068"; + const char* firstEp = "localhost:9018"; - server2.Start("/tmp/dnode_test_bnode2", fqdn, 9069, firstEp); + server2.Start("/tmp/mnode_test_bnode2", fqdn, 9019, firstEp); taosMsleep(300); } @@ -72,7 +72,7 @@ TEST_F(DndTestBnode, 02_Create_Bnode_Invalid_Id) { EXPECT_EQ(test.GetShowRows(), 1); CheckInt16(1); - CheckBinary("localhost:9068", TSDB_EP_LEN); + CheckBinary("localhost:9018", TSDB_EP_LEN); CheckTimestamp(); } } @@ -97,7 +97,7 @@ TEST_F(DndTestBnode, 04_Create_Bnode) { SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen); strcpy(pReq->fqdn, "localhost"); - pReq->port = htonl(9069); + pReq->port = htonl(9019); SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_DNODE, pReq, contLen); ASSERT_NE(pMsg, nullptr); @@ -126,8 +126,8 @@ TEST_F(DndTestBnode, 04_Create_Bnode) { CheckInt16(1); CheckInt16(2); - CheckBinary("localhost:9068", TSDB_EP_LEN); - CheckBinary("localhost:9069", TSDB_EP_LEN); + CheckBinary("localhost:9018", TSDB_EP_LEN); + CheckBinary("localhost:9019", TSDB_EP_LEN); CheckTimestamp(); CheckTimestamp(); } @@ -148,7 +148,7 @@ TEST_F(DndTestBnode, 04_Create_Bnode) { EXPECT_EQ(test.GetShowRows(), 1); CheckInt16(1); - CheckBinary("localhost:9068", TSDB_EP_LEN); + CheckBinary("localhost:9018", TSDB_EP_LEN); CheckTimestamp(); } } \ No newline at end of file diff --git a/source/dnode/mgmt/impl/test/qnode/CMakeLists.txt b/source/dnode/mnode/impl/test/qnode/CMakeLists.txt similarity index 100% rename from source/dnode/mgmt/impl/test/qnode/CMakeLists.txt rename to source/dnode/mnode/impl/test/qnode/CMakeLists.txt diff --git a/source/dnode/mgmt/impl/test/qnode/qnode.cpp b/source/dnode/mnode/impl/test/qnode/qnode.cpp similarity index 87% rename from source/dnode/mgmt/impl/test/qnode/qnode.cpp rename to source/dnode/mnode/impl/test/qnode/qnode.cpp index 40464de816..6e71eb51eb 100644 --- a/source/dnode/mgmt/impl/test/qnode/qnode.cpp +++ b/source/dnode/mnode/impl/test/qnode/qnode.cpp @@ -1,11 +1,11 @@ /** - * @file dnode.cpp + * @file qnode.cpp * @author slguan (slguan@taosdata.com) - * @brief DNODE module dnode-msg tests - * @version 0.1 - * @date 2021-12-15 + * @brief MNODE module qnode tests + * @version 1.0 + * @date 2022-01-05 * - * @copyright Copyright (c) 2021 + * @copyright Copyright (c) 2022 * */ @@ -18,11 +18,11 @@ class DndTestQnode : public ::testing::Test { public: static void SetUpTestSuite() { - test.Init("/tmp/dnode_test_qnode1", 9064); + test.Init("/tmp/mnode_test_qnode1", 9014); const char* fqdn = "localhost"; - const char* firstEp = "localhost:9064"; + const char* firstEp = "localhost:9014"; - server2.Start("/tmp/dnode_test_qnode2", fqdn, 9065, firstEp); + server2.Start("/tmp/mnode_test_qnode2", fqdn, 9015, firstEp); taosMsleep(300); } @@ -72,7 +72,7 @@ TEST_F(DndTestQnode, 02_Create_Qnode_Invalid_Id) { EXPECT_EQ(test.GetShowRows(), 1); CheckInt16(1); - CheckBinary("localhost:9064", TSDB_EP_LEN); + CheckBinary("localhost:9014", TSDB_EP_LEN); CheckTimestamp(); } } @@ -97,7 +97,7 @@ TEST_F(DndTestQnode, 04_Create_Qnode) { SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen); strcpy(pReq->fqdn, "localhost"); - pReq->port = htonl(9065); + pReq->port = htonl(9015); SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_DNODE, pReq, contLen); ASSERT_NE(pMsg, nullptr); @@ -126,8 +126,8 @@ TEST_F(DndTestQnode, 04_Create_Qnode) { CheckInt16(1); CheckInt16(2); - CheckBinary("localhost:9064", TSDB_EP_LEN); - CheckBinary("localhost:9065", TSDB_EP_LEN); + CheckBinary("localhost:9014", TSDB_EP_LEN); + CheckBinary("localhost:9015", TSDB_EP_LEN); CheckTimestamp(); CheckTimestamp(); } @@ -148,7 +148,7 @@ TEST_F(DndTestQnode, 04_Create_Qnode) { EXPECT_EQ(test.GetShowRows(), 1); CheckInt16(1); - CheckBinary("localhost:9064", TSDB_EP_LEN); + CheckBinary("localhost:9014", TSDB_EP_LEN); CheckTimestamp(); } } \ No newline at end of file diff --git a/source/dnode/mgmt/impl/test/snode/CMakeLists.txt b/source/dnode/mnode/impl/test/snode/CMakeLists.txt similarity index 100% rename from source/dnode/mgmt/impl/test/snode/CMakeLists.txt rename to source/dnode/mnode/impl/test/snode/CMakeLists.txt diff --git a/source/dnode/mgmt/impl/test/snode/snode.cpp b/source/dnode/mnode/impl/test/snode/snode.cpp similarity index 87% rename from source/dnode/mgmt/impl/test/snode/snode.cpp rename to source/dnode/mnode/impl/test/snode/snode.cpp index a14a575beb..4c32edc152 100644 --- a/source/dnode/mgmt/impl/test/snode/snode.cpp +++ b/source/dnode/mnode/impl/test/snode/snode.cpp @@ -1,11 +1,11 @@ /** - * @file dnode.cpp + * @file snode.cpp * @author slguan (slguan@taosdata.com) - * @brief DNODE module dnode-msg tests - * @version 0.1 - * @date 2021-12-15 + * @brief MNODE module snode tests + * @version 1.0 + * @date 2022-01-05 * - * @copyright Copyright (c) 2021 + * @copyright Copyright (c) 2022 * */ @@ -18,11 +18,11 @@ class DndTestSnode : public ::testing::Test { public: static void SetUpTestSuite() { - test.Init("/tmp/dnode_test_snode1", 9066); + test.Init("/tmp/mnode_test_snode1", 9016); const char* fqdn = "localhost"; - const char* firstEp = "localhost:9066"; + const char* firstEp = "localhost:9016"; - server2.Start("/tmp/dnode_test_snode2", fqdn, 9067, firstEp); + server2.Start("/tmp/mnode_test_snode2", fqdn, 9017, firstEp); taosMsleep(300); } @@ -72,7 +72,7 @@ TEST_F(DndTestSnode, 02_Create_Snode_Invalid_Id) { EXPECT_EQ(test.GetShowRows(), 1); CheckInt16(1); - CheckBinary("localhost:9066", TSDB_EP_LEN); + CheckBinary("localhost:9016", TSDB_EP_LEN); CheckTimestamp(); } } @@ -97,7 +97,7 @@ TEST_F(DndTestSnode, 04_Create_Snode) { SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen); strcpy(pReq->fqdn, "localhost"); - pReq->port = htonl(9067); + pReq->port = htonl(9017); SRpcMsg* pMsg = test.SendMsg(TDMT_MND_CREATE_DNODE, pReq, contLen); ASSERT_NE(pMsg, nullptr); @@ -126,8 +126,8 @@ TEST_F(DndTestSnode, 04_Create_Snode) { CheckInt16(1); CheckInt16(2); - CheckBinary("localhost:9066", TSDB_EP_LEN); - CheckBinary("localhost:9067", TSDB_EP_LEN); + CheckBinary("localhost:9016", TSDB_EP_LEN); + CheckBinary("localhost:9017", TSDB_EP_LEN); CheckTimestamp(); CheckTimestamp(); } @@ -148,7 +148,7 @@ TEST_F(DndTestSnode, 04_Create_Snode) { EXPECT_EQ(test.GetShowRows(), 1); CheckInt16(1); - CheckBinary("localhost:9066", TSDB_EP_LEN); + CheckBinary("localhost:9016", TSDB_EP_LEN); CheckTimestamp(); } } \ No newline at end of file diff --git a/source/dnode/mnode/impl/test/trans/trans.cpp b/source/dnode/mnode/impl/test/trans/trans.cpp index 19bba13345..ca7a8a0981 100644 --- a/source/dnode/mnode/impl/test/trans/trans.cpp +++ b/source/dnode/mnode/impl/test/trans/trans.cpp @@ -2,7 +2,7 @@ * @file trans.cpp * @author slguan (slguan@taosdata.com) * @brief MNODE module trans tests - * @version 0.1 + * @version 1.0 * @date 2022-01-04 * * @copyright Copyright (c) 2022 diff --git a/source/dnode/mnode/impl/test/user/user.cpp b/source/dnode/mnode/impl/test/user/user.cpp index 5ccb079633..ce8fd1b166 100644 --- a/source/dnode/mnode/impl/test/user/user.cpp +++ b/source/dnode/mnode/impl/test/user/user.cpp @@ -3,9 +3,9 @@ * @author slguan (slguan@taosdata.com) * @brief MNODE module user tests * @version 1.0 - * @date 2021-12-15 + * @date 2022-01-04 * - * @copyright Copyright (c) 2021 + * @copyright Copyright (c) 2022 * */