test: reopen qnodeTest
This commit is contained in:
parent
a8ab69e6cb
commit
dbe44ff136
|
@ -1,11 +1,11 @@
|
||||||
aux_source_directory(. QTEST_SRC)
|
aux_source_directory(. MNODE_QNODE_TEST_SRC)
|
||||||
add_executable(mnode_test_qnode ${QTEST_SRC})
|
add_executable(mqnodeTest ${MNODE_QNODE_TEST_SRC})
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
mnode_test_qnode
|
mqnodeTest
|
||||||
PUBLIC sut
|
PUBLIC sut
|
||||||
)
|
)
|
||||||
|
|
||||||
add_test(
|
add_test(
|
||||||
NAME mnode_test_qnode
|
NAME mqnodeTest
|
||||||
COMMAND mnode_test_qnode
|
COMMAND mqnodeTest
|
||||||
)
|
)
|
||||||
|
|
|
@ -39,14 +39,7 @@ Testbase MndTestQnode::test;
|
||||||
TestServer MndTestQnode::server2;
|
TestServer MndTestQnode::server2;
|
||||||
|
|
||||||
TEST_F(MndTestQnode, 01_Show_Qnode) {
|
TEST_F(MndTestQnode, 01_Show_Qnode) {
|
||||||
test.SendShowMetaReq(TSDB_MGMT_TABLE_QNODE, "");
|
test.SendShowReq(TSDB_MGMT_TABLE_QNODE, "qnodes", "");
|
||||||
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();
|
|
||||||
EXPECT_EQ(test.GetShowRows(), 0);
|
EXPECT_EQ(test.GetShowRows(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,14 +69,8 @@ TEST_F(MndTestQnode, 02_Create_Qnode) {
|
||||||
ASSERT_NE(pRsp, nullptr);
|
ASSERT_NE(pRsp, nullptr);
|
||||||
ASSERT_EQ(pRsp->code, 0);
|
ASSERT_EQ(pRsp->code, 0);
|
||||||
|
|
||||||
test.SendShowMetaReq(TSDB_MGMT_TABLE_QNODE, "");
|
test.SendShowReq(TSDB_MGMT_TABLE_QNODE, "qnodes", "");
|
||||||
CHECK_META("show qnodes", 3);
|
|
||||||
test.SendShowRetrieveReq();
|
|
||||||
EXPECT_EQ(test.GetShowRows(), 1);
|
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);
|
ASSERT_EQ(pRsp->code, 0);
|
||||||
|
|
||||||
taosMsleep(1300);
|
taosMsleep(1300);
|
||||||
test.SendShowMetaReq(TSDB_MGMT_TABLE_DNODE, "");
|
test.SendShowReq(TSDB_MGMT_TABLE_DNODE, "dnodes", "");
|
||||||
test.SendShowRetrieveReq();
|
|
||||||
EXPECT_EQ(test.GetShowRows(), 2);
|
EXPECT_EQ(test.GetShowRows(), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,16 +118,8 @@ TEST_F(MndTestQnode, 03_Drop_Qnode) {
|
||||||
ASSERT_NE(pRsp, nullptr);
|
ASSERT_NE(pRsp, nullptr);
|
||||||
ASSERT_EQ(pRsp->code, 0);
|
ASSERT_EQ(pRsp->code, 0);
|
||||||
|
|
||||||
test.SendShowMetaReq(TSDB_MGMT_TABLE_QNODE, "");
|
test.SendShowReq(TSDB_MGMT_TABLE_QNODE, "qnodes", "");
|
||||||
test.SendShowRetrieveReq();
|
|
||||||
EXPECT_EQ(test.GetShowRows(), 2);
|
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_NE(pRsp, nullptr);
|
||||||
ASSERT_EQ(pRsp->code, 0);
|
ASSERT_EQ(pRsp->code, 0);
|
||||||
|
|
||||||
test.SendShowMetaReq(TSDB_MGMT_TABLE_QNODE, "");
|
test.SendShowReq(TSDB_MGMT_TABLE_QNODE, "qnodes", "");
|
||||||
test.SendShowRetrieveReq();
|
|
||||||
EXPECT_EQ(test.GetShowRows(), 1);
|
EXPECT_EQ(test.GetShowRows(), 1);
|
||||||
|
|
||||||
CheckInt16(1);
|
|
||||||
CheckBinary("localhost:9014", TSDB_EP_LEN);
|
|
||||||
CheckTimestamp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue