[LTP] [PATCH] syscalls/msgstress01: Set upper bound for num_messages
Martin Doucha
mdoucha@suse.cz
Mon May 12 13:40:14 CEST 2025
Hi,
if num_messages is higher than avail_messages, the test should at least
print a messages that the default value was reduced. And if the new
value is less than half of the default, the message should be TWARN.
On 12. 05. 25 13:23, Ricardo B. Marlière wrote:
> From: Ricardo B. Marlière <rbm@suse.com>
>
> The msgstress01 test has a workaround to limit the amount of processes it
> will spawn, but it is only used if the option str_num_messages (-n) is
> passed. This is known to be problematic in low memory SUTs, so add a MIN()
> to force the value of avail_msg into num_messages.
>
> Suggested-by: Martin Doucha <mdoucha@suse.cz>
> Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
> ---
> Hello,
>
> as discussed through Github [1], here's the proposed fix.
>
> Thank you,
> rbm
>
> [1] https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/21977
> ---
> testcases/kernel/syscalls/ipc/msgstress/msgstress01.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
> index ae637e5d7ad89c1257c9cce0145122497c19ee64..3525b0b2b973b174ac8df089580a85c19057f05e 100644
> --- a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
> +++ b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
> @@ -271,6 +271,8 @@ static void setup(void)
> if (tst_parse_int(str_num_messages, &num_messages, 1, avail_msg))
> tst_brk(TBROK, "Invalid number of messages '%s'", str_num_messages);
>
> + num_messages = MIN(avail_msg, num_messages);
> +
> if (tst_parse_int(str_num_iterations, &num_iterations, 1, MAXNREPS))
> tst_brk(TBROK, "Invalid number of messages iterations '%s'", str_num_iterations);
>
>
> ---
> base-commit: 4a0e3a8fa7b592958f8e3cd366f63c78fba9f014
> change-id: 20250512-fixes-msgstress01-4157ceb54b38
>
> Best regards,
--
Martin Doucha mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic
More information about the ltp
mailing list