Hi Shaopeng,
On 2/12/2023 10:24 PM, Shaopeng Tan wrote:
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 therefor 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.
Signed-off-by: Shaopeng Tan tan.shaopeng@jp.fujitsu.com
Reviewed-by: Reinette Chatre reinette.chatre@intel.com
Thank you very much
Reinette