diff options
| author | 杨威 <[email protected]> | 2023-05-04 11:23:00 +0800 |
|---|---|---|
| committer | 杨威 <[email protected]> | 2023-05-04 17:44:49 +0800 |
| commit | 05b5750627c59fd283d3497fb558ce5c6c56e0be (patch) | |
| tree | 837962ffd7ddb7334d5b33d4a9ed9d321b1ef7b9 /module_test | |
| parent | 219b474fd4ea5939c56c90086d03ece28acd21dd (diff) | |
🧪 test(tcp plug test): 修改返回值为droppkt行为后,更新测试用例
测试APP_STATE_KILL_OTHER返回值效果
Diffstat (limited to 'module_test')
| -rw-r--r-- | module_test/src/gtest_main.cpp | 4 | ||||
| -rw-r--r-- | module_test/src/gtest_sapp_fun.h | 2 | ||||
| -rw-r--r-- | module_test/src/gtest_sapp_tcp.cpp | 6 | ||||
| -rw-r--r-- | module_test/src/gtest_sapp_tcp_plug.cpp | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/module_test/src/gtest_main.cpp b/module_test/src/gtest_main.cpp index 1e0d38d..f00dc1e 100644 --- a/module_test/src/gtest_main.cpp +++ b/module_test/src/gtest_main.cpp @@ -372,9 +372,9 @@ TEST(tcp, oos_lost_pkt) } #define _tcp_plug_droppkt_test 1 // for SI symbol view -TEST(tcp, plug_droppkt) +TEST(tcp, plug_killother) { - tcp_plug_droppkt_run(); + tcp_plug_killother_run(); ASSERT_EQ(GTEST_SAPP_SUCC, gtest_get_libsapp_devel_result()); } diff --git a/module_test/src/gtest_sapp_fun.h b/module_test/src/gtest_sapp_fun.h index 27a5478..2847903 100644 --- a/module_test/src/gtest_sapp_fun.h +++ b/module_test/src/gtest_sapp_fun.h @@ -254,7 +254,7 @@ void MESA_rst_tcp_with_vpls_run(void); void MESA_rst_tcp_with_double_vlan_run(void); void MESA_rst_tcp_with_8021ad_qinq_run(void); void MESA_rst_tcp_mpls_vlan_mpls_c2s_run(void); -void tcp_plug_droppkt_run(void); +void tcp_plug_killother_run(void); void MESA_inject_tcp_payload_test_v4_run(void); void sapp_inject_tcp_payload_test_v4_run(void); void MESA_inject_udp_mpls_vlan_mpls_s2c_run(void); diff --git a/module_test/src/gtest_sapp_tcp.cpp b/module_test/src/gtest_sapp_tcp.cpp index 0cc92ff..4dcb69a 100644 --- a/module_test/src/gtest_sapp_tcp.cpp +++ b/module_test/src/gtest_sapp_tcp.cpp @@ -159,7 +159,7 @@ void tcp_call_order_for_reset_check_run(void) -static void tcp_droppkt_env_init(void) +static void tcp_plug_killother_env_init(void) { set_default_config(); @@ -185,10 +185,10 @@ static void tcp_droppkt_env_init(void) /* 测试插件返回DROPPKT处理逻辑 */ -void tcp_plug_droppkt_run(void) +void tcp_plug_killother_run(void) { set_default_config(); - tcp_droppkt_env_init(); + tcp_plug_killother_env_init(); set_pcap_dumpfile("tcp/tcp_simple.pcap"); ASSERT_EQ(file_md5_checksum("dumpfile", "df138740a6a22ca9c977052f21f7a470"),0); diff --git a/module_test/src/gtest_sapp_tcp_plug.cpp b/module_test/src/gtest_sapp_tcp_plug.cpp index 57b9590..49a6a51 100644 --- a/module_test/src/gtest_sapp_tcp_plug.cpp +++ b/module_test/src/gtest_sapp_tcp_plug.cpp @@ -450,7 +450,7 @@ extern "C" int tcp_plug_droppkt_second_init(void) } -extern "C" char tcp_plug_droppkt_first(struct streaminfo *pstream,void **pme, int thread_seq, void *a_packet) +extern "C" unsigned char tcp_plug_droppkt_first(struct streaminfo *pstream,void **pme, int thread_seq, void *a_packet) { struct plug_droppkt_stat_t *droppkt_stat; @@ -475,7 +475,7 @@ extern "C" char tcp_plug_droppkt_first(struct streaminfo *pstream,void **pme, in } } - return APP_STATE_GIVEME | APP_STATE_DROPPKT; + return APP_STATE_GIVEME | APP_STATE_KILL_OTHER; } |
