Re: [PATCH v3 2/7] selftests/resctrl: Extend signal handler coverage to unmount on receiving signal

From: Reinette Chatre
Date: Fri Sep 29 2023 - 12:56:06 EST


Hi Ilpo,

On 9/29/2023 4:20 AM, Ilpo Järvinen wrote:
...
> diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c
> index 823672a20a43..4eab2fad97fb 100644
> --- a/tools/testing/selftests/resctrl/resctrl_tests.c
> +++ b/tools/testing/selftests/resctrl/resctrl_tests.c
> @@ -67,21 +67,45 @@ void tests_cleanup(void)
> cat_test_cleanup();
> }
>
> -static void run_mbm_test(const char * const *benchmark_cmd, int cpu_no)
> +static int test_prepare()

Please change to test_prepare(void) (checkpatch error).

> {
> int res;
>
> - ksft_print_msg("Starting MBM BW change ...\n");
> + res = signal_handler_register();
> + if (res) {
> + ksft_print_msg("Failed to register signal handler\n");
> + return res;
> + }
>
> res = mount_resctrlfs();
> if (res) {
> - ksft_exit_fail_msg("Failed to mount resctrl FS\n");
> + signal_handler_unregister();
> + ksft_print_msg("Failed to mount resctrl FS\n");
> + return res;
> + }
> + return 0;
> +}
> +
> +static void test_cleanup()

Please change to test_cleanup(void) (checkpatch error).

> +{
> + umount_resctrlfs();
> + signal_handler_unregister();
> +}
> +

With the above two reports addressed you can add:

Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>

Thank you.

Reinette