diff --git a/test/drivers/event_class/network_utils.h b/test/drivers/event_class/network_utils.h index 2c1d503a08..5550da5558 100644 --- a/test/drivers/event_class/network_utils.h +++ b/test/drivers/event_class/network_utils.h @@ -64,7 +64,7 @@ /*=============================== UNIX ===========================*/ /* Max length socket unix path. */ -#define MAX_SUN_PATH 109 +#define MAX_SUN_PATH 108 /* Unix Client: the `xyzxe-` prefix is used to avoid name collisions */ #define UNIX_CLIENT "/tmp/xyzxe-client" diff --git a/test/drivers/helpers/proc_parsing.h b/test/drivers/helpers/proc_parsing.h index 6c398cf375..ee4a85dfd5 100644 --- a/test/drivers/helpers/proc_parsing.h +++ b/test/drivers/helpers/proc_parsing.h @@ -12,18 +12,18 @@ * in which we don't need them all. */ struct proc_info { - uint32_t tty; - pid_t ppid; /* The PID of the parent of this process. */ - pid_t pgid; /* The process group ID of the process. */ - char raw_args[MAX_NUM_ARGS][MAX_PATH]; - const char* args[MAX_NUM_ARGS]; - uint32_t uid; - uint32_t gid; - uint32_t vpid; - uint32_t vtid; - struct rlimit file_rlimit; - uint32_t loginuid; - char exepath[MAX_PATH]; + uint32_t tty = 0; + pid_t ppid = 0; /* The PID of the parent of this process. */ + pid_t pgid = 0; /* The process group ID of the process. */ + char raw_args[MAX_NUM_ARGS][MAX_PATH] = {}; + const char* args[MAX_NUM_ARGS] = {}; + uint32_t uid = 0; + uint32_t gid = 0; + uint32_t vpid = 0; + uint32_t vtid = 0; + struct rlimit file_rlimit = {0, 0}; + uint32_t loginuid = 0; + char exepath[MAX_PATH] = {}; }; bool get_proc_info(pid_t pid, proc_info* info); diff --git a/test/drivers/test_suites/generic_tracepoints_suite/sched_process_exec.cpp b/test/drivers/test_suites/generic_tracepoints_suite/sched_process_exec.cpp index a050340333..8f86e50de7 100644 --- a/test/drivers/test_suites/generic_tracepoints_suite/sched_process_exec.cpp +++ b/test/drivers/test_suites/generic_tracepoints_suite/sched_process_exec.cpp @@ -42,7 +42,7 @@ TEST(GenericTracepoints, sched_proc_exec) { /* We need to use `SIGCHLD` otherwise the parent won't receive any signal * when the child terminates. */ - clone_args cl_args = {0}; + clone_args cl_args = {}; cl_args.exit_signal = SIGCHLD; pid_t ret_pid = syscall(__NR_clone3, &cl_args, sizeof(cl_args)); @@ -182,7 +182,7 @@ TEST(GenericTracepoints, sched_proc_exec_success_memfd) { /* We need to use `SIGCHLD` otherwise the parent won't receive any signal * when the child terminates. */ - clone_args cl_args = {0}; + clone_args cl_args = {}; cl_args.exit_signal = SIGCHLD; pid_t ret_pid = syscall(__NR_clone3, &cl_args, sizeof(cl_args)); diff --git a/test/drivers/test_suites/generic_tracepoints_suite/sched_process_fork.cpp b/test/drivers/test_suites/generic_tracepoints_suite/sched_process_fork.cpp index ceae169b82..f90f7fc0b6 100644 --- a/test/drivers/test_suites/generic_tracepoints_suite/sched_process_fork.cpp +++ b/test/drivers/test_suites/generic_tracepoints_suite/sched_process_fork.cpp @@ -14,7 +14,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_clone3) { /*=============================== TRIGGER SYSCALL ===========================*/ /* Here we scan the parent just to obtain some info for the child */ - struct proc_info info = {0}; + struct proc_info info = {}; pid_t pid = ::getpid(); if(!get_proc_info(pid, &info)) { FAIL() << "Unable to get all the info from proc" << std::endl; @@ -23,7 +23,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_clone3) { /* We need to use `SIGCHLD` otherwise the parent won't receive any signal * when the child terminates. We use `CLONE_FILES` just to test the flags. */ - clone_args cl_args = {0}; + clone_args cl_args = {}; cl_args.flags = CLONE_FILES; cl_args.exit_signal = SIGCHLD; pid_t ret_pid = syscall(__NR_clone3, &cl_args, sizeof(cl_args)); @@ -122,7 +122,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_clone3_create_child_with_2_threads pid_t p1_t1 = 61001; pid_t p1_t2 = 61004; - clone_args cl_args_parent = {0}; + clone_args cl_args_parent = {}; cl_args_parent.set_tid = (uint64_t)&p1_t1; cl_args_parent.set_tid_size = 1; cl_args_parent.exit_signal = SIGCHLD; @@ -131,7 +131,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_clone3_create_child_with_2_threads /* Create a child process that will spawn a new thread */ if(ret_pid == 0) { /* Spawn a new thread */ - clone_args cl_args_child = {0}; + clone_args cl_args_child = {}; cl_args_child.set_tid = (uint64_t)&p1_t2; cl_args_child.set_tid_size = 1; /* CLONE_PARENT has no additional effects if we are spawning a thread @@ -223,14 +223,14 @@ TEST(GenericTracepoints, sched_proc_fork_case_clone3_child_clone_parent_flag) { pid_t p1_t1 = 61024; pid_t p2_t1 = 60128; - clone_args cl_args_parent = {0}; + clone_args cl_args_parent = {}; cl_args_parent.set_tid = (uint64_t)&p1_t1; cl_args_parent.set_tid_size = 1; cl_args_parent.exit_signal = SIGCHLD; pid_t ret_pid = syscall(__NR_clone3, &cl_args_parent, sizeof(cl_args_parent)); if(ret_pid == 0) { - clone_args cl_args_child = {0}; + clone_args cl_args_child = {}; cl_args_child.set_tid = (uint64_t)&p2_t1; cl_args_child.set_tid_size = 1; cl_args_child.flags = CLONE_PARENT; @@ -327,7 +327,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_clone3_child_new_namespace_from_ch /* Here we create a child process in a new namespace. */ pid_t p1_t1[2] = {1, 61032}; - clone_args cl_args = {0}; + clone_args cl_args = {}; cl_args.set_tid = (uint64_t)&p1_t1; cl_args.set_tid_size = 2; cl_args.flags = CLONE_NEWPID; @@ -411,7 +411,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_clone3_child_new_namespace_create_ /* Please note that a process can have the same pid number in different namespaces */ pid_t p1_t2[2] = {61036, 61036}; - clone_args cl_args = {0}; + clone_args cl_args = {}; cl_args.set_tid = (uint64_t)&p1_t1; cl_args.set_tid_size = 2; cl_args.flags = CLONE_NEWPID; @@ -420,7 +420,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_clone3_child_new_namespace_create_ if(ret_pid == 0) { /* Spawn a new thread */ - clone_args cl_args_child = {0}; + clone_args cl_args_child = {}; cl_args_child.set_tid = (uint64_t)&p1_t2; cl_args_child.set_tid_size = 2; cl_args_child.flags = CLONE_THREAD | CLONE_SIGHAND | CLONE_VM | CLONE_VFORK; @@ -502,7 +502,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_clone) { /*=============================== TRIGGER SYSCALL ===========================*/ /* Here we scan the parent just to obtain some info for the child */ - struct proc_info info = {0}; + struct proc_info info = {}; pid_t pid = ::getpid(); if(!get_proc_info(pid, &info)) { FAIL() << "Unable to get all the info from proc" << std::endl; @@ -611,7 +611,7 @@ TEST(GenericTracepoints, sched_proc_fork_case_fork) { /*=============================== TRIGGER SYSCALL ===========================*/ /* Here we scan the parent just to obtain some info for the child */ - struct proc_info info = {0}; + struct proc_info info = {}; pid_t pid = ::getpid(); if(!get_proc_info(pid, &info)) { FAIL() << "Unable to get all the info from proc" << std::endl; diff --git a/test/drivers/test_suites/syscall_enter_suite/connect_e.cpp b/test/drivers/test_suites/syscall_enter_suite/connect_e.cpp index c5225e5313..fc6b6fed23 100644 --- a/test/drivers/test_suites/syscall_enter_suite/connect_e.cpp +++ b/test/drivers/test_suites/syscall_enter_suite/connect_e.cpp @@ -169,10 +169,10 @@ TEST(SyscallEnter, connectE_UNIX_failure) { */ #define UNIX_LONG_PATH \ "/unix_socket/test/too_long/too_long/too_long/too_long/unix_socket/test/too_long/too_long/" \ - "too_long/too_longgg*" + "too_long/too_longgg" #define EXPECTED_UNIX_LONG_PATH \ "/unix_socket/test/too_long/too_long/too_long/too_long/unix_socket/test/too_long/too_long/" \ - "too_long/too_longgg" + "too_long/too_longg" TEST(SyscallEnter, connectE_UNIX_max_path_failure) { auto evt_test = get_syscall_event_test(__NR_connect, ENTER_EVENT);