diff options
| author | liuxueli <[email protected]> | 2023-07-07 17:29:37 +0800 |
|---|---|---|
| committer | liuxueli <[email protected]> | 2023-07-07 17:29:37 +0800 |
| commit | 03e160d3a4de988c9bb71a77639199ff36e09177 (patch) | |
| tree | 43be5da4b8994e09c54dc86fb9c6287807d6c2cd /test/src/gtest_master.cpp | |
| parent | 8b469b61370915e263d466086d2e9d0bad08bfb1 (diff) | |
增加生成app_full_path测试用例
Diffstat (limited to 'test/src/gtest_master.cpp')
| -rw-r--r-- | test/src/gtest_master.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/src/gtest_master.cpp b/test/src/gtest_master.cpp index 93bb7f5..5153a6e 100644 --- a/test/src/gtest_master.cpp +++ b/test/src/gtest_master.cpp @@ -1010,6 +1010,41 @@ TEST(TSGMaster, SessionApplicationMetrics) } +extern int session_application_full_path_update(const struct streaminfo *a_stream, char *app_full_path, int app_full_path_len); + +TEST(TSGMaster, SessionApplicationFullPathTSG15999) +{ + const struct streaminfo a_stream={0}; + char out_full_path[256]={0}; + int out_full_path_len=sizeof(out_full_path); + struct gather_app_result *gather_result=(struct gather_app_result *)calloc(1, sizeof(struct gather_app_result)); + + gather_result->l7_protocol_num=1; + gather_result->l7_protocol=(struct app_attributes *)calloc(1, sizeof(struct app_attributes)); + gather_result->l7_protocol->app_id=68; + gather_result->l7_protocol->surrogate_id=0; + gather_result->l7_protocol->packet_sequence=4; + + gather_result->qm_engine_num=2; + gather_result->qm_engine=(struct app_attributes *)calloc(1, sizeof(struct app_attributes)*2); + gather_result->qm_engine[0].app_id=199; + gather_result->qm_engine[0].surrogate_id=0; + gather_result->qm_engine[0].packet_sequence=6; + gather_result->qm_engine[1].app_id=68; + gather_result->qm_engine[1].surrogate_id=0; + gather_result->qm_engine[1].packet_sequence=4; + + session_gather_app_results_async(&a_stream, (void *)gather_result); + + session_application_full_path_update(&a_stream, out_full_path, out_full_path_len); + EXPECT_STREQ("ssl.https", out_full_path); + + free(gather_result->l7_protocol); + free(gather_result->qm_engine); + free(gather_result); + session_gather_app_results_async(&a_stream, NULL); +} + extern int session_application_full_path_combine(struct gather_app_result * gather_result, char * out_full_path, int out_full_path_len); TEST(TSGMaster, SessionApplicationFullPath) |
