diff options
| author | 刘学利 <[email protected]> | 2023-02-07 02:51:03 +0000 |
|---|---|---|
| committer | 刘学利 <[email protected]> | 2023-02-07 02:51:03 +0000 |
| commit | ccf02881faee0879ad36ee09ee5e32de8758a731 (patch) | |
| tree | fcd06da2d070c10f05ee96898b40765ad3fd8f6c /test/src/gtest_rule.cpp | |
| parent | 5328511bfb1f8e116e6fa87703c7f251a5ac4a7e (diff) | |
TSG-13520,TSG-13356: 支持通过tsg_pull_shaping_result函数获取命中的shaping策略,增加common_shaping_rule_ids日志字段,支持通过bridge接口及时通知命中的shaping策略,增加gtest测试用例v5.10.0
Diffstat (limited to 'test/src/gtest_rule.cpp')
| -rw-r--r-- | test/src/gtest_rule.cpp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/test/src/gtest_rule.cpp b/test/src/gtest_rule.cpp new file mode 100644 index 0000000..9b346ab --- /dev/null +++ b/test/src/gtest_rule.cpp @@ -0,0 +1,69 @@ +#include <stdio.h> +#include <string.h> +#include <unistd.h> + +#include "tsg_entry.h" +#include "gtest_common.h" + +#include <gtest/gtest.h> + +g_tsg_para_t g_tsg_para; +id2field_t g_tsg_proto_name2id[PROTO_MAX]={{PROTO_UNKONWN, 0, "unknown"}, + {PROTO_IPv4, 0, "IPV4"}, + {PROTO_IPv6, 0, "IPV6"}, + {PROTO_TCP, 0, "TCP"}, + {PROTO_UDP, 0, "UDP"}, + {PROTO_HTTP, 0, "HTTP"}, + {PROTO_MAIL, 0, "MAIL"}, + {PROTO_DNS, 0, "DNS"}, + {PROTO_FTP, 0, "FTP"}, + {PROTO_SSL, 0, "SSL"}, + {PROTO_SIP, 0, "SIP"}, + {PROTO_BGP, 0, "BGP"}, + {PROTO_STREAMING_MEDIA, 0, "STREAMING_MEDIA"}, + {PROTO_QUIC, 0, "QUIC"}, + {PROTO_SSH, 0, "SSH"}, + {PROTO_SMTP, 0, "SMTP"}, + {PROTO_IMAP, 0, "IMAP"}, + {PROTO_POP3, 0, "POP3"}, + {PROTO_RTP, 0, "RTP"}, + {PROTO_APP, 0, "BASE"}, + {PROTO_L2TP, 0, "L2TP"}, + {PROTO_PPTP, 0, "PPTP"}, + {PROTO_STRATUM, 0, "Stratum"}, + {PROTO_RDP, 0, "RDP"}, + {PROTO_DTLS, 0, "DTLS"} + }; + +unsigned int tsg_l7_protocol_name2id(const char *l7_protocol_name) +{ + return 0; +} + +void free_policy_label(int thread_seq, void *project_req_value) +{ +} + +void set_session_attribute_label(const struct streaminfo *a_stream, enum TSG_ATTRIBUTE_TYPE type, void *value, int value_len, int thread_seq) +{ +} + +int tsg_get_umts_user_info(const struct streaminfo *a_stream, struct umts_user_info **user_info) +{ + return 0; +} + + +TEST(MasterTest, SetVlan) +{ + //int ret=set_vlan(NULL, NULL, NULL, 0, NULL, LOG_COMMON_TUNNELS_VLAN_SRC_ID); + //EXPECT_EQ(1, ret); +} + + +int main(int argc, char *argv[]) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} + |
