summaryrefslogtreecommitdiff
path: root/test/src/gtest_master.cpp
diff options
context:
space:
mode:
authorliuxueli <[email protected]>2023-07-10 14:11:36 +0800
committerliuxueli <[email protected]>2023-07-10 14:12:43 +0800
commit94c07e1f085571d92f10b4450b2df10edd7526e4 (patch)
treeb0e426331e2d43c1140ae6b6e5a0fb53ec0c9329 /test/src/gtest_master.cpp
parent03e160d3a4de988c9bb71a77639199ff36e09177 (diff)
TSG-13811: 修正识别结果,quic.ssl修正为quic
Diffstat (limited to 'test/src/gtest_master.cpp')
-rw-r--r--test/src/gtest_master.cpp36
1 files changed, 34 insertions, 2 deletions
diff --git a/test/src/gtest_master.cpp b/test/src/gtest_master.cpp
index 5153a6e..24abc1a 100644
--- a/test/src/gtest_master.cpp
+++ b/test/src/gtest_master.cpp
@@ -1198,10 +1198,42 @@ TEST(TSGMaster, SessionQuicIdentify)
g_test_quic_info=NULL;
}
+TEST(TSGMaster, SessionApplicationFullPathTSG13811)
+{
+ char out_full_path[256]={0};
+ int out_full_path_len=sizeof(out_full_path);
+ struct gather_app_result gather_result={0};
+
+ gather_result.l7_protocol_num=1;
+ struct app_attributes l7_protocol={68, 0, 4};
+ gather_result.l7_protocol=&l7_protocol;
+
+ gather_result.qm_engine_num=3;
+ gather_result.l7_qm_engine_num=2;
+ struct app_attributes qm_engine[3]={{199, 0, 6}, {68, 0, 4}, {240, 0, 6}};
+ gather_result.qm_engine=qm_engine;
+
+ int offset=session_application_full_path_combine(&gather_result, out_full_path, out_full_path_len);
+ EXPECT_NE(0, offset);
+ EXPECT_STREQ("ssl.https.youtube", out_full_path);
+
+ // l7 protocol is empty
+ gather_result.l7_protocol_num=0;
+ gather_result.l7_protocol=NULL;
+
+ gather_result.qm_engine_num=3;
+ gather_result.l7_qm_engine_num=0;
+ struct app_attributes qm_engine2[3]={{199, 0, 6}, {68, 0, 4}, {240, 0, 6}};
+ gather_result.qm_engine=qm_engine2;
+
+ offset=session_application_full_path_combine(&gather_result, out_full_path, out_full_path_len);
+ EXPECT_NE(0, offset);
+ EXPECT_STREQ("ssl.https.youtube", out_full_path);
+}
+
int main(int argc, char *argv[])
{
TSG_MASTER_INIT();
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
-}
-
+} \ No newline at end of file