Optimize the output of log and stat

This commit is contained in:
luwenpeng
2024-05-16 11:52:14 +08:00
parent 4c50a6dca7
commit 8d8a266f60
9 changed files with 120 additions and 51 deletions

View File

@@ -142,18 +142,21 @@ void packet_injector_test_frame_run(struct packet_injector_case *test)
char input_dir_abs_path[1024] = {0};
char output_dir_abs_path[1024] = {0};
char expect_dir_abs_path[1024] = {0};
char log_dir_abs_path[1024] = {0};
// absulute path
snprintf(config_file_abs_path, sizeof(config_file_abs_path), "%s/conf/stellar.toml", test->work_dir);
snprintf(input_dir_abs_path, sizeof(input_dir_abs_path), "%s/input/", test->work_dir);
snprintf(output_dir_abs_path, sizeof(output_dir_abs_path), "%s/output/", test->work_dir);
snprintf(expect_dir_abs_path, sizeof(expect_dir_abs_path), "%s/expect/", test->work_dir);
snprintf(log_dir_abs_path, sizeof(log_dir_abs_path), "%s/log/", test->work_dir);
// create directory
system_cmd("rm -rf %s", test->work_dir);
system_cmd("mkdir -p %s", input_dir_abs_path);
system_cmd("mkdir -p %s", output_dir_abs_path);
system_cmd("mkdir -p %s", expect_dir_abs_path);
system_cmd("mkdir -p %s", log_dir_abs_path);
// copy file to work directory
if (test->c2s_expect_pcap)