Skip to content
Commit 73c55fa5 authored by Shaopeng Tan's avatar Shaopeng Tan Committed by Shuah Khan
Browse files

selftests/resctrl: Commonize the signal handler register/unregister for all tests



After creating a child process with fork() in CAT test, if a signal such
as SIGINT is received, the parent process will be terminated immediately,
and therefore the child process will not be killed and also resctrlfs is
not unmounted.

There is a signal handler registered in CMT/MBM/MBA tests, which kills
child process, unmount resctrlfs, cleanups result files, etc., if a
signal such as SIGINT is received.

Commonize the signal handler registered for CMT/MBM/MBA tests and
reuse it in CAT.

To reuse the signal handler to kill child process use global bm_pid
instead of local bm_pid.

Also, since the MBA/MBA/CMT/CAT are run in order, unregister the signal
handler at the end of each test so that the signal handler cannot be
inherited by other tests.

Reviewed-by: default avatarIlpo Jarvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarShaopeng Tan <tan.shaopeng@jp.fujitsu.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 39e34ddc
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment