提交 dbe44ff1 编写于 作者: S Shengliang Guan

test: reopen qnodeTest

上级 a8ab69e6
aux_source_directory(. QTEST_SRC)
add_executable(mnode_test_qnode ${QTEST_SRC})
aux_source_directory(. MNODE_QNODE_TEST_SRC)
add_executable(mqnodeTest ${MNODE_QNODE_TEST_SRC})
target_link_libraries(
mnode_test_qnode
mqnodeTest
PUBLIC sut
)
add_test(
NAME mnode_test_qnode
COMMAND mnode_test_qnode
NAME mqnodeTest
COMMAND mqnodeTest
)
......@@ -39,14 +39,7 @@ Testbase MndTestQnode::test;
TestServer MndTestQnode::server2;
TEST_F(MndTestQnode, 01_Show_Qnode) {
test.SendShowMetaReq(TSDB_MGMT_TABLE_QNODE, "");
CHECK_META("show qnodes", 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.SendShowRetrieveReq();
test.SendShowReq(TSDB_MGMT_TABLE_QNODE, "qnodes", "");
EXPECT_EQ(test.GetShowRows(), 0);
}
......@@ -76,14 +69,8 @@ TEST_F(MndTestQnode, 02_Create_Qnode) {
ASSERT_NE(pRsp, nullptr);
ASSERT_EQ(pRsp->code, 0);
test.SendShowMetaReq(TSDB_MGMT_TABLE_QNODE, "");
CHECK_META("show qnodes", 3);
test.SendShowRetrieveReq();
test.SendShowReq(TSDB_MGMT_TABLE_QNODE, "qnodes", "");
EXPECT_EQ(test.GetShowRows(), 1);
CheckInt16(1);
CheckBinary("localhost:9014", TSDB_EP_LEN);
CheckTimestamp();
}
{
......@@ -115,8 +102,7 @@ TEST_F(MndTestQnode, 03_Drop_Qnode) {
ASSERT_EQ(pRsp->code, 0);
taosMsleep(1300);
test.SendShowMetaReq(TSDB_MGMT_TABLE_DNODE, "");
test.SendShowRetrieveReq();
test.SendShowReq(TSDB_MGMT_TABLE_DNODE, "dnodes", "");
EXPECT_EQ(test.GetShowRows(), 2);
}
......@@ -132,16 +118,8 @@ TEST_F(MndTestQnode, 03_Drop_Qnode) {
ASSERT_NE(pRsp, nullptr);
ASSERT_EQ(pRsp->code, 0);
test.SendShowMetaReq(TSDB_MGMT_TABLE_QNODE, "");
test.SendShowRetrieveReq();
test.SendShowReq(TSDB_MGMT_TABLE_QNODE, "qnodes", "");
EXPECT_EQ(test.GetShowRows(), 2);
CheckInt16(1);
CheckInt16(2);
CheckBinary("localhost:9014", TSDB_EP_LEN);
CheckBinary("localhost:9015", TSDB_EP_LEN);
CheckTimestamp();
CheckTimestamp();
}
{
......@@ -156,13 +134,8 @@ TEST_F(MndTestQnode, 03_Drop_Qnode) {
ASSERT_NE(pRsp, nullptr);
ASSERT_EQ(pRsp->code, 0);
test.SendShowMetaReq(TSDB_MGMT_TABLE_QNODE, "");
test.SendShowRetrieveReq();
test.SendShowReq(TSDB_MGMT_TABLE_QNODE, "qnodes", "");
EXPECT_EQ(test.GetShowRows(), 1);
CheckInt16(1);
CheckBinary("localhost:9014", TSDB_EP_LEN);
CheckTimestamp();
}
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册