diff mbox series

[09/10] request_key03: Add max_runtime

Message ID 20220830135007.16818-10-mdoucha@suse.cz
State Changes Requested
Headers show
Series Max_runtime and other minor fixes | expand

Commit Message

Martin Doucha Aug. 30, 2022, 1:50 p.m. UTC
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 testcases/kernel/syscalls/request_key/request_key03.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Petr Vorel Aug. 31, 2022, 9:45 a.m. UTC | #1
Hi Martin,

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr
Petr Vorel Aug. 31, 2022, 9:47 a.m. UTC | #2
Hi Martin,

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr
Cyril Hrubis Aug. 31, 2022, 12:24 p.m. UTC | #3
Hi!
> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> ---
>  testcases/kernel/syscalls/request_key/request_key03.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/testcases/kernel/syscalls/request_key/request_key03.c b/testcases/kernel/syscalls/request_key/request_key03.c
> index 3f0c093f3..5cd9b319d 100644
> --- a/testcases/kernel/syscalls/request_key/request_key03.c
> +++ b/testcases/kernel/syscalls/request_key/request_key03.c
> @@ -182,6 +182,7 @@ static void do_test(void)
>  static struct tst_test test = {
>  	.test_all = do_test,
>  	.forks_child = 1,
> +	.max_runtime = 10,
>  	.options = (struct tst_option[]) {
>  		{"b:", &opt_bug,  "Bug to test for (cve-2017-15299 or cve-2017-15951; default is both)"},
>  		{}

First of all I would split the do_test() into three subtest by setting
.test and .tcnt = 3 so that we can apply the max_runtime per one call of
the test_with_key_type(). Then we can make the test_with_key_type()
runtime aware. I guess that we can just spin both of the children until
they consume a defined portion of runtime.
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/request_key/request_key03.c b/testcases/kernel/syscalls/request_key/request_key03.c
index 3f0c093f3..5cd9b319d 100644
--- a/testcases/kernel/syscalls/request_key/request_key03.c
+++ b/testcases/kernel/syscalls/request_key/request_key03.c
@@ -182,6 +182,7 @@  static void do_test(void)
 static struct tst_test test = {
 	.test_all = do_test,
 	.forks_child = 1,
+	.max_runtime = 10,
 	.options = (struct tst_option[]) {
 		{"b:", &opt_bug,  "Bug to test for (cve-2017-15299 or cve-2017-15951; default is both)"},
 		{}