enable http test case.

This commit is contained in:
lijia
2024-08-21 10:05:10 +08:00
parent 3cdfabb683
commit baefff5a16
4 changed files with 46 additions and 32 deletions

View File

@@ -2,4 +2,4 @@ add_subdirectory(packet_inject)
add_subdirectory(packet_tool) add_subdirectory(packet_tool)
add_subdirectory(debug_plugin) add_subdirectory(debug_plugin)
#add_subdirectory(glimpse_detector) #add_subdirectory(glimpse_detector)
#add_subdirectory(decoders/http) add_subdirectory(decoders/http)

View File

@@ -138,13 +138,12 @@ int main(int argc, char *argv[])
assert(g_load_result_root != NULL && g_test_result_root != NULL); assert(g_load_result_root != NULL && g_test_result_root != NULL);
} }
::testing::InitGoogleTest(&argc, argv); ::testing::InitGoogleTest(&argc, argv);
if (stellar_run(argc - 1, argv + 1) < 0) struct stellar *st = stellar_new("./conf/stellar.toml", "./plugin/spec.toml", "./conf/log.toml");
{ stellar_run(st);
return -1;
}
if (result_json_path != NULL) if (result_json_path != NULL)
{ {
ret = RUN_ALL_TESTS(); ret = RUN_ALL_TESTS();
} }
stellar_free(st);
return ret; return ret;
} }

View File

@@ -1,4 +1,4 @@
[log] [log]
output = file # stderr, file output = "stderr" # stderr, file
file = "log/stellar.log" file = "log/stellar.log"
level = DEBUG # TRACE, DEBUG, INFO, WARN, ERROR, FATAL level = "ERROR" # TRACE, DEBUG, INFO, WARN, ERROR, FATAL

View File

@@ -1,16 +1,17 @@
[id_generator] [snowflake]
snowflake_worker_id_base = 1 # [0, 31] snowflake_base = 1 # [0, 31]
snowflake_worker_id_offset = 2 # [0, 127] snowflake_offset = 2 # [0, 127]
[packet_io] [packet_io]
mode = dumpfile # dumpfile, marsio mode = "dumpfile" # dumpfile, dumpfilelist, marsio
app_symbol = stellar app_symbol = "stellar"
dev_symbol = nf_0_fw dev_symbol = "nf_0_fw"
dumpfile_path = "./pcap/test.pcap"
#dumpfile_path = "/tmp/dumpfile/dumpfilelist"
dumpfile_dir = "./pcap"
nr_threads = 1 # [1, 256] nr_threads = 1 # [1, 256]
#cpu_mask = [5, 6, 7, 8, 9, 10, 11, 12] cpu_mask = [5, 6, 7, 8, 9, 10, 11, 12]
cpu_mask = [5]
[ip_reassembly] [ip_reassembly]
enable = 1 enable = 1
@@ -20,38 +21,52 @@ bucket_num = 4096 # range: [1, 4294967295]
[session_manager] [session_manager]
# max session number # max session number
max_tcp_session_num = 1000 max_tcp_session_num = 50000
max_udp_session_num = 1000 max_udp_session_num = 50000
# session overload evict # session overload evict
tcp_overload_evict_old_sess = 1 # 1: evict old session, 0: bypass new session tcp_overload_evict_old_sess = 1 # 1: evict old session, 0: bypass new session
udp_overload_evict_old_sess = 1 # 1: evict old session, 0: bypass new session udp_overload_evict_old_sess = 1 # 1: evict old session, 0: bypass new session
# TCP timeout # TCP timeout
tcp_init_timeout = 10 # range: [1, 60000] (ms) tcp_init_timeout = 50 # range: [1, 60000] (ms)
tcp_handshake_timeout = 10 # range: [1, 60000] (ms) tcp_handshake_timeout = 50 # range: [1, 60000] (ms)
tcp_data_timeout = 10 # range: [1, 15999999000] (ms) tcp_data_timeout = 50 # range: [1, 15999999000] (ms)
tcp_half_closed_timeout = 10 # range: [1, 604800000] (ms) tcp_half_closed_timeout = 50 # range: [1, 604800000] (ms)
tcp_time_wait_timeout = 10 # range: [1, 600000] (ms) tcp_time_wait_timeout = 50 # range: [1, 600000] (ms)
tcp_discard_timeout = 10 # range: [1, 15999999000] (ms) tcp_discard_timeout = 10 # range: [1, 15999999000] (ms)
tcp_unverified_rst_timeout = 10 # range: [1, 600000] (ms) tcp_unverified_rst_timeout = 50 # range: [1, 600000] (ms)
# UDP timeout # UDP timeout
udp_data_timeout = 10 # range: [1, 15999999000] (ms) udp_data_timeout = 50 # range: [1, 15999999000] (ms)
udp_discard_timeout = 10 # range: [1, 15999999000] (ms) udp_discard_timeout = 50 # range: [1, 15999999000] (ms)
# duplicate packet filter # duplicate packet filter
duplicated_packet_filter_enable = 0 duplicated_packet_filter_enable = 1
duplicated_packet_filter_capacity = 1000000 # range: [1, 4294967295] duplicated_packet_filter_capacity = 1000000 # range: [1, 4294967295]
duplicated_packet_filter_timeout = 10 # range: [1, 60000] (ms) duplicated_packet_filter_timeout = 10000 # range: [1, 60000] (ms)
duplicated_packet_filter_error_rate = 0.00001 # range: [0.0, 1.0] duplicated_packet_filter_error_rate = 0.00001 # range: [0.0, 1.0]
# evicted session filter # evicted session filter
evicted_session_filter_enable = 0 evicted_session_filter_enable = 1
evicted_session_filter_capacity = 1000000 # range: [1, 4294967295] evicted_session_filter_capacity = 1000000 # range: [1, 4294967295]
evicted_session_filter_timeout = 10 # range: [1, 60000] (ms) evicted_session_filter_timeout = 10000 # range: [1, 60000] (ms)
evicted_session_filter_error_rate = 0.00001 # range: [0.0, 1.0] evicted_session_filter_error_rate = 0.00001 # range: [0.0, 1.0]
# TCP reassembly (Per direction) # TCP reassembly (Per direction)
tcp_reassembly_enable = 1 tcp_reassembly_enable = 1
tcp_reassembly_max_timeout = 10 # range: [1, 60000] (ms) tcp_reassembly_max_timeout = 10000 # range: [1, 60000] (ms)
tcp_reassembly_max_segments = 256 # range: [2, 4096] tcp_reassembly_max_segments = 256 # range: [2, 4096]
[schedule]
# Note: free_expired_session_interval determines the precision of session_manager timeout
free_expired_session_interval = 50 # range: [1, 60000] (ms)
free_expired_session_batch = 100 # range: [1, 60000]
# Note: free_expired_ip_frag_interval determines the precision of ip_reassembly timeout
free_expired_ip_frag_interval = 50 # range: [1, 60000] (ms)
free_expired_ip_frag_batch = 100 # range: [1, 60000]
merge_stat_interval = 50 # range: [1, 60000] (ms)
output_stat_interval = 10 # range: [1, 60000] (ms)
packet_io_yield_interval = 90 # range: [1, 60000] (ms)