Re: [PATCH v3 3/3] selftests/resctrl: Move cleanups out of individual tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Maciej,

On 2/22/2024 4:07 AM, Maciej Wieczor-Retman wrote:
> diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c
> index 161f5365b4f0..bae08d1221ec 100644
> --- a/tools/testing/selftests/resctrl/resctrl_tests.c
> +++ b/tools/testing/selftests/resctrl/resctrl_tests.c
> @@ -134,6 +134,8 @@ static void run_single_test(const struct resctrl_test *test, const struct user_p
>  	}
>  
>  	ret = test->run_test(test, uparams);
> +	if (test->cleanup)
> +		test->cleanup();
>  	ksft_test_result(!ret, "%s: test\n", test->name);
>  
>  cleanup:

I think this can be potentially confusing to do cleanup here and
then follow it with a test_cleanup(). Could this test specific
cleanup perhaps be called from the general test_cleanup() instead?

Reinette




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux